@new-black/lyra 1.29.0-next.1 → 1.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/inputs/date-picker/date-picker.d.ts +40 -2
- package/dist/components/inputs/date-picker/date-picker.d.ts.map +1 -1
- package/dist/components/inputs/date-picker/date-range-picker.d.ts +40 -2
- package/dist/components/inputs/date-picker/date-range-picker.d.ts.map +1 -1
- package/dist/components/inputs/number-field/number-field.d.ts +40 -2
- package/dist/components/inputs/number-field/number-field.d.ts.map +1 -1
- package/dist/components/inputs/search-field/search-field.d.ts +40 -2
- package/dist/components/inputs/search-field/search-field.d.ts.map +1 -1
- package/dist/components/inputs/shared/input-footer.d.ts +14 -1
- package/dist/components/inputs/shared/input-footer.d.ts.map +1 -1
- package/dist/components/inputs/shared/styles.d.ts +45 -0
- package/dist/components/inputs/shared/styles.d.ts.map +1 -1
- package/dist/components/inputs/tag-input/tag-input.d.ts +40 -2
- package/dist/components/inputs/tag-input/tag-input.d.ts.map +1 -1
- package/dist/components/inputs/text-field/text-field.d.ts +41 -3
- package/dist/components/inputs/text-field/text-field.d.ts.map +1 -1
- package/dist/components/inputs/text-field-area/text-field-area.d.ts +39 -1
- package/dist/components/inputs/text-field-area/text-field-area.d.ts.map +1 -1
- package/dist/components/inputs/text-field-area/text-field-area.types.d.ts +2 -2
- package/dist/components/inputs/text-field-area/text-field-area.types.d.ts.map +1 -1
- package/dist/components/inputs/time-field/time-field.d.ts +40 -2
- package/dist/components/inputs/time-field/time-field.d.ts.map +1 -1
- package/dist/components/lists/shared-list-item.d.ts +6 -6
- package/dist/components/svg-icon/svg-icon.d.ts +1 -1
- package/dist/components/text/text.d.ts +7 -0
- package/dist/components/text/text.d.ts.map +1 -1
- package/dist/components/text/text.styles.d.ts +7 -0
- package/dist/components/text/text.styles.d.ts.map +1 -1
- package/dist/index.css +2 -0
- package/dist/lyra.css +1 -1
- package/dist/lyra1133.cjs.map +1 -1
- package/dist/lyra1134.js.map +1 -1
- package/dist/lyra1135.cjs +1 -1
- package/dist/lyra1135.cjs.map +1 -1
- package/dist/lyra1136.js +36 -33
- package/dist/lyra1136.js.map +1 -1
- package/dist/lyra1137.cjs.map +1 -1
- package/dist/lyra1138.js.map +1 -1
- package/dist/lyra757.cjs +1 -1
- package/dist/lyra757.cjs.map +1 -1
- package/dist/lyra758.js +1 -0
- package/dist/lyra758.js.map +1 -1
- package/dist/lyra790.cjs +1 -1
- package/dist/lyra790.cjs.map +1 -1
- package/dist/lyra791.js +8 -0
- package/dist/lyra791.js.map +1 -1
- package/dist/lyra792.cjs +1 -1
- package/dist/lyra792.cjs.map +1 -1
- package/dist/lyra793.js +28 -18
- package/dist/lyra793.js.map +1 -1
- package/dist/lyra808.cjs.map +1 -1
- package/dist/lyra809.js.map +1 -1
- package/dist/lyra813.cjs.map +1 -1
- package/dist/lyra814.js.map +1 -1
- package/dist/lyra822.cjs.map +1 -1
- package/dist/lyra823.js.map +1 -1
- package/dist/lyra824.cjs +1 -1
- package/dist/lyra824.cjs.map +1 -1
- package/dist/lyra825.js +27 -24
- package/dist/lyra825.js.map +1 -1
- package/dist/lyra831.cjs.map +1 -1
- package/dist/lyra832.js.map +1 -1
- package/package.json +1 -1
package/dist/lyra1134.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra1134.js","names":["useContextProps","TextFieldContext","useObjectRef","mergeRefs","AriaTextField","_Fragment","Group","Input","$4064df0d6f9620e1$export$c9058316764c140e","$03e8ab2d84d7657a$export$4338b53315abf666","$7230ffa83bc0c2cf$export$29f1550f4b0d4415","$3a442827418ebe87$export$eb2fcfdbd7ba97d4","$41fb335299a4a39e$export$f5b8910cec6cf069","$b8dcdc58eeae0d40$export$2c73285ae9390cec","$b8dcdc58eeae0d40$export$2129e27b3ef0d483","Fragment$1","_TagInput","props","ref","localTextInputRef","useRef","textInputRef","inputRef","textFieldProps","dictionary","useDictionary","inputValue","setInputValue","useState","internalValue","setInternalValue","value","defaultValue","hasInputHeader","useMemo","shouldRenderInputHeader","hideHintLabel","hideInputHeader","label","sharedInputStyles","internalOnChange","useCallback","onChange","onKeyDown","valueToAdd","onPaste","text","splitValues","x","shouldInputBeRequired","isRequired","tagStyles","tagGroupIsFocused","setTagGroupIsFocused","tagFocusVisible","setTagFocusVisible","inputHasFocus","setInputHasFocus","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","InputHeader","inputField","isFocusWithin","isInvalid","errorMessage","clsx","isDisabled","prev","index","tag","SpanButton","removeButton","SvgIcon","name","InputFooter","description","outerEndSlot","TagInput","fixedForwardRef"],"sources":["../src/components/inputs/tag-input/tag-input.tsx"],"sourcesContent":["import {\n ClipboardEvent,\n ForwardedRef,\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n Group,\n Input,\n TextField as AriaTextField,\n TextFieldContext,\n TextFieldProps as AriaTextFieldProps,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { mergeRefs, useObjectRef } from \"@react-aria/utils\";\nimport { KeyboardEvent } from \"@react-types/shared\";\nimport clsx from \"clsx\";\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { useDictionary } from \"../../../utils/providers/dictionary-provider\";\nimport { SpanButton } from \"../../button/span-button\";\nimport { SvgIcon } from \"../../svg-icon\";\nimport { tagStyles } from \"../input-tag-group\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nexport type TagInputProps = Omit<AriaTextFieldProps, \"value\" | \"defaultValue\" | \"onChange\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasEndSlot\" | \"hasStartSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n placeholder?: string;\n inputRef?: RefObject<HTMLInputElement>;\n value?: string[];\n defaultValue?: string[];\n onChange?: (value: string[]) => void;\n };\n\nconst _TagInput = (\n {\n customHint,\n defaultValue,\n description,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n inputRef,\n label,\n onChange,\n outerEndSlot,\n outerStartSlot,\n value,\n ...props\n }: TagInputProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n\n const localTextInputRef = useRef<HTMLInputElement>(null);\n const textInputRef = useObjectRef(\n inputRef ? mergeRefs(localTextInputRef, inputRef) : localTextInputRef,\n );\n\n const {\n className,\n errorMessage,\n isDisabled = false,\n isInvalid,\n isRequired,\n name,\n ...textFieldProps\n } = props;\n\n const dictionary = useDictionary();\n const [inputValue, setInputValue] = useState(\"\");\n const [internalValue, setInternalValue] = useState(value ?? defaultValue ?? []);\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasInputHeader,\n hasLabel: !!label,\n isInputOnly: false,\n });\n\n useEffect(() => {\n setInternalValue(value ?? defaultValue ?? []);\n }, [value, defaultValue]);\n\n const internalOnChange = useCallback(\n (value: string[]) => {\n setInternalValue(value);\n onChange?.(value);\n },\n [onChange],\n );\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if ([\"Enter\", \",\"].includes(e.key)) {\n e.preventDefault();\n const valueToAdd = e.currentTarget.value.trim();\n if (valueToAdd && !internalValue.includes(valueToAdd)) {\n internalOnChange([...internalValue, e.currentTarget.value.trim()]);\n }\n setInputValue(\"\");\n } else if (e.key === \"Backspace\") {\n if (!e.currentTarget.value) {\n e.preventDefault();\n internalOnChange(internalValue.slice(0, -1));\n }\n }\n },\n [internalOnChange, internalValue],\n );\n\n const onPaste = useCallback(\n (e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n if (e.clipboardData) {\n const text = e.clipboardData.getData(\"Text\");\n if (text) {\n const splitValues = text\n ? text\n .split(\",\")\n // remove zero width characters\n .map((x) => x.replace(/[\\u200B-\\u200D\\uFEFF]/g, \"\"))\n .filter((x) => x.length > 0)\n .map((x) => x.trim())\n : [];\n internalOnChange(Array.from(new Set([...internalValue, ...splitValues])));\n }\n }\n },\n [internalOnChange, internalValue],\n );\n\n const shouldInputBeRequired = useMemo(\n () => isRequired && internalValue.length === 0,\n [internalValue.length, isRequired],\n );\n\n const { removeButton, tag } = tagStyles();\n const [tagGroupIsFocused, setTagGroupIsFocused] = useState(false);\n const [tagFocusVisible, setTagFocusVisible] = useState<number>(0);\n const [inputHasFocus, setInputHasFocus] = useState(false);\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTextField\n className={wrapper({ className })}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isRequired={shouldInputBeRequired}\n {...textFieldProps}\n onKeyDown={onKeyDown}\n value={inputValue}\n onChange={setInputValue}\n onPaste={onPaste}\n ref={ref}\n >\n {({ isDisabled, isInvalid }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n isRequired={isRequired}\n hideHintLabel={hideHintLabel}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isFocusWithin, isHovered }) => {\n return inputField({\n isFocused: isFocusWithin,\n isHovered: isHovered,\n isDisabled,\n isInvalid: isInvalid || !!errorMessage,\n className: \"relative flex-wrap items-start gap-1\",\n });\n }}\n onFocus={() => {\n // Make sure that the input is focused when the group focuses and there are no tags yet\n if (internalValue.length === 0) textInputRef?.current?.focus();\n }}\n >\n <div\n className={clsx(\n internalValue.length && \"-my-px\",\n \"outline-hidden -mx-1 flex w-full flex-wrap gap-1 py-[0.1875rem]\",\n )}\n tabIndex={!isDisabled ? 0 : undefined}\n role=\"grid\"\n onKeyDown={(e) => {\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n setTagFocusVisible((prev) => (prev + 1) % internalValue.length);\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n setTagFocusVisible(\n (prev) => (prev - 1 + internalValue.length) % internalValue.length,\n );\n } else if (e.key === \"Backspace\") {\n if (tagFocusVisible !== -1) {\n internalOnChange(\n internalValue.filter((_, index) => index !== tagFocusVisible),\n );\n }\n }\n }}\n onFocus={() => {\n if (!isDisabled) setTagGroupIsFocused(true);\n }}\n onBlur={() => {\n if (!isDisabled) setTagGroupIsFocused(false);\n }}\n >\n {internalValue.map((value, index) => (\n <div\n key={value}\n className={tag({\n allowsRemoving: true,\n className: clsx(\n tagGroupIsFocused &&\n index === tagFocusVisible &&\n !inputHasFocus &&\n !isDisabled\n ? \"border-focus shadow-highlight\"\n : \"\",\n ),\n })}\n aria-label={value}\n aria-colindex={index + 1}\n role=\"gridcell\"\n onClick={() => {\n if (!isDisabled) {\n setTagFocusVisible(index);\n }\n }}\n >\n {value}\n {!isDisabled && (\n <SpanButton\n className={removeButton({ isDisabled })}\n onPress={() => internalOnChange(internalValue.filter((x) => x !== value))}\n >\n <SvgIcon name=\"clear\" />\n </SpanButton>\n )}\n </div>\n ))}\n\n <Input\n className=\"outline-hidden -my-0.5 h-7 w-full min-w-36 flex-1 ps-2\"\n ref={textInputRef}\n onFocus={() => {\n if (!isDisabled) {\n setInputHasFocus(true);\n }\n }}\n onBlur={() => {\n if (!isDisabled) {\n setInputHasFocus(false);\n }\n }}\n />\n </div>\n {name ? <input type=\"hidden\" value={internalValue.join(\",\")} name={name} /> : null}\n </Group>\n <InputFooter\n description={description ?? dictionary.tagInputDescription}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTextField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\n_TagInput.displayName = \"TagInput\";\n\nexport const TagInput = fixedForwardRef(_TagInput);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuDA,IAAMgB,KACJ,EACE,eACA,iBACA,gBACA,eAAY,IACZ,kBACA,qBACA,oBACA,aACA,UACA,aACA,iBACA,mBACA,UACA,GAAGC,KAEL,MACG;CACH,CAACA,GAAOC,KAAOlB,GAAgBiB,GAAOC,GAAKjB,CAAgB;CAE3D,IAAMkB,IAAoBC,EAAyB,IAAI,GACjDC,IAAenB,EACnBoB,IAAWnB,EAAUgB,GAAmBG,CAAQ,IAAIH,CACtD,GAEM,EACJ,cACA,iBACA,gBAAa,IACb,cACA,eACA,SACA,GAAGI,MACDN,GAEEO,IAAaC,EAAc,GAC3B,CAACC,GAAYC,KAAiBC,EAAS,EAAE,GACzC,CAACC,GAAeC,KAAoBF,EAASG,KAASC,KAAgB,CAAC,CAAC,GAExEC,IAAiBC,QACfC,GAAwB;EAAE;EAAe;EAAiB;CAAM,CAAC,GACvE;EAACC;EAAeC;EAAiBC;CAAK,CACxC,GAEM,EAAE,eAAY,cAAW,uBAAmB,gBAAYC,EAAkB;EAC9E;EACA;EACA,UAAU,CAAC,CAACD;EACZ,aAAa;CACf,CAAC;CAED,SAAgB;EACd,EAAiBP,KAASC,KAAgB,CAAC,CAAC;CAC9C,GAAG,CAACD,GAAOC,CAAY,CAAC;CAExB,IAAMQ,IAAmBC,GACtB,MAAoB;EAEnB,AADAX,EAAiBC,CAAK,GACtBW,IAAWX,CAAK;CAClB,GACA,CAACW,CAAQ,CACX,GAEMC,KAAYF,GACf,MAAqB;EACpB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,EAAE,GAAG,GAAG;GAClC,EAAE,eAAe;GACjB,IAAMG,IAAa,EAAE,cAAc,MAAM,KAAK;GAI9C,AAHIA,KAAc,CAACf,EAAc,SAASe,CAAU,KAClDJ,EAAiB,CAAC,GAAGX,GAAe,EAAE,cAAc,MAAM,KAAK,CAAC,C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AAC;SAExE,UAAA,kBAAC2C,GAAD,EAAS,MAAK,QAAS,CAAA;QACb,CAAA,CAEX;OA9BE,GAAA3C,CA8BF,CACN,GAED,kBAACxB,GAAD;QACE,WAAU;QACV,KAAKc;QACL,eAAe;SACb,AAAK+C,KACHX,EAAiB,EAAI;QAEzB;QACA,cAAc;SACZ,AAAKW,KACHX,EAAiB,EAAK;QAE1B;OACD,CAAA,CACE;MACJ,CAAA,GAAAkB,IAAO,kBAAC,SAAD;OAAO,MAAK;OAAS,OAAO9C,EAAc,KAAK,GAAG;OAAS;MAAO,CAAA,IAAI,IACzE;;KACP,kBAAC+C,IAAD;MACE,aAAaC,KAAerD,EAAW;MACzB;MACG;KAClB,CAAA;IACD,EAAA,CAAA;GAES,CAAA;GACdsD,IAAe,kBAAC,OAAD;IAAK,WAAWlB,EAAU;IAAI,UAAAkB;GAAkB,CAAA,IAAI;EACjE;;AAET;AAEA,EAAU,cAAc;AAExB,IAAaC,IAAWC,EAAgBhE,CAAS"}
|
|
1
|
+
{"version":3,"file":"lyra1134.js","names":["useContextProps","TextFieldContext","useObjectRef","mergeRefs","AriaTextField","_Fragment","Group","Input","$4064df0d6f9620e1$export$c9058316764c140e","$03e8ab2d84d7657a$export$4338b53315abf666","$7230ffa83bc0c2cf$export$29f1550f4b0d4415","$3a442827418ebe87$export$eb2fcfdbd7ba97d4","$41fb335299a4a39e$export$f5b8910cec6cf069","$b8dcdc58eeae0d40$export$2c73285ae9390cec","$b8dcdc58eeae0d40$export$2129e27b3ef0d483","Fragment$1","_TagInput","props","ref","localTextInputRef","useRef","textInputRef","inputRef","textFieldProps","dictionary","useDictionary","inputValue","setInputValue","useState","internalValue","setInternalValue","value","defaultValue","hasInputHeader","useMemo","shouldRenderInputHeader","hideHintLabel","hideInputHeader","label","sharedInputStyles","internalOnChange","useCallback","onChange","onKeyDown","valueToAdd","onPaste","text","splitValues","x","shouldInputBeRequired","isRequired","tagStyles","tagGroupIsFocused","setTagGroupIsFocused","tagFocusVisible","setTagFocusVisible","inputHasFocus","setInputHasFocus","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","InputHeader","inputField","isFocusWithin","isInvalid","errorMessage","clsx","isDisabled","prev","index","tag","SpanButton","removeButton","SvgIcon","name","InputFooter","description","outerEndSlot","TagInput","fixedForwardRef"],"sources":["../src/components/inputs/tag-input/tag-input.tsx"],"sourcesContent":["import {\n ClipboardEvent,\n ForwardedRef,\n RefObject,\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n} from \"react\";\nimport {\n Group,\n Input,\n TextField as AriaTextField,\n TextFieldContext,\n TextFieldProps as AriaTextFieldProps,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { mergeRefs, useObjectRef } from \"@react-aria/utils\";\nimport { KeyboardEvent } from \"@react-types/shared\";\nimport clsx from \"clsx\";\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { useDictionary } from \"../../../utils/providers/dictionary-provider\";\nimport { SpanButton } from \"../../button/span-button\";\nimport { SvgIcon } from \"../../svg-icon\";\nimport { tagStyles } from \"../input-tag-group\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nexport type TagInputProps = Omit<AriaTextFieldProps, \"value\" | \"defaultValue\" | \"onChange\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasEndSlot\" | \"hasStartSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\" | \"isWarning\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n placeholder?: string;\n inputRef?: RefObject<HTMLInputElement>;\n value?: string[];\n defaultValue?: string[];\n onChange?: (value: string[]) => void;\n };\n\nconst _TagInput = (\n {\n customHint,\n defaultValue,\n description,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n inputRef,\n label,\n onChange,\n outerEndSlot,\n outerStartSlot,\n value,\n ...props\n }: TagInputProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n\n const localTextInputRef = useRef<HTMLInputElement>(null);\n const textInputRef = useObjectRef(\n inputRef ? mergeRefs(localTextInputRef, inputRef) : localTextInputRef,\n );\n\n const {\n className,\n errorMessage,\n isDisabled = false,\n isInvalid,\n isRequired,\n name,\n ...textFieldProps\n } = props;\n\n const dictionary = useDictionary();\n const [inputValue, setInputValue] = useState(\"\");\n const [internalValue, setInternalValue] = useState(value ?? defaultValue ?? []);\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasInputHeader,\n hasLabel: !!label,\n isInputOnly: false,\n });\n\n useEffect(() => {\n setInternalValue(value ?? defaultValue ?? []);\n }, [value, defaultValue]);\n\n const internalOnChange = useCallback(\n (value: string[]) => {\n setInternalValue(value);\n onChange?.(value);\n },\n [onChange],\n );\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if ([\"Enter\", \",\"].includes(e.key)) {\n e.preventDefault();\n const valueToAdd = e.currentTarget.value.trim();\n if (valueToAdd && !internalValue.includes(valueToAdd)) {\n internalOnChange([...internalValue, e.currentTarget.value.trim()]);\n }\n setInputValue(\"\");\n } else if (e.key === \"Backspace\") {\n if (!e.currentTarget.value) {\n e.preventDefault();\n internalOnChange(internalValue.slice(0, -1));\n }\n }\n },\n [internalOnChange, internalValue],\n );\n\n const onPaste = useCallback(\n (e: ClipboardEvent<HTMLInputElement>) => {\n e.preventDefault();\n\n if (e.clipboardData) {\n const text = e.clipboardData.getData(\"Text\");\n if (text) {\n const splitValues = text\n ? text\n .split(\",\")\n // remove zero width characters\n .map((x) => x.replace(/[\\u200B-\\u200D\\uFEFF]/g, \"\"))\n .filter((x) => x.length > 0)\n .map((x) => x.trim())\n : [];\n internalOnChange(Array.from(new Set([...internalValue, ...splitValues])));\n }\n }\n },\n [internalOnChange, internalValue],\n );\n\n const shouldInputBeRequired = useMemo(\n () => isRequired && internalValue.length === 0,\n [internalValue.length, isRequired],\n );\n\n const { removeButton, tag } = tagStyles();\n const [tagGroupIsFocused, setTagGroupIsFocused] = useState(false);\n const [tagFocusVisible, setTagFocusVisible] = useState<number>(0);\n const [inputHasFocus, setInputHasFocus] = useState(false);\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTextField\n className={wrapper({ className })}\n isDisabled={isDisabled}\n isInvalid={isInvalid}\n isRequired={shouldInputBeRequired}\n {...textFieldProps}\n onKeyDown={onKeyDown}\n value={inputValue}\n onChange={setInputValue}\n onPaste={onPaste}\n ref={ref}\n >\n {({ isDisabled, isInvalid }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n isRequired={isRequired}\n hideHintLabel={hideHintLabel}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isFocusWithin, isHovered }) => {\n return inputField({\n isFocused: isFocusWithin,\n isHovered: isHovered,\n isDisabled,\n isInvalid: isInvalid || !!errorMessage,\n className: \"relative flex-wrap items-start gap-1\",\n });\n }}\n onFocus={() => {\n // Make sure that the input is focused when the group focuses and there are no tags yet\n if (internalValue.length === 0) textInputRef?.current?.focus();\n }}\n >\n <div\n className={clsx(\n internalValue.length && \"-my-px\",\n \"outline-hidden -mx-1 flex w-full flex-wrap gap-1 py-[0.1875rem]\",\n )}\n tabIndex={!isDisabled ? 0 : undefined}\n role=\"grid\"\n onKeyDown={(e) => {\n if (e.key === \"ArrowRight\") {\n e.preventDefault();\n setTagFocusVisible((prev) => (prev + 1) % internalValue.length);\n } else if (e.key === \"ArrowLeft\") {\n e.preventDefault();\n setTagFocusVisible(\n (prev) => (prev - 1 + internalValue.length) % internalValue.length,\n );\n } else if (e.key === \"Backspace\") {\n if (tagFocusVisible !== -1) {\n internalOnChange(\n internalValue.filter((_, index) => index !== tagFocusVisible),\n );\n }\n }\n }}\n onFocus={() => {\n if (!isDisabled) setTagGroupIsFocused(true);\n }}\n onBlur={() => {\n if (!isDisabled) setTagGroupIsFocused(false);\n }}\n >\n {internalValue.map((value, index) => (\n <div\n key={value}\n className={tag({\n allowsRemoving: true,\n className: clsx(\n tagGroupIsFocused &&\n index === tagFocusVisible &&\n !inputHasFocus &&\n !isDisabled\n ? \"border-focus shadow-highlight\"\n : \"\",\n ),\n })}\n aria-label={value}\n aria-colindex={index + 1}\n role=\"gridcell\"\n onClick={() => {\n if (!isDisabled) {\n setTagFocusVisible(index);\n }\n }}\n >\n {value}\n {!isDisabled && (\n <SpanButton\n className={removeButton({ isDisabled })}\n onPress={() => internalOnChange(internalValue.filter((x) => x !== value))}\n >\n <SvgIcon name=\"clear\" />\n </SpanButton>\n )}\n </div>\n ))}\n\n <Input\n className=\"outline-hidden -my-0.5 h-7 w-full min-w-36 flex-1 ps-2\"\n ref={textInputRef}\n onFocus={() => {\n if (!isDisabled) {\n setInputHasFocus(true);\n }\n }}\n onBlur={() => {\n if (!isDisabled) {\n setInputHasFocus(false);\n }\n }}\n />\n </div>\n {name ? <input type=\"hidden\" value={internalValue.join(\",\")} name={name} /> : null}\n </Group>\n <InputFooter\n description={description ?? dictionary.tagInputDescription}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTextField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\n_TagInput.displayName = \"TagInput\";\n\nexport const TagInput = fixedForwardRef(_TagInput);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAuDA,IAAMgB,KACJ,EACE,eACA,iBACA,gBACA,eAAY,IACZ,kBACA,qBACA,oBACA,aACA,UACA,aACA,iBACA,mBACA,U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zB;QACA,cAAc;SACZ,AAAKW,KACHX,EAAiB,EAAK;QAE1B;OACD,CAAA,CACE;MACJ,CAAA,GAAAkB,IAAO,kBAAC,SAAD;OAAO,MAAK;OAAS,OAAO9C,EAAc,KAAK,GAAG;OAAS;MAAO,CAAA,IAAI,IACzE;;KACP,kBAAC+C,IAAD;MACE,aAAaC,KAAerD,EAAW;MACzB;MACG;KAClB,CAAA;IACD,EAAA,CAAA;GAES,CAAA;GACdsD,IAAe,kBAAC,OAAD;IAAK,WAAWlB,EAAU;IAAI,UAAAkB;GAAkB,CAAA,IAAI;EACjE;;AAET;AAEA,EAAU,cAAc;AAExB,IAAaC,IAAWC,EAAgBhE,CAAS"}
|
package/dist/lyra1135.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./lyra25.cjs"),t=require("./lyra26.cjs"),n=require("./lyra32.cjs"),r=require("./lyra583.cjs"),i=require("./lyra603.cjs"),a=require("./lyra621.cjs"),o=require("./lyra744.cjs"),s=require("./lyra745.cjs"),c=require("./lyra790.cjs"),l=require("./lyra791.cjs"),u=require("./lyra792.cjs");require("./lyra793.cjs");const d=require("./lyra805.cjs");let f=require("react"),p=require("react/jsx-runtime");var m=({customHint:r,description:m,endSlot:h,fullWidth:g=!0,hideHintLabel:_,hideInputFooter:v,hideInputHeader:y,label:b,maxRows:x,outerEndSlot:S,outerStartSlot:C,rows:w=1,startSlot:T,textAreaRef:
|
|
1
|
+
const e=require("./lyra25.cjs"),t=require("./lyra26.cjs"),n=require("./lyra32.cjs"),r=require("./lyra583.cjs"),i=require("./lyra603.cjs"),a=require("./lyra621.cjs"),o=require("./lyra744.cjs"),s=require("./lyra745.cjs"),c=require("./lyra790.cjs"),l=require("./lyra791.cjs"),u=require("./lyra792.cjs");require("./lyra793.cjs");const d=require("./lyra805.cjs");let f=require("react"),p=require("react/jsx-runtime");var m=({customHint:r,description:m,endSlot:h,fullWidth:g=!0,hideHintLabel:_,hideInputFooter:v,hideInputHeader:y,label:b,maxRows:x,outerEndSlot:S,outerStartSlot:C,rows:w=1,startSlot:T,warningMessage:E,textAreaRef:D,...O},k)=>{[O,k]=i.useContextProps(O,k,s.TextFieldContext);let{className:A,errorMessage:j,isDisabled:M=!1,isInvalid:N,isReadOnly:P,isRequired:F,...I}=O,L=(0,f.useRef)(null),R=n.useObjectRef(D?e.mergeRefs(L,D):L),z=(0,f.useMemo)(()=>d.shouldRenderInputHeader({hideHintLabel:_,hideInputHeader:y,label:b}),[_,y,b]),{input:B,inputField:V,outerSlot:H,outerSlotsWrapper:U,wrapper:W}=c.sharedInputStyles({fullWidth:g,hasStartSlot:!!T,hasEndSlot:!!h,hasInputHeader:z,hasLabel:!!b}),[G,K]=(0,f.useState)(O.value??O.defaultValue??``),q=e=>{K(e),O.onChange?.(e)},J=(0,f.useCallback)(()=>{if(R?.current){let e=parseInt(window.getComputedStyle(document.documentElement).fontSize);R.current.style.height=`auto`;let t=x?Math.round(x):void 0,n=t?t+.5:void 0,r=n?n*e:void 0;r&&R.current.scrollHeight>r?R.current.style.maxHeight=`${r}px`:R.current.style.height=`${R.current.scrollHeight}px`}},[x,R]);return(0,f.useLayoutEffect)(()=>(J(),window.addEventListener(`resize`,J),()=>{window.removeEventListener(`resize`,J)}),[J,G]),(0,p.jsxs)(`div`,{className:U(),children:[C?(0,p.jsx)(`div`,{className:H(),children:C}):null,(0,p.jsx)(s.TextField,{className:W({className:A}),isDisabled:M,isRequired:F,isReadOnly:P,isInvalid:N,...I,onChange:q,ref:k,children:({isDisabled:e,isInvalid:n})=>(0,p.jsxs)(p.Fragment,{children:[z?(0,p.jsx)(l.InputHeader,{label:b,isRequired:F,hideHintLabel:_,customHint:r}):null,(0,p.jsxs)(a.Group,{className:({isFocusWithin:t,isHovered:r})=>V({isFocused:t,isHovered:r,isDisabled:e||P,isInvalid:n||!!j,isWarning:!!E&&!n&&!j}),children:[T,(0,p.jsx)(o.TextArea,{className:B({className:t.clsx(!!T&&`ps-1`,!!h&&`pe-1`,`resize-none`,`overflow-x-hidden`,`py-[0.4375rem]`)}),ref:R,required:F,disabled:e,readOnly:P,rows:w}),h]}),(0,p.jsx)(u.InputFooter,{description:m,errorMessage:j,warningMessage:E,isInvalid:n,hideInputFooter:v})]})}),S?(0,p.jsx)(`div`,{className:H(),children:S}):null]})};m.displayName=`TextFieldArea`;var h=r.fixedForwardRef(m);exports.TextFieldArea=h;
|
package/dist/lyra1135.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra1135.cjs","names":["useContextProps","TextFieldContext","useRef","useObjectRef","mergeRefs","useMemo","shouldRenderInputHeader","sharedInputStyles","useState","useCallback","AriaTextField","_Fragment","InputHeader","Group","TextArea","clsx","InputFooter","fixedForwardRef","require_mergeRefs","require_clsx","require_useObjectRef","require_helpers","require_utils","require_Group","require_TextArea","require_TextField","require_styles","require_input_header","require_input_footer","require_helpers$1","react","react_jsx_runtime","_TextFieldArea","props","ref","textFieldprops","innerTextAreaRef","mergedTextAreaRef","textAreaRef","hasInputHeader","hideHintLabel","hideInputHeader","label","startSlot","endSlot","innerValue","setInnerValue","onChange","newValue","handleResize","rootFontSizePx","maxRowsInt","maxRows","maxHeightInRem","maxHeight","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","inputField","isFocusWithin","isDisabled","isReadOnly","isInvalid","errorMessage","input","isRequired","outerEndSlot","TextFieldArea"],"sources":["../src/components/inputs/text-field-area/text-field-area.tsx"],"sourcesContent":["import { ForwardedRef, useCallback, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport {\n Group,\n TextArea,\n TextField as AriaTextField,\n TextFieldContext,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { mergeRefs, useObjectRef } from \"@react-aria/utils\";\nimport clsx from \"clsx\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { InputFooter, InputHeader, sharedInputStyles } from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\n\nimport { TextFieldAreaProps } from \"./text-field-area.types\";\n\nconst _TextFieldArea = (\n {\n customHint,\n description,\n endSlot,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n maxRows,\n outerEndSlot,\n outerStartSlot,\n rows = 1,\n startSlot,\n textAreaRef,\n ...props\n }: TextFieldAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n const {\n className,\n errorMessage,\n isDisabled = false,\n isInvalid,\n isReadOnly,\n isRequired,\n ...textFieldprops\n } = props;\n\n const innerTextAreaRef = useRef<HTMLTextAreaElement>(null);\n const mergedTextAreaRef = useObjectRef(\n textAreaRef ? mergeRefs(innerTextAreaRef, textAreaRef) : innerTextAreaRef,\n );\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { input, inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: !!endSlot,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const [innerValue, setInnerValue] = useState(props.value ?? props.defaultValue ?? \"\");\n\n const onChange: TextFieldAreaProps[\"onChange\"] = (newValue) => {\n setInnerValue(newValue);\n props.onChange?.(newValue);\n };\n\n const handleResize = useCallback(() => {\n if (mergedTextAreaRef?.current) {\n const rootFontSizePx = parseInt(window.getComputedStyle(document.documentElement).fontSize);\n mergedTextAreaRef.current.style.height = \"auto\";\n const maxRowsInt = maxRows ? Math.round(maxRows) : undefined;\n const maxHeightInRem = maxRowsInt ? maxRowsInt + 0.5 : undefined;\n const maxHeight = maxHeightInRem ? maxHeightInRem * rootFontSizePx : undefined;\n\n if (maxHeight && mergedTextAreaRef.current.scrollHeight > maxHeight) {\n mergedTextAreaRef.current.style.maxHeight = `${maxHeight}px`;\n } else {\n mergedTextAreaRef.current.style.height = `${mergedTextAreaRef.current.scrollHeight}px`;\n }\n }\n }, [maxRows, mergedTextAreaRef]);\n\n useLayoutEffect(() => {\n handleResize();\n\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n // Adding dependency to the innerValue to make sure we resize the element every time the input is changed\n }, [handleResize, innerValue]);\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTextField\n className={wrapper({ className })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n {...textFieldprops}\n onChange={onChange}\n ref={ref}\n >\n {({ isDisabled, isInvalid }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n isRequired={isRequired}\n hideHintLabel={hideHintLabel}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isFocusWithin, isHovered }) => {\n return inputField({\n isFocused: isFocusWithin,\n isHovered: isHovered,\n isDisabled: isDisabled || isReadOnly,\n isInvalid: isInvalid || !!errorMessage,\n });\n }}\n >\n {startSlot}\n <TextArea\n className={input({\n className: clsx(\n !!startSlot && \"ps-1\",\n !!endSlot && \"pe-1\",\n \"resize-none\",\n \"overflow-x-hidden\",\n \"py-[0.4375rem]\",\n ),\n })}\n ref={mergedTextAreaRef}\n required={isRequired}\n disabled={isDisabled}\n readOnly={isReadOnly}\n rows={rows}\n />\n {endSlot}\n </Group>\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTextField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\n_TextFieldArea.displayName = \"TextFieldArea\";\nexport const TextFieldArea = fixedForwardRef(_TextFieldArea);\n"],"mappings":"A,4ZAkBA,IAAMgC,GACJ,CACE,aACA,cACA,UACA,YAAY,GACZ,gBACA,kBACA,kBACA,QACA,UACA,eACA,iBACA,OAAO,EACP,YACA,cACA,GAAGC,GAEL,IACG,CAC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f,CAAiB,CAAC,EAY/B,OAVA,EAAAP,EAAA,gBAAA,MACEmB,EAAa,EAEb,OAAO,iBAAiB,SAAUA,CAAY,MACjC,CACX,OAAO,oBAAoB,SAAUA,CAAY,CACnD,GAEC,CAACA,EAAcJ,CAAU,CAAC,GAG3B,EAAAd,EAAA,KAAA,CAAC,MAAD,CAAK,UAAWwB,EAAkB,EAAlC,SAAA,CACGC,GAAiB,EAAAzB,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW0B,EAAU,EAAI,SAAAD,CAAoB,CAAA,EAAI,MACxE,EAAAzB,EAAA,IAAA,CAACrB,EAAAA,UAAD,CACE,UAAWgD,EAAQ,CAAE,WAAU,CAAC,EACpB,aACA,aACA,aACD,YACX,GAAIvB,EACM,WACL,MAEH,UAAA,CAAE,aAAY,gBACd,EAAAJ,EAAA,KAAA,CAAApB,EAAAA,SAAA,CAAA,SAAA,CACG4B,GACC,EAAAR,EAAA,IAAA,CAACnB,EAAAA,YAAD,CACS,QACK,aACG,gBACH,YACb,CAAA,EACC,MACJ,EAAAmB,EAAA,KAAA,CAAClB,EAAAA,MAAD,CACE,WAAY,CAAE,gBAAe,eACpB8C,EAAW,CAChB,UAAWC,EACA,YACX,WAAYC,GAAcC,EAC1B,UAAWC,GAAa,CAAC,CAACC,
|
|
1
|
+
{"version":3,"file":"lyra1135.cjs","names":["useContextProps","TextFieldContext","useRef","useObjectRef","mergeRefs","useMemo","shouldRenderInputHeader","sharedInputStyles","useState","useCallback","AriaTextField","_Fragment","InputHeader","Group","TextArea","clsx","InputFooter","fixedForwardRef","require_mergeRefs","require_clsx","require_useObjectRef","require_helpers","require_utils","require_Group","require_TextArea","require_TextField","require_styles","require_input_header","require_input_footer","require_helpers$1","react","react_jsx_runtime","_TextFieldArea","props","ref","textFieldprops","innerTextAreaRef","mergedTextAreaRef","textAreaRef","hasInputHeader","hideHintLabel","hideInputHeader","label","startSlot","endSlot","innerValue","setInnerValue","onChange","newValue","handleResize","rootFontSizePx","maxRowsInt","maxRows","maxHeightInRem","maxHeight","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","inputField","isFocusWithin","isDisabled","isReadOnly","isInvalid","errorMessage","warningMessage","input","isRequired","outerEndSlot","TextFieldArea"],"sources":["../src/components/inputs/text-field-area/text-field-area.tsx"],"sourcesContent":["import { ForwardedRef, useCallback, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport {\n Group,\n TextArea,\n TextField as AriaTextField,\n TextFieldContext,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { mergeRefs, useObjectRef } from \"@react-aria/utils\";\nimport clsx from \"clsx\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { InputFooter, InputHeader, sharedInputStyles } from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\n\nimport { TextFieldAreaProps } from \"./text-field-area.types\";\n\nconst _TextFieldArea = (\n {\n customHint,\n description,\n endSlot,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n maxRows,\n outerEndSlot,\n outerStartSlot,\n rows = 1,\n startSlot,\n warningMessage,\n textAreaRef,\n ...props\n }: TextFieldAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n const {\n className,\n errorMessage,\n isDisabled = false,\n isInvalid,\n isReadOnly,\n isRequired,\n ...textFieldprops\n } = props;\n\n const innerTextAreaRef = useRef<HTMLTextAreaElement>(null);\n const mergedTextAreaRef = useObjectRef(\n textAreaRef ? mergeRefs(innerTextAreaRef, textAreaRef) : innerTextAreaRef,\n );\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { input, inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: !!endSlot,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const [innerValue, setInnerValue] = useState(props.value ?? props.defaultValue ?? \"\");\n\n const onChange: TextFieldAreaProps[\"onChange\"] = (newValue) => {\n setInnerValue(newValue);\n props.onChange?.(newValue);\n };\n\n const handleResize = useCallback(() => {\n if (mergedTextAreaRef?.current) {\n const rootFontSizePx = parseInt(window.getComputedStyle(document.documentElement).fontSize);\n mergedTextAreaRef.current.style.height = \"auto\";\n const maxRowsInt = maxRows ? Math.round(maxRows) : undefined;\n const maxHeightInRem = maxRowsInt ? maxRowsInt + 0.5 : undefined;\n const maxHeight = maxHeightInRem ? maxHeightInRem * rootFontSizePx : undefined;\n\n if (maxHeight && mergedTextAreaRef.current.scrollHeight > maxHeight) {\n mergedTextAreaRef.current.style.maxHeight = `${maxHeight}px`;\n } else {\n mergedTextAreaRef.current.style.height = `${mergedTextAreaRef.current.scrollHeight}px`;\n }\n }\n }, [maxRows, mergedTextAreaRef]);\n\n useLayoutEffect(() => {\n handleResize();\n\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n // Adding dependency to the innerValue to make sure we resize the element every time the input is changed\n }, [handleResize, innerValue]);\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTextField\n className={wrapper({ className })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n {...textFieldprops}\n onChange={onChange}\n ref={ref}\n >\n {({ isDisabled, isInvalid }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n isRequired={isRequired}\n hideHintLabel={hideHintLabel}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isFocusWithin, isHovered }) => {\n return inputField({\n isFocused: isFocusWithin,\n isHovered: isHovered,\n isDisabled: isDisabled || isReadOnly,\n isInvalid: isInvalid || !!errorMessage,\n isWarning: !!warningMessage && !isInvalid && !errorMessage,\n });\n }}\n >\n {startSlot}\n <TextArea\n className={input({\n className: clsx(\n !!startSlot && \"ps-1\",\n !!endSlot && \"pe-1\",\n \"resize-none\",\n \"overflow-x-hidden\",\n \"py-[0.4375rem]\",\n ),\n })}\n ref={mergedTextAreaRef}\n required={isRequired}\n disabled={isDisabled}\n readOnly={isReadOnly}\n rows={rows}\n />\n {endSlot}\n </Group>\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n warningMessage={warningMessage}\n isInvalid={isInvalid}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTextField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\n_TextFieldArea.displayName = \"TextFieldArea\";\nexport const TextFieldArea = fixedForwardRef(_TextFieldArea);\n"],"mappings":"A,4ZAkBA,IAAMgC,GACJ,CACE,aACA,cACA,UACA,YAAY,GACZ,gBACA,kBACA,kBACA,QACA,UACA,eACA,iBACA,OAAO,EACP,YACA,iBACA,cACA,GAAGC,GAEL,IACG,CACH,CAACA,EAAOC,GAAOlC,EAAAA,gBAAgBiC,EAAOC,EAAKjC,EAAAA,gBAAgB,EAC3D,GAAM,CACJ,YACA,eACA,aAAa,GACb,YACA,aACA,aACA,GAAGkC,GACDF,EAEEG,GAAA,EAAmBlC,EAAAA,OAAAA,CAA4B,IAAI,EACnDmC,EAAoBlC,EAAAA,aACxBmC,EAAclC,EAAAA,UAAUgC,EAAkBE,CAAW,EAAIF,CAC3D,EAEMG,GAAA,EAAiBlC,EAAAA,QAAAA,KACfC,EAAAA,wBAAwB,CAAE,gBAAe,kBAAiB,OAAM,CAAC,EACvE,CAACkC,EAAeC,EAAiBC,CAAK,CACxC,EAEM,CAAE,QAAO,aAAY,YAAW,oBAAmB,WAAYnC,EAAAA,kBAAkB,CACrF,YACA,aAAc,CAAC,CAACoC,EAChB,WAAY,CAAC,CAACC,EACd,iBACA,SAAU,CAAC,CAACF,CACd,CAAC,EAEK,CAACG,EAAYC,IAAA,EAAiBtC,EAAAA,SAAAA,CAASyB,EAAM,OA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,CAAA,EACC,MACJ,EAAAmB,EAAA,KAAA,CAAClB,EAAAA,MAAD,CACE,WAAY,CAAE,gBAAe,eACpB8C,EAAW,CAChB,UAAWC,EACA,YACX,WAAYC,GAAcC,EAC1B,UAAWC,GAAa,CAAC,CAACC,EAC1B,UAAW,CAAC,CAACC,GAAkB,CAACF,GAAa,CAACC,CAChD,CAAC,EARL,SAAA,CAWGrB,GACD,EAAAZ,EAAA,IAAA,CAACjB,EAAAA,SAAD,CACE,UAAWoD,EAAM,CACf,UAAWnD,EAAAA,KACT,CAAC,CAAC4B,GAAa,OACf,CAAC,CAACC,GAAW,OACb,cACA,oBACA,gBACF,CACF,CAAC,EACD,IAAKP,EACL,SAAU8B,EACV,SAAUN,EACV,SAAUC,EACJ,MACP,CAAA,EACAlB,CACI,C,IACP,EAAAb,EAAA,IAAA,CAACf,EAAAA,YAAD,CACe,cACC,eACE,iBACL,YACM,iBAClB,CAAA,CACD,CAAA,CAAA,CAES,CAAA,EACdoD,GAAe,EAAArC,EAAA,IAAA,CAAC,MAAD,CAAK,UAAW0B,EAAU,EAAI,SAAAW,CAAkB,CAAA,EAAI,IACjE,C,EAET,EAEA,EAAe,YAAc,gBAC7B,IAAaC,EAAgBpD,EAAAA,gBAAgBe,CAAc,E"}
|
package/dist/lyra1136.js
CHANGED
|
@@ -14,9 +14,9 @@ import { shouldRenderInputHeader as d } from "./lyra806.js";
|
|
|
14
14
|
import { useCallback as f, useLayoutEffect as p, useMemo as m, useRef as h, useState as g } from "react";
|
|
15
15
|
import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
16
16
|
// src/components/inputs/text-field-area/text-field-area.tsx
|
|
17
|
-
var b = ({ customHint: r, description: b, endSlot: x, fullWidth: S = !0, hideHintLabel: C, hideInputFooter: w, hideInputHeader: T, label: E, maxRows: D, outerEndSlot: O, outerStartSlot: k, rows: A = 1, startSlot: j,
|
|
18
|
-
[
|
|
19
|
-
let { className:
|
|
17
|
+
var b = ({ customHint: r, description: b, endSlot: x, fullWidth: S = !0, hideHintLabel: C, hideInputFooter: w, hideInputHeader: T, label: E, maxRows: D, outerEndSlot: O, outerStartSlot: k, rows: A = 1, startSlot: j, warningMessage: M, textAreaRef: N, ...P }, F) => {
|
|
18
|
+
[P, F] = i(P, F, c);
|
|
19
|
+
let { className: I, errorMessage: L, isDisabled: R = !1, isInvalid: z, isReadOnly: B, isRequired: V, ...H } = P, U = h(null), W = n(N ? e(U, N) : U), G = m(() => d({
|
|
20
20
|
hideHintLabel: C,
|
|
21
21
|
hideInputHeader: T,
|
|
22
22
|
label: E
|
|
@@ -24,62 +24,63 @@ var b = ({ customHint: r, description: b, endSlot: x, fullWidth: S = !0, hideHin
|
|
|
24
24
|
C,
|
|
25
25
|
T,
|
|
26
26
|
E
|
|
27
|
-
]), { input:
|
|
27
|
+
]), { input: K, inputField: q, outerSlot: J, outerSlotsWrapper: Y, wrapper: X } = l({
|
|
28
28
|
fullWidth: S,
|
|
29
29
|
hasStartSlot: !!j,
|
|
30
30
|
hasEndSlot: !!x,
|
|
31
|
-
hasInputHeader:
|
|
31
|
+
hasInputHeader: G,
|
|
32
32
|
hasLabel: !!E
|
|
33
|
-
}), [
|
|
34
|
-
|
|
33
|
+
}), [Z, Q] = g(P.value ?? P.defaultValue ?? ""), te = (e) => {
|
|
34
|
+
Q(e), P.onChange?.(e);
|
|
35
35
|
}, $ = f(() => {
|
|
36
|
-
if (
|
|
36
|
+
if (W?.current) {
|
|
37
37
|
let e = parseInt(window.getComputedStyle(document.documentElement).fontSize);
|
|
38
|
-
|
|
38
|
+
W.current.style.height = "auto";
|
|
39
39
|
let t = D ? Math.round(D) : void 0, n = t ? t + .5 : void 0, r = n ? n * e : void 0;
|
|
40
|
-
r &&
|
|
40
|
+
r && W.current.scrollHeight > r ? W.current.style.maxHeight = `${r}px` : W.current.style.height = `${W.current.scrollHeight}px`;
|
|
41
41
|
}
|
|
42
|
-
}, [D,
|
|
42
|
+
}, [D, W]);
|
|
43
43
|
return p(() => ($(), window.addEventListener("resize", $), () => {
|
|
44
44
|
window.removeEventListener("resize", $);
|
|
45
|
-
}), [$,
|
|
46
|
-
className:
|
|
45
|
+
}), [$, Z]), /* @__PURE__ */ y("div", {
|
|
46
|
+
className: Y(),
|
|
47
47
|
children: [
|
|
48
48
|
k ? /* @__PURE__ */ v("div", {
|
|
49
|
-
className:
|
|
49
|
+
className: J(),
|
|
50
50
|
children: k
|
|
51
51
|
}) : null,
|
|
52
52
|
/* @__PURE__ */ v(s, {
|
|
53
|
-
className:
|
|
54
|
-
isDisabled:
|
|
55
|
-
isRequired:
|
|
56
|
-
isReadOnly:
|
|
57
|
-
isInvalid:
|
|
58
|
-
...
|
|
59
|
-
onChange:
|
|
60
|
-
ref:
|
|
53
|
+
className: X({ className: I }),
|
|
54
|
+
isDisabled: R,
|
|
55
|
+
isRequired: V,
|
|
56
|
+
isReadOnly: B,
|
|
57
|
+
isInvalid: z,
|
|
58
|
+
...H,
|
|
59
|
+
onChange: te,
|
|
60
|
+
ref: F,
|
|
61
61
|
children: ({ isDisabled: e, isInvalid: n }) => /* @__PURE__ */ y(_, { children: [
|
|
62
|
-
|
|
62
|
+
G ? /* @__PURE__ */ v(ee, {
|
|
63
63
|
label: E,
|
|
64
|
-
isRequired:
|
|
64
|
+
isRequired: V,
|
|
65
65
|
hideHintLabel: C,
|
|
66
66
|
customHint: r
|
|
67
67
|
}) : null,
|
|
68
68
|
/* @__PURE__ */ y(a, {
|
|
69
|
-
className: ({ isFocusWithin: t, isHovered: r }) =>
|
|
69
|
+
className: ({ isFocusWithin: t, isHovered: r }) => q({
|
|
70
70
|
isFocused: t,
|
|
71
71
|
isHovered: r,
|
|
72
|
-
isDisabled: e ||
|
|
73
|
-
isInvalid: n || !!
|
|
72
|
+
isDisabled: e || B,
|
|
73
|
+
isInvalid: n || !!L,
|
|
74
|
+
isWarning: !!M && !n && !L
|
|
74
75
|
}),
|
|
75
76
|
children: [
|
|
76
77
|
j,
|
|
77
78
|
/* @__PURE__ */ v(o, {
|
|
78
|
-
className:
|
|
79
|
-
ref:
|
|
80
|
-
required:
|
|
79
|
+
className: K({ className: t(!!j && "ps-1", !!x && "pe-1", "resize-none", "overflow-x-hidden", "py-[0.4375rem]") }),
|
|
80
|
+
ref: W,
|
|
81
|
+
required: V,
|
|
81
82
|
disabled: e,
|
|
82
|
-
readOnly:
|
|
83
|
+
readOnly: B,
|
|
83
84
|
rows: A
|
|
84
85
|
}),
|
|
85
86
|
x
|
|
@@ -87,13 +88,15 @@ var b = ({ customHint: r, description: b, endSlot: x, fullWidth: S = !0, hideHin
|
|
|
87
88
|
}),
|
|
88
89
|
/* @__PURE__ */ v(u, {
|
|
89
90
|
description: b,
|
|
90
|
-
errorMessage:
|
|
91
|
+
errorMessage: L,
|
|
92
|
+
warningMessage: M,
|
|
93
|
+
isInvalid: n,
|
|
91
94
|
hideInputFooter: w
|
|
92
95
|
})
|
|
93
96
|
] })
|
|
94
97
|
}),
|
|
95
98
|
O ? /* @__PURE__ */ v("div", {
|
|
96
|
-
className:
|
|
99
|
+
className: J(),
|
|
97
100
|
children: O
|
|
98
101
|
}) : null
|
|
99
102
|
]
|
package/dist/lyra1136.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra1136.js","names":["useContextProps","TextFieldContext","useObjectRef","mergeRefs","AriaTextField","_Fragment","Group","TextArea","$4064df0d6f9620e1$export$c9058316764c140e","$03e8ab2d84d7657a$export$4338b53315abf666","$7230ffa83bc0c2cf$export$29f1550f4b0d4415","$3a442827418ebe87$export$eb2fcfdbd7ba97d4","$bd263d78e9bf3c56$export$f5c9f3c2c4054eec","$b8dcdc58eeae0d40$export$2c73285ae9390cec","$b8dcdc58eeae0d40$export$2129e27b3ef0d483","Fragment$1","_TextFieldArea","props","ref","textFieldprops","innerTextAreaRef","useRef","mergedTextAreaRef","textAreaRef","hasInputHeader","useMemo","shouldRenderInputHeader","hideHintLabel","hideInputHeader","label","sharedInputStyles","startSlot","endSlot","innerValue","setInnerValue","useState","onChange","newValue","handleResize","useCallback","rootFontSizePx","maxRowsInt","maxRows","maxHeightInRem","maxHeight","useLayoutEffect","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","InputHeader","inputField","isFocusWithin","isDisabled","isReadOnly","isInvalid","errorMessage","input","clsx","isRequired","InputFooter","outerEndSlot","TextFieldArea","fixedForwardRef"],"sources":["../src/components/inputs/text-field-area/text-field-area.tsx"],"sourcesContent":["import { ForwardedRef, useCallback, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport {\n Group,\n TextArea,\n TextField as AriaTextField,\n TextFieldContext,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { mergeRefs, useObjectRef } from \"@react-aria/utils\";\nimport clsx from \"clsx\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { InputFooter, InputHeader, sharedInputStyles } from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\n\nimport { TextFieldAreaProps } from \"./text-field-area.types\";\n\nconst _TextFieldArea = (\n {\n customHint,\n description,\n endSlot,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n maxRows,\n outerEndSlot,\n outerStartSlot,\n rows = 1,\n startSlot,\n textAreaRef,\n ...props\n }: TextFieldAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n const {\n className,\n errorMessage,\n isDisabled = false,\n isInvalid,\n isReadOnly,\n isRequired,\n ...textFieldprops\n } = props;\n\n const innerTextAreaRef = useRef<HTMLTextAreaElement>(null);\n const mergedTextAreaRef = useObjectRef(\n textAreaRef ? mergeRefs(innerTextAreaRef, textAreaRef) : innerTextAreaRef,\n );\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { input, inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: !!endSlot,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const [innerValue, setInnerValue] = useState(props.value ?? props.defaultValue ?? \"\");\n\n const onChange: TextFieldAreaProps[\"onChange\"] = (newValue) => {\n setInnerValue(newValue);\n props.onChange?.(newValue);\n };\n\n const handleResize = useCallback(() => {\n if (mergedTextAreaRef?.current) {\n const rootFontSizePx = parseInt(window.getComputedStyle(document.documentElement).fontSize);\n mergedTextAreaRef.current.style.height = \"auto\";\n const maxRowsInt = maxRows ? Math.round(maxRows) : undefined;\n const maxHeightInRem = maxRowsInt ? maxRowsInt + 0.5 : undefined;\n const maxHeight = maxHeightInRem ? maxHeightInRem * rootFontSizePx : undefined;\n\n if (maxHeight && mergedTextAreaRef.current.scrollHeight > maxHeight) {\n mergedTextAreaRef.current.style.maxHeight = `${maxHeight}px`;\n } else {\n mergedTextAreaRef.current.style.height = `${mergedTextAreaRef.current.scrollHeight}px`;\n }\n }\n }, [maxRows, mergedTextAreaRef]);\n\n useLayoutEffect(() => {\n handleResize();\n\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n // Adding dependency to the innerValue to make sure we resize the element every time the input is changed\n }, [handleResize, innerValue]);\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTextField\n className={wrapper({ className })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n {...textFieldprops}\n onChange={onChange}\n ref={ref}\n >\n {({ isDisabled, isInvalid }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n isRequired={isRequired}\n hideHintLabel={hideHintLabel}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isFocusWithin, isHovered }) => {\n return inputField({\n isFocused: isFocusWithin,\n isHovered: isHovered,\n isDisabled: isDisabled || isReadOnly,\n isInvalid: isInvalid || !!errorMessage,\n });\n }}\n >\n {startSlot}\n <TextArea\n className={input({\n className: clsx(\n !!startSlot && \"ps-1\",\n !!endSlot && \"pe-1\",\n \"resize-none\",\n \"overflow-x-hidden\",\n \"py-[0.4375rem]\",\n ),\n })}\n ref={mergedTextAreaRef}\n required={isRequired}\n disabled={isDisabled}\n readOnly={isReadOnly}\n rows={rows}\n />\n {endSlot}\n </Group>\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTextField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\n_TextFieldArea.displayName = \"TextFieldArea\";\nexport const TextFieldArea = fixedForwardRef(_TextFieldArea);\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,IAAMgB,KACJ,EACE,eACA,gBACA,YACA,eAAY,IACZ,kBACA,oBACA,oBACA,UACA,YACA,iBACA,mBACA,UAAO,GACP,cACA,gBACA,GAAGC,KAEL,MACG;CACH,CAACA,GAAOC,KAAOlB,EAAgBiB,GAAOC,GAAKjB,CAAgB;CAC3D,IAAM,EACJ,cACA,iBACA,gBAAa,IACb,cACA,eACA,eACA,GAAGkB,MACDF,GAEEG,IAAmBC,EAA4B,IAAI,GACnDC,IAAoBpB,EACxBqB,IAAcpB,EAAUiB,GAAkBG,CAAW,IAAIH,CAC3D,GAEMI,IAAiBC,QACfC,EAAwB;EAAE;EAAe;EAAiB;CAAM,CAAC,GACvE;EAACC;EAAeC;EAAiBC;CAAK,CACxC,GAEM,EAAE,UAAO,eAAY,cAAW,sBAAmB,eAAYC,EAAkB;EACrF;EACA,cAAc,CAAC,CAACC;EAChB,YAAY,CAAC,CAACC;EACd;EACA,UAAU,CAAC,CAACH;CACd,CAAC,GAEK,CAACI,GAAYC,KAAiBC,EAASlB,EAAM,SAASA,EAAM,gBAAgB,EAAE,GAE9EmB,
|
|
1
|
+
{"version":3,"file":"lyra1136.js","names":["useContextProps","TextFieldContext","useObjectRef","mergeRefs","AriaTextField","_Fragment","Group","TextArea","$4064df0d6f9620e1$export$c9058316764c140e","$03e8ab2d84d7657a$export$4338b53315abf666","$7230ffa83bc0c2cf$export$29f1550f4b0d4415","$3a442827418ebe87$export$eb2fcfdbd7ba97d4","$bd263d78e9bf3c56$export$f5c9f3c2c4054eec","$b8dcdc58eeae0d40$export$2c73285ae9390cec","$b8dcdc58eeae0d40$export$2129e27b3ef0d483","Fragment$1","_TextFieldArea","props","ref","textFieldprops","innerTextAreaRef","useRef","mergedTextAreaRef","textAreaRef","hasInputHeader","useMemo","shouldRenderInputHeader","hideHintLabel","hideInputHeader","label","sharedInputStyles","startSlot","endSlot","innerValue","setInnerValue","useState","onChange","newValue","handleResize","useCallback","rootFontSizePx","maxRowsInt","maxRows","maxHeightInRem","maxHeight","useLayoutEffect","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","InputHeader","inputField","isFocusWithin","isDisabled","isReadOnly","isInvalid","errorMessage","warningMessage","input","clsx","isRequired","InputFooter","outerEndSlot","TextFieldArea","fixedForwardRef"],"sources":["../src/components/inputs/text-field-area/text-field-area.tsx"],"sourcesContent":["import { ForwardedRef, useCallback, useLayoutEffect, useMemo, useRef, useState } from \"react\";\nimport {\n Group,\n TextArea,\n TextField as AriaTextField,\n TextFieldContext,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { mergeRefs, useObjectRef } from \"@react-aria/utils\";\nimport clsx from \"clsx\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { InputFooter, InputHeader, sharedInputStyles } from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\n\nimport { TextFieldAreaProps } from \"./text-field-area.types\";\n\nconst _TextFieldArea = (\n {\n customHint,\n description,\n endSlot,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n maxRows,\n outerEndSlot,\n outerStartSlot,\n rows = 1,\n startSlot,\n warningMessage,\n textAreaRef,\n ...props\n }: TextFieldAreaProps,\n ref: ForwardedRef<HTMLDivElement>,\n) => {\n [props, ref] = useContextProps(props, ref, TextFieldContext);\n const {\n className,\n errorMessage,\n isDisabled = false,\n isInvalid,\n isReadOnly,\n isRequired,\n ...textFieldprops\n } = props;\n\n const innerTextAreaRef = useRef<HTMLTextAreaElement>(null);\n const mergedTextAreaRef = useObjectRef(\n textAreaRef ? mergeRefs(innerTextAreaRef, textAreaRef) : innerTextAreaRef,\n );\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { input, inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: !!endSlot,\n hasInputHeader,\n hasLabel: !!label,\n });\n\n const [innerValue, setInnerValue] = useState(props.value ?? props.defaultValue ?? \"\");\n\n const onChange: TextFieldAreaProps[\"onChange\"] = (newValue) => {\n setInnerValue(newValue);\n props.onChange?.(newValue);\n };\n\n const handleResize = useCallback(() => {\n if (mergedTextAreaRef?.current) {\n const rootFontSizePx = parseInt(window.getComputedStyle(document.documentElement).fontSize);\n mergedTextAreaRef.current.style.height = \"auto\";\n const maxRowsInt = maxRows ? Math.round(maxRows) : undefined;\n const maxHeightInRem = maxRowsInt ? maxRowsInt + 0.5 : undefined;\n const maxHeight = maxHeightInRem ? maxHeightInRem * rootFontSizePx : undefined;\n\n if (maxHeight && mergedTextAreaRef.current.scrollHeight > maxHeight) {\n mergedTextAreaRef.current.style.maxHeight = `${maxHeight}px`;\n } else {\n mergedTextAreaRef.current.style.height = `${mergedTextAreaRef.current.scrollHeight}px`;\n }\n }\n }, [maxRows, mergedTextAreaRef]);\n\n useLayoutEffect(() => {\n handleResize();\n\n window.addEventListener(\"resize\", handleResize);\n return () => {\n window.removeEventListener(\"resize\", handleResize);\n };\n // Adding dependency to the innerValue to make sure we resize the element every time the input is changed\n }, [handleResize, innerValue]);\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTextField\n className={wrapper({ className })}\n isDisabled={isDisabled}\n isRequired={isRequired}\n isReadOnly={isReadOnly}\n isInvalid={isInvalid}\n {...textFieldprops}\n onChange={onChange}\n ref={ref}\n >\n {({ isDisabled, isInvalid }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n isRequired={isRequired}\n hideHintLabel={hideHintLabel}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isFocusWithin, isHovered }) => {\n return inputField({\n isFocused: isFocusWithin,\n isHovered: isHovered,\n isDisabled: isDisabled || isReadOnly,\n isInvalid: isInvalid || !!errorMessage,\n isWarning: !!warningMessage && !isInvalid && !errorMessage,\n });\n }}\n >\n {startSlot}\n <TextArea\n className={input({\n className: clsx(\n !!startSlot && \"ps-1\",\n !!endSlot && \"pe-1\",\n \"resize-none\",\n \"overflow-x-hidden\",\n \"py-[0.4375rem]\",\n ),\n })}\n ref={mergedTextAreaRef}\n required={isRequired}\n disabled={isDisabled}\n readOnly={isReadOnly}\n rows={rows}\n />\n {endSlot}\n </Group>\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n warningMessage={warningMessage}\n isInvalid={isInvalid}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTextField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\n_TextFieldArea.displayName = \"TextFieldArea\";\nexport const TextFieldArea = fixedForwardRef(_TextFieldArea);\n"],"mappings":";;;;;;;;;;;;;;;;AAkBA,IAAMgB,KACJ,EACE,eACA,gBACA,YACA,eAAY,IACZ,kBACA,oBACA,oBACA,UACA,YACA,iBACA,mBACA,UAAO,GACP,cACA,mBACA,gBACA,GAAGC,KAEL,MACG;CACH,CAACA,GAAOC,KAAOlB,EAAgBiB,GAAOC,GAAKjB,CAAgB;CAC3D,IAAM,EACJ,cACA,iBACA,gBAAa,IACb,c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AC,OAAD;IAAK,WAAWC,EAAU;IAAI,UAAAD;GAAoB,CAAA,IAAI;GACxE,kBAAC3C,GAAD;IACE,WAAW6C,EAAQ,EAAE,aAAU,CAAC;IACpB;IACA;IACA;IACD;IACX,GAAI9B;IACM;IACL;IAEH,WAAA,EAAE,eAAY,mBACd,kBAAAd,GAAA,EAAA,UAAA;KACGmB,IACC,kBAAC0B,IAAD;MACS;MACK;MACG;MACH;KACb,CAAA,IACC;KACJ,kBAAC5C,GAAD;MACE,YAAY,EAAE,kBAAe,mBACpB6C,EAAW;OAChB,WAAWC;OACA;OACX,YAAYC,KAAcC;OAC1B,WAAWC,KAAa,CAAC,CAACC;OAC1B,WAAW,CAAC,CAACC,KAAkB,CAACF,KAAa,CAACC;MAChD,CAAC;MARL,UAAA;OAWGzB;OACD,kBAACxB,GAAD;QACE,WAAWmD,EAAM,EACf,WAAWC,EACT,CAAC,CAAC5B,KAAa,QACf,CAAC,CAACC,KAAW,QACb,eACA,qBACA,gBACF,EACF,CAAC;QACD,KAAKV;QACL,UAAUsC;QACV,UAAUP;QACV,UAAUC;QACJ;OACP,CAAA;OACAtB;MACI;;KACP,kBAAC6B,GAAD;MACe;MACC;MACE;MACL;MACM;KAClB,CAAA;IACD,EAAA,CAAA;GAES,CAAA;GACdC,IAAe,kBAAC,OAAD;IAAK,WAAWd,EAAU;IAAI,UAAAc;GAAkB,CAAA,IAAI;EACjE;;AAET;AAEA,EAAe,cAAc;AAC7B,IAAaC,IAAgBC,EAAgBhD,CAAc"}
|
package/dist/lyra1137.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra1137.cjs","names":["useContextProps","TimeFieldContext","useMemo","shouldRenderInputHeader","sharedInputStyles","dateFieldStyles","AriaTimeField","_Fragment","InputHeader","Group","DateInput","DateSegment","InputFooter","fixedForwardRef","require_helpers","require_utils","require_Group","require_DateField","require_styles","require_input_header","require_input_footer","require_helpers$1","require_date_picker_styles","react","react_jsx_runtime","TimeField","props","ref","hasInputHeader","hideHintLabel","hideInputHeader","label","startSlot","endSlot","segmentStyles","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","inputField","isFocusWithin","isInvalid","errorMessage","input","outerEndSlot"],"sources":["../src/components/inputs/time-field/time-field.tsx"],"sourcesContent":["import { ElementRef, ForwardedRef, useMemo } from \"react\";\nimport type { JSX } from \"react\";\nimport {\n DateInput,\n DateSegment,\n Group,\n TimeField as AriaTimeField,\n TimeFieldContext,\n TimeFieldProps as AriaTimeFieldProps,\n TimeValue,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { dateFieldStyles } from \"../date-picker\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nexport type TimeFieldProps<T extends TimeValue> = Omit<AriaTimeFieldProps<T>, \"className\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasEndSlot\" | \"hasStartSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n startSlot?: JSX.Element;\n endSlot?: JSX.Element;\n };\n\nexport type { TimeValue };\n\nconst _TimeField = <T extends TimeValue>(\n {\n className,\n customHint,\n description,\n endSlot,\n errorMessage,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n outerEndSlot,\n outerStartSlot,\n startSlot,\n ...props\n }: TimeFieldProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaTimeField>>,\n) => {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n const { isInvalid, isRequired } = props;\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: !!endSlot,\n hasInputHeader,\n hasLabel: !!label,\n isInputOnly: false,\n });\n\n const { input, segment: segmentStyles } = dateFieldStyles();\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTimeField\n {...props}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8 gap-2\",\n })\n }\n >\n {startSlot}\n <DateInput className={input({ className: \"flex-1\" })}>\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n {endSlot}\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTimeField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\nexport const TimeField = fixedForwardRef(_TimeField);\n//@ts-ignore\nTimeField.displayName = \"TimeField\";\n"],"mappings":"A,uWAiJA,IAAayB,EAAYZ,EAAAA,iBAtGvB,CACE,YACA,aACA,cACA,UACA,eACA,YAAY,GACZ,gBACA,kBACA,kBACA,QACA,eACA,iBACA,YACA,GAAGa,GAEL,IACG,CACH,CAACA,EAAOC,GAAO3B,EAAAA,gBAAgB0B,EAAOC,EAAK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ACLuB,EAAc,CACnB,YACA,YACF,CAAC,EAEM,SACV,CAAA,CAEM,CAAA,EACVD,CACI,C,IAEP,EAAAT,EAAA,IAAA,CAACZ,EAAAA,YAAD,CACe,cACC,eACG,iBAClB,CAAA,CACD,CAAA,CAAA,CAES,CAAA,EACdiC,GAAe,EAAArB,EAAA,IAAA,CAAC,MAAD,CAAK,UAAWa,EAAU,EAAI,SAAAQ,CAAkB,CAAA,EAAI,IACjE,C,EAET,CAEmD,EAEnD,EAAU,YAAc,Y"}
|
|
1
|
+
{"version":3,"file":"lyra1137.cjs","names":["useContextProps","TimeFieldContext","useMemo","shouldRenderInputHeader","sharedInputStyles","dateFieldStyles","AriaTimeField","_Fragment","InputHeader","Group","DateInput","DateSegment","InputFooter","fixedForwardRef","require_helpers","require_utils","require_Group","require_DateField","require_styles","require_input_header","require_input_footer","require_helpers$1","require_date_picker_styles","react","react_jsx_runtime","TimeField","props","ref","hasInputHeader","hideHintLabel","hideInputHeader","label","startSlot","endSlot","segmentStyles","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","inputField","isFocusWithin","isInvalid","errorMessage","input","outerEndSlot"],"sources":["../src/components/inputs/time-field/time-field.tsx"],"sourcesContent":["import { ElementRef, ForwardedRef, useMemo } from \"react\";\nimport type { JSX } from \"react\";\nimport {\n DateInput,\n DateSegment,\n Group,\n TimeField as AriaTimeField,\n TimeFieldContext,\n TimeFieldProps as AriaTimeFieldProps,\n TimeValue,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { dateFieldStyles } from \"../date-picker\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nexport type TimeFieldProps<T extends TimeValue> = Omit<AriaTimeFieldProps<T>, \"className\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasEndSlot\" | \"hasStartSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\" | \"isWarning\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n startSlot?: JSX.Element;\n endSlot?: JSX.Element;\n };\n\nexport type { TimeValue };\n\nconst _TimeField = <T extends TimeValue>(\n {\n className,\n customHint,\n description,\n endSlot,\n errorMessage,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n outerEndSlot,\n outerStartSlot,\n startSlot,\n ...props\n }: TimeFieldProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaTimeField>>,\n) => {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n const { isInvalid, isRequired } = props;\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: !!endSlot,\n hasInputHeader,\n hasLabel: !!label,\n isInputOnly: false,\n });\n\n const { input, segment: segmentStyles } = dateFieldStyles();\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTimeField\n {...props}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8 gap-2\",\n })\n }\n >\n {startSlot}\n <DateInput className={input({ className: \"flex-1\" })}>\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n {endSlot}\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTimeField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\nexport const TimeField = fixedForwardRef(_TimeField);\n//@ts-ignore\nTimeField.displayName = \"TimeField\";\n"],"mappings":"A,uWAiJA,IAAayB,EAAYZ,EAAAA,iBAtGvB,CACE,YACA,aACA,cACA,UACA,eACA,YAAY,GACZ,gBACA,kBACA,kBACA,QACA,eACA,iBACA,YACA,GAAGa,GAEL,IACG,CACH,CAACA,EAAOC,GAAO3B,EAAAA,gBAAgB0B,EAAOC,EAAK1B,EAAAA,gBAAgB,EAC3D,GAAM,CAAE,YAAW,cAAeyB,EAE5BE,GAAA,EAAiB1B,EAAAA,QAAAA,KACfC,EAAAA,wBAAwB,CAAE,gBAAe,kBAAiB,OAAM,CAAC,EACvE,CAAC0B,EAAeC,EAAiBC,CAAK,CACxC,EAEM,CAAE,aAAY,YAAW,oBAAmB,WAAY3B,EAAAA,kBAAkB,CAC9E,YACA,aAAc,CAAC,CAAC4B,EAChB,WAAY,CAAC,CAACC,EACd,iBACA,SAAU,CAAC,CAACF,EACZ,YAAa,EACf,CAAC,EAEK,CAAE,QAAO,QAASG,GAAkB7B,EAAAA,gBAAgB,EAE1D,OACE,EAAAmB,EAAA,KAAA,CAAC,MAAD,CAAK,UAAWW,EAAkB,EAAlC,SAAA,CACGC,GAAiB,EAAAZ,EAAA,IAAA,CAAC,MAAD,CAAK,UAAWa,EAAU,EAAI,SAAAD,CAAoB,CAAA,EAAI,MACxE,EAAAZ,EAAA,IAAA,CAAClB,EAAAA,UAAD,CACE,GAAIoB,EACJ,UAAY,GACVY,EAAQ,CACN,YACA,WAAYC,EAAY,UAC1B,CAAC,EAEQ,YACN,MAEH,UAAA,CAAE,iBACF,EAAAf,EAAA,KAAA,CAAAjB,EAAAA,SAAA,CAAA,SAAA,CACGqB,GACC,EAAAJ,EAAA,IAAA,CAAChB,EAAAA,YAAD,CACS,QACQ,gBACH,aACA,YACb,CAAA,EACC,MACJ,EAAAgB,EAAA,KAAA,CAACf,EAAAA,MAAD,CACE,WAAY,CAAE,aAAY,gBAAe,YAAW,eAClD+B,EAAW,CACT,aACA,UAAWC,EACX,YACA,UAAWC,GAAa,CAAC,CAACC,EAC1B,UAAW,eACb,CAAC,EARL,SAAA,CAWGX,GACD,EAAAR,EAAA,IAAA,CAACd,EAAAA,UAAD,CAAW,UAAWkC,EAAM,CAAE,UAAW,QAAS,CAAC,EAC/C,SAAA,IACA,EAAApB,EAAA,IAAA,CAACb,EAAAA,YAAD,CACE,WAAY,CAAE,eACLuB,EAAc,CACnB,YACA,YACF,CAAC,EAEM,SACV,CAAA,CAEM,CAAA,EACVD,CACI,C,IAEP,EAAAT,EAAA,IAAA,CAACZ,EAAAA,YAAD,CACe,cACC,eACG,iBAClB,CAAA,CACD,CAAA,CAAA,CAES,CAAA,EACdiC,GAAe,EAAArB,EAAA,IAAA,CAAC,MAAD,CAAK,UAAWa,EAAU,EAAI,SAAAQ,CAAkB,CAAA,EAAI,IACjE,C,EAET,CAEmD,EAEnD,EAAU,YAAc,Y"}
|
package/dist/lyra1138.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra1138.js","names":["useContextProps","TimeFieldContext","AriaTimeField","_Fragment","Group","DateInput","DateSegment","$7230ffa83bc0c2cf$export$29f1550f4b0d4415","$3a442827418ebe87$export$eb2fcfdbd7ba97d4","$5400c097f4765e59$export$7edc06cf1783b30f","$5400c097f4765e59$export$336ab7fa954c4b5f","$5400c097f4765e59$export$5eaee2322dd727eb","$5400c097f4765e59$export$8e17ddc448e87c1e","Fragment$1","TimeField","fixedForwardRef","props","ref","hasInputHeader","useMemo","shouldRenderInputHeader","hideHintLabel","hideInputHeader","label","sharedInputStyles","startSlot","endSlot","segmentStyles","dateFieldStyles","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","InputHeader","inputField","isFocusWithin","isInvalid","errorMessage","input","InputFooter","outerEndSlot"],"sources":["../src/components/inputs/time-field/time-field.tsx"],"sourcesContent":["import { ElementRef, ForwardedRef, useMemo } from \"react\";\nimport type { JSX } from \"react\";\nimport {\n DateInput,\n DateSegment,\n Group,\n TimeField as AriaTimeField,\n TimeFieldContext,\n TimeFieldProps as AriaTimeFieldProps,\n TimeValue,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { dateFieldStyles } from \"../date-picker\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nexport type TimeFieldProps<T extends TimeValue> = Omit<AriaTimeFieldProps<T>, \"className\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasEndSlot\" | \"hasStartSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n startSlot?: JSX.Element;\n endSlot?: JSX.Element;\n };\n\nexport type { TimeValue };\n\nconst _TimeField = <T extends TimeValue>(\n {\n className,\n customHint,\n description,\n endSlot,\n errorMessage,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n outerEndSlot,\n outerStartSlot,\n startSlot,\n ...props\n }: TimeFieldProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaTimeField>>,\n) => {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n const { isInvalid, isRequired } = props;\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: !!endSlot,\n hasInputHeader,\n hasLabel: !!label,\n isInputOnly: false,\n });\n\n const { input, segment: segmentStyles } = dateFieldStyles();\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTimeField\n {...props}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8 gap-2\",\n })\n }\n >\n {startSlot}\n <DateInput className={input({ className: \"flex-1\" })}>\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n {endSlot}\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTimeField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\nexport const TimeField = fixedForwardRef(_TimeField);\n//@ts-ignore\nTimeField.displayName = \"TimeField\";\n"],"mappings":";;;;;;;;;;;;;AAiJA,IAAac,IAAYC,GAtGvB,EACE,cACA,eACA,gBACA,YACA,iBACA,eAAY,IACZ,kBACA,oBACA,oBACA,UACA,iBACA,mBACA,cACA,GAAG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AAI,UAAAU;GAAkB,CAAA,IAAI;EACjE;;AAET,CAEmD;AAEnD,EAAU,cAAc"}
|
|
1
|
+
{"version":3,"file":"lyra1138.js","names":["useContextProps","TimeFieldContext","AriaTimeField","_Fragment","Group","DateInput","DateSegment","$7230ffa83bc0c2cf$export$29f1550f4b0d4415","$3a442827418ebe87$export$eb2fcfdbd7ba97d4","$5400c097f4765e59$export$7edc06cf1783b30f","$5400c097f4765e59$export$336ab7fa954c4b5f","$5400c097f4765e59$export$5eaee2322dd727eb","$5400c097f4765e59$export$8e17ddc448e87c1e","Fragment$1","TimeField","fixedForwardRef","props","ref","hasInputHeader","useMemo","shouldRenderInputHeader","hideHintLabel","hideInputHeader","label","sharedInputStyles","startSlot","endSlot","segmentStyles","dateFieldStyles","outerSlotsWrapper","outerStartSlot","outerSlot","wrapper","renderProps","InputHeader","inputField","isFocusWithin","isInvalid","errorMessage","input","InputFooter","outerEndSlot"],"sources":["../src/components/inputs/time-field/time-field.tsx"],"sourcesContent":["import { ElementRef, ForwardedRef, useMemo } from \"react\";\nimport type { JSX } from \"react\";\nimport {\n DateInput,\n DateSegment,\n Group,\n TimeField as AriaTimeField,\n TimeFieldContext,\n TimeFieldProps as AriaTimeFieldProps,\n TimeValue,\n useContextProps,\n} from \"react-aria-components\";\n\nimport { VariantProps } from \"tailwind-variants\";\n\nimport { fixedForwardRef } from \"../../../utils/helpers\";\nimport { dateFieldStyles } from \"../date-picker\";\nimport {\n InputFooter,\n InputFooterProps,\n InputHeader,\n InputHeaderProps,\n sharedInputStyles,\n} from \"../shared\";\nimport { shouldRenderInputHeader } from \"../shared/helpers\";\nimport { InputOuterSlotsProps } from \"../shared/types\";\n\nexport type TimeFieldProps<T extends TimeValue> = Omit<AriaTimeFieldProps<T>, \"className\"> &\n Omit<\n VariantProps<typeof sharedInputStyles>,\n \"hasEndSlot\" | \"hasStartSlot\" | \"hasInputHeader\" | \"hasLabel\" | \"isInputOnly\" | \"isWarning\"\n > &\n InputHeaderProps &\n InputFooterProps &\n InputOuterSlotsProps & {\n className?: string;\n startSlot?: JSX.Element;\n endSlot?: JSX.Element;\n };\n\nexport type { TimeValue };\n\nconst _TimeField = <T extends TimeValue>(\n {\n className,\n customHint,\n description,\n endSlot,\n errorMessage,\n fullWidth = true,\n hideHintLabel,\n hideInputFooter,\n hideInputHeader,\n label,\n outerEndSlot,\n outerStartSlot,\n startSlot,\n ...props\n }: TimeFieldProps<T>,\n ref: ForwardedRef<ElementRef<typeof AriaTimeField>>,\n) => {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n const { isInvalid, isRequired } = props;\n\n const hasInputHeader = useMemo(\n () => shouldRenderInputHeader({ hideHintLabel, hideInputHeader, label }),\n [hideHintLabel, hideInputHeader, label],\n );\n\n const { inputField, outerSlot, outerSlotsWrapper, wrapper } = sharedInputStyles({\n fullWidth,\n hasStartSlot: !!startSlot,\n hasEndSlot: !!endSlot,\n hasInputHeader,\n hasLabel: !!label,\n isInputOnly: false,\n });\n\n const { input, segment: segmentStyles } = dateFieldStyles();\n\n return (\n <div className={outerSlotsWrapper()}>\n {outerStartSlot ? <div className={outerSlot()}>{outerStartSlot}</div> : null}\n <AriaTimeField\n {...props}\n className={(renderProps) =>\n wrapper({\n className,\n isDisabled: renderProps.isDisabled,\n })\n }\n isInvalid={isInvalid}\n ref={ref}\n >\n {({ isDisabled }) => (\n <>\n {hasInputHeader ? (\n <InputHeader\n label={label}\n hideHintLabel={hideHintLabel}\n isRequired={isRequired}\n customHint={customHint}\n />\n ) : null}\n <Group\n className={({ isDisabled, isFocusWithin, isHovered, isInvalid }) =>\n inputField({\n isDisabled,\n isFocused: isFocusWithin,\n isHovered,\n isInvalid: isInvalid || !!errorMessage,\n className: \"min-h-8 gap-2\",\n })\n }\n >\n {startSlot}\n <DateInput className={input({ className: \"flex-1\" })}>\n {(segment) => (\n <DateSegment\n className={({ isFocused }) => {\n return segmentStyles({\n isFocused,\n isDisabled,\n });\n }}\n segment={segment}\n />\n )}\n </DateInput>\n {endSlot}\n </Group>\n\n <InputFooter\n description={description}\n errorMessage={errorMessage}\n hideInputFooter={hideInputFooter}\n />\n </>\n )}\n </AriaTimeField>\n {outerEndSlot ? <div className={outerSlot()}>{outerEndSlot}</div> : null}\n </div>\n );\n};\n\nexport const TimeField = fixedForwardRef(_TimeField);\n//@ts-ignore\nTimeField.displayName = \"TimeField\";\n"],"mappings":";;;;;;;;;;;;;AAiJA,IAAac,IAAYC,GAtGvB,EACE,cACA,eACA,gBACA,YACA,iBACA,eAAY,IACZ,kBACA,oBACA,oBACA,UACA,iBACA,mBACA,cACA,GAAGC,KAEL,MACG;CACH,CAACA,GAAOC,KAAOjB,EAAgBgB,GAAOC,GAAKhB,CAAgB;CAC3D,IAAM,EAAE,cAAW,kBAAee,GAE5BE,IAAiBC,QACfC,EAAwB;EAAE;EAAe;EAAiB;CAAM,CAAC,GACvE;EAACC;EAAeC;EAAiBC;CAAK,CACxC,GAEM,EAAE,eAAY,cAAW,sBAAmB,eAAYC,EAAkB;EAC9E;EACA,cAAc,CAAC,CAACC;EAChB,YAAY,CAAC,CAACC;EACd;EACA,UAAU,CAAC,CAACH;EACZ,aAAa;CACf,CAAC,GAEK,EAAE,UAAO,SAASI,MAAkBC,EAAgB;CAE1D,OACE,kBAAC,OAAD;EAAK,WAAWC,EAAkB;EAAlC,UAAA;GACGC,IAAiB,kBAAC,OAAD;IAAK,WAAWC,EAAU;IAAI,UAAAD;GAAoB,CAAA,IAAI;GACxE,kBAAC5B,GAAD;IACE,GAAIc;IACJ,YAAY,MACVgB,EAAQ;KACN;KACA,YAAYC,EAAY;IAC1B,CAAC;IAEQ;IACN;IAEH,WAAA,EAAE,oBACF,kBAAA9B,GAAA,EAAA,UAAA;KACGe,IACC,kBAACgB,GAAD;MACS;MACQ;MACH;MACA;KACb,CAAA,IACC;KACJ,kBAAC9B,GAAD;MACE,YAAY,EAAE,eAAY,kBAAe,cAAW,mBAClD+B,EAAW;OACT;OACA,WAAWC;OACX;OACA,WAAWC,KAAa,CAAC,CAACC;OAC1B,WAAW;MACb,CAAC;MARL,UAAA;OAWGb;OACD,kBAACpB,GAAD;QAAW,WAAWkC,EAAM,EAAE,WAAW,SAAS,CAAC;QAC/C,WAAA,MACA,kBAACjC,GAAD;SACE,YAAY,EAAE,mBACLqB,EAAc;UACnB;UACA;SACF,CAAC;SAEM;QACV,CAAA;OAEM,CAAA;OACVD;MACI;;KAEP,kBAACc,GAAD;MACe;MACC;MACG;KAClB,CAAA;IACD,EAAA,CAAA;GAES,CAAA;GACdC,IAAe,kBAAC,OAAD;IAAK,WAAWV,EAAU;IAAI,UAAAU;GAAkB,CAAA,IAAI;EACjE;;AAET,CAEmD;AAEnD,EAAU,cAAc"}
|
package/dist/lyra757.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require("./lyra753.cjs").tv({variants:{color:{primary:`text-primary`,secondary:`text-secondary`,tertiary:`text-tertiary`,success:`text-success`,error:`text-error`,inverted:`text-inverted`},variant:{display:`text-size-display font-bold`,"heading-1":`text-3xl font-bold`,"heading-2":`text-2xl font-semibold`,"heading-3":`text-xl font-semibold`,"body-large":`text-lg`,"body-medium":`text-base`,"body-small":`text-sm`}},defaultVariants:{variant:`body-medium`,color:`primary`}});exports.textStyles=e;
|
|
1
|
+
var e=require("./lyra753.cjs").tv({variants:{color:{primary:`text-primary`,secondary:`text-secondary`,tertiary:`text-tertiary`,success:`text-success`,error:`text-error`,warning:`text-warning`,inverted:`text-inverted`},variant:{display:`text-size-display font-bold`,"heading-1":`text-3xl font-bold`,"heading-2":`text-2xl font-semibold`,"heading-3":`text-xl font-semibold`,"body-large":`text-lg`,"body-medium":`text-base`,"body-small":`text-sm`}},defaultVariants:{variant:`body-medium`,color:`primary`}});exports.textStyles=e;
|
package/dist/lyra757.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra757.cjs","names":["tv","textStyles"],"sources":["../src/components/text/text.styles.ts"],"sourcesContent":["import { tv } from \"tailwind-variants\";\n\nexport const textStyles = tv({\n variants: {\n color: {\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n tertiary: \"text-tertiary\",\n success: \"text-success\",\n error: \"text-error\",\n inverted: \"text-inverted\",\n },\n variant: {\n display: \"text-size-display font-bold\",\n \"heading-1\": \"text-3xl font-bold\",\n \"heading-2\": \"text-2xl font-semibold\",\n \"heading-3\": \"text-xl font-semibold\",\n \"body-large\": \"text-lg\",\n \"body-medium\": \"text-base\",\n \"body-small\": \"text-sm\",\n },\n },\n defaultVariants: {\n variant: \"body-medium\",\n color: \"primary\",\n },\n});\n"],"mappings":"AAEA,IAAaC,E,uBAAaD,CAAAA,CAAAA,GAAG,CAC3B,SAAU,CACR,MAAO,CACL,QAAS,eACT,UAAW,iBACX,SAAU,gBACV,QAAS,eACT,MAAO,aACP,SAAU,eACZ,EACA,QAAS,CACP,QAAS,8BACT,YAAa,qBACb,YAAa,yBACb,YAAa,wBACb,aAAc,UACd,cAAe,YACf,aAAc,SAChB,CACF,EACA,gBAAiB,CACf,QAAS,cACT,MAAO,SACT,CACF,CAAC,E"}
|
|
1
|
+
{"version":3,"file":"lyra757.cjs","names":["tv","textStyles"],"sources":["../src/components/text/text.styles.ts"],"sourcesContent":["import { tv } from \"tailwind-variants\";\n\nexport const textStyles = tv({\n variants: {\n color: {\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n tertiary: \"text-tertiary\",\n success: \"text-success\",\n error: \"text-error\",\n warning: \"text-warning\",\n inverted: \"text-inverted\",\n },\n variant: {\n display: \"text-size-display font-bold\",\n \"heading-1\": \"text-3xl font-bold\",\n \"heading-2\": \"text-2xl font-semibold\",\n \"heading-3\": \"text-xl font-semibold\",\n \"body-large\": \"text-lg\",\n \"body-medium\": \"text-base\",\n \"body-small\": \"text-sm\",\n },\n },\n defaultVariants: {\n variant: \"body-medium\",\n color: \"primary\",\n },\n});\n"],"mappings":"AAEA,IAAaC,E,uBAAaD,CAAAA,CAAAA,GAAG,CAC3B,SAAU,CACR,MAAO,CACL,QAAS,eACT,UAAW,iBACX,SAAU,gBACV,QAAS,eACT,MAAO,aACP,QAAS,eACT,SAAU,eACZ,EACA,QAAS,CACP,QAAS,8BACT,YAAa,qBACb,YAAa,yBACb,YAAa,wBACb,aAAc,UACd,cAAe,YACf,aAAc,SAChB,CACF,EACA,gBAAiB,CACf,QAAS,cACT,MAAO,SACT,CACF,CAAC,E"}
|
package/dist/lyra758.js
CHANGED
package/dist/lyra758.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra758.js","names":["tv","ce","textStyles"],"sources":["../src/components/text/text.styles.ts"],"sourcesContent":["import { tv } from \"tailwind-variants\";\n\nexport const textStyles = tv({\n variants: {\n color: {\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n tertiary: \"text-tertiary\",\n success: \"text-success\",\n error: \"text-error\",\n inverted: \"text-inverted\",\n },\n variant: {\n display: \"text-size-display font-bold\",\n \"heading-1\": \"text-3xl font-bold\",\n \"heading-2\": \"text-2xl font-semibold\",\n \"heading-3\": \"text-xl font-semibold\",\n \"body-large\": \"text-lg\",\n \"body-medium\": \"text-base\",\n \"body-small\": \"text-sm\",\n },\n },\n defaultVariants: {\n variant: \"body-medium\",\n color: \"primary\",\n },\n});\n"],"mappings":";;AAEA,IAAaE,IAAaF,EAAG;CAC3B,UAAU;EACR,OAAO;GACL,SAAS;GACT,WAAW;GACX,UAAU;GACV,SAAS;GACT,OAAO;GACP,UAAU;EACZ;EACA,SAAS;GACP,SAAS;GACT,aAAa;GACb,aAAa;GACb,aAAa;GACb,cAAc;GACd,eAAe;GACf,cAAc;EAChB;CACF;CACA,iBAAiB;EACf,SAAS;EACT,OAAO;CACT;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"lyra758.js","names":["tv","ce","textStyles"],"sources":["../src/components/text/text.styles.ts"],"sourcesContent":["import { tv } from \"tailwind-variants\";\n\nexport const textStyles = tv({\n variants: {\n color: {\n primary: \"text-primary\",\n secondary: \"text-secondary\",\n tertiary: \"text-tertiary\",\n success: \"text-success\",\n error: \"text-error\",\n warning: \"text-warning\",\n inverted: \"text-inverted\",\n },\n variant: {\n display: \"text-size-display font-bold\",\n \"heading-1\": \"text-3xl font-bold\",\n \"heading-2\": \"text-2xl font-semibold\",\n \"heading-3\": \"text-xl font-semibold\",\n \"body-large\": \"text-lg\",\n \"body-medium\": \"text-base\",\n \"body-small\": \"text-sm\",\n },\n },\n defaultVariants: {\n variant: \"body-medium\",\n color: \"primary\",\n },\n});\n"],"mappings":";;AAEA,IAAaE,IAAaF,EAAG;CAC3B,UAAU;EACR,OAAO;GACL,SAAS;GACT,WAAW;GACX,UAAU;GACV,SAAS;GACT,OAAO;GACP,SAAS;GACT,UAAU;EACZ;EACA,SAAS;GACP,SAAS;GACT,aAAa;GACb,aAAa;GACb,aAAa;GACb,cAAc;GACd,eAAe;GACf,cAAc;EAChB;CACF;CACA,iBAAiB;EACf,SAAS;EACT,OAAO;CACT;AACF,CAAC"}
|
package/dist/lyra790.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var e=require("./lyra753.cjs").tv({slots:{outerSlotsWrapper:[`flex gap-2`],wrapper:[`flex flex-col`],outerSlot:[],inputHeader:[`flex`,`items-baseline`,`gap-1`,`mb-1`],label:[`text-base`,`font-semibold`,`transition-all`,`ease-out`,`duration-150`],hint:[`text-sm`,`text-tertiary`],inputField:[`flex`,`items-center`,`outline-hidden`,`border`,`border-solid`,`border-default`,`rounded`,`font-sans`,`text-base`,`transition-all`,`ease-out`,`duration-150`,`placeholder:text-tertiary`],input:[`w-full`,`grow`,`outline-hidden`,`disabled:cursor-not-allowed`,`text-base`,`bg-transparent`,`min-h-[1.875rem]`],errorMessage:[`text-error`,`text-sm`,`mt-1`],description:[`text-sm`,`text-secondary`,`mt-1`],buttonExcludedFromTabOrder:[`outline-hidden`,`text-secondary`,`animate-in`,`zoom-in`,`duration-200`],button:[`outline-hidden box-border rounded-xxs focus-visible:bg-action-highlight focus-visible:shadow-highlight`]},variants:{fullWidth:{true:{wrapper:`w-full`,inputField:`w-full`,outerSlotsWrapper:`w-full`},false:{wrapper:`w-fit`,inputField:`w-fit`,outerSlotsWrapper:`w-fit`}},isDisabled:{true:{inputField:`bg-surface-secondary text-secondary placeholder:text-tertiary cursor-not-allowed`},false:{inputField:`bg-surface-primary text-primary shadow-inner`}},isInvalid:{true:{inputField:`border-error`}},isHovered:{true:{}},isFocused:{true:{inputField:`!border-focus !shadow-highlight-and-inner`}},hasEndSlot:{true:{inputField:`pe-2`}},hasStartSlot:{true:{inputField:`ps-2`}},hasLabel:{true:{}},hasInputHeader:{true:{}},isInputOnly:{true:{input:`px-2.5`},false:{inputField:`px-2.5`}}},compoundVariants:[{isDisabled:!1,isFocused:!1,isInvalid:!1,isHovered:!0,className:{inputField:`!border-hover`}},{hasInputHeader:!0,hasLabel:!0,className:{outerSlot:`pt-5`}},{hasInputHeader:!0,hasLabel:!1,className:{outerSlot:`pt-[1.0625rem]`}},{}],defaultVariants:{isDisabled:!1,fullWidth:!0,isInputOnly:!0}});exports.sharedInputStyles=e;
|
|
1
|
+
var e=require("./lyra753.cjs").tv({slots:{outerSlotsWrapper:[`flex gap-2`],wrapper:[`flex flex-col`],outerSlot:[],inputHeader:[`flex`,`items-baseline`,`gap-1`,`mb-1`],label:[`text-base`,`font-semibold`,`transition-all`,`ease-out`,`duration-150`],hint:[`text-sm`,`text-tertiary`],inputField:[`flex`,`items-center`,`outline-hidden`,`border`,`border-solid`,`border-default`,`rounded`,`font-sans`,`text-base`,`transition-all`,`ease-out`,`duration-150`,`placeholder:text-tertiary`],input:[`w-full`,`grow`,`outline-hidden`,`disabled:cursor-not-allowed`,`text-base`,`bg-transparent`,`min-h-[1.875rem]`],errorMessage:[`text-error`,`text-sm`,`mt-1`],warningMessage:[`text-warning`,`text-sm`,`mt-1`],description:[`text-sm`,`text-secondary`,`mt-1`],buttonExcludedFromTabOrder:[`outline-hidden`,`text-secondary`,`animate-in`,`zoom-in`,`duration-200`],button:[`outline-hidden box-border rounded-xxs focus-visible:bg-action-highlight focus-visible:shadow-highlight`]},variants:{fullWidth:{true:{wrapper:`w-full`,inputField:`w-full`,outerSlotsWrapper:`w-full`},false:{wrapper:`w-fit`,inputField:`w-fit`,outerSlotsWrapper:`w-fit`}},isDisabled:{true:{inputField:`bg-surface-secondary text-secondary placeholder:text-tertiary cursor-not-allowed`},false:{inputField:`bg-surface-primary text-primary shadow-inner`}},isInvalid:{true:{inputField:`border-error`}},isWarning:{true:{inputField:`border-warning`}},isHovered:{true:{}},isFocused:{true:{inputField:`!border-focus !shadow-highlight-and-inner`}},hasEndSlot:{true:{inputField:`pe-2`}},hasStartSlot:{true:{inputField:`ps-2`}},hasLabel:{true:{}},hasInputHeader:{true:{}},isInputOnly:{true:{input:`px-2.5`},false:{inputField:`px-2.5`}}},compoundVariants:[{isDisabled:!1,isFocused:!1,isInvalid:!1,isWarning:!1,isHovered:!0,className:{inputField:`!border-hover`}},{hasInputHeader:!0,hasLabel:!0,className:{outerSlot:`pt-5`}},{hasInputHeader:!0,hasLabel:!1,className:{outerSlot:`pt-[1.0625rem]`}},{}],defaultVariants:{isDisabled:!1,isWarning:!1,fullWidth:!0,isInputOnly:!0}});exports.sharedInputStyles=e;
|
package/dist/lyra790.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra790.cjs","names":["tv","sharedInputStyles"],"sources":["../src/components/inputs/shared/styles.ts"],"sourcesContent":["import { tv } from \"tailwind-variants\";\n\nexport const sharedInputStyles = tv({\n slots: {\n /** Wrapper of the field components and the outer slots. */\n outerSlotsWrapper: [\"flex gap-2\"],\n /** Wrapper of the field-related components (the field itself, label, description). */\n wrapper: [\"flex flex-col\"],\n outerSlot: [],\n inputHeader: [\"flex\", \"items-baseline\", \"gap-1\", \"mb-1\"],\n label: [\"text-base\", \"font-semibold\", \"transition-all\", \"ease-out\", \"duration-150\"],\n hint: [\"text-sm\", \"text-tertiary\"],\n inputField: [\n \"flex\",\n \"items-center\",\n \"outline-hidden\",\n \"border\",\n \"border-solid\",\n \"border-default\",\n \"rounded\",\n \"font-sans\",\n \"text-base\",\n \"transition-all\",\n \"ease-out\",\n \"duration-150\",\n \"placeholder:text-tertiary\",\n ],\n input: [\n \"w-full\",\n \"grow\",\n \"outline-hidden\",\n \"disabled:cursor-not-allowed\",\n \"text-base\",\n \"bg-transparent\",\n \"min-h-[1.875rem]\",\n ],\n errorMessage: [\"text-error\", \"text-sm\", \"mt-1\"],\n description: [\"text-sm\", \"text-secondary\", \"mt-1\"],\n buttonExcludedFromTabOrder: [\n \"outline-hidden\",\n \"text-secondary\",\n \"animate-in\",\n \"zoom-in\",\n \"duration-200\",\n ],\n button: [\n \"outline-hidden box-border rounded-xxs focus-visible:bg-action-highlight focus-visible:shadow-highlight\",\n ],\n },\n variants: {\n fullWidth: {\n true: {\n wrapper: \"w-full\",\n inputField: \"w-full\",\n outerSlotsWrapper: \"w-full\",\n },\n false: {\n wrapper: \"w-fit\",\n inputField: \"w-fit\",\n outerSlotsWrapper: \"w-fit\",\n },\n },\n isDisabled: {\n true: {\n inputField:\n \"bg-surface-secondary text-secondary placeholder:text-tertiary cursor-not-allowed\",\n },\n false: {\n inputField: \"bg-surface-primary text-primary shadow-inner\",\n },\n },\n isInvalid: {\n true: {\n inputField: \"border-error\",\n },\n },\n isHovered: {\n true: {},\n },\n isFocused: {\n true: {\n inputField: \"!border-focus !shadow-highlight-and-inner\",\n },\n },\n hasEndSlot: {\n true: {\n inputField: \"pe-2\",\n },\n },\n hasStartSlot: {\n true: {\n inputField: \"ps-2\",\n },\n },\n hasLabel: {\n true: {},\n },\n hasInputHeader: {\n true: {},\n },\n /**\n * This variant should be set to `true` if the field only contains an input element (and it is not a custom input-like component\n * such as `SearchListField`, `Select`, `TagInput` or date / time pickers).\n */\n isInputOnly: {\n true: {\n input: \"px-2.5\",\n },\n false: {\n inputField: \"px-2.5\",\n },\n },\n },\n compoundVariants: [\n {\n isDisabled: false,\n isFocused: false,\n isInvalid: false,\n isHovered: true,\n className: {\n inputField: \"!border-hover\",\n },\n },\n {\n hasInputHeader: true,\n hasLabel: true,\n className: {\n outerSlot: \"pt-5\",\n },\n },\n {\n hasInputHeader: true,\n hasLabel: false,\n className: {\n outerSlot: \"pt-[1.0625rem]\",\n },\n },\n {},\n ],\n defaultVariants: {\n isDisabled: false,\n fullWidth: true,\n isInputOnly: true,\n },\n});\n"],"mappings":"AAEA,IAAaC,E,uBAAoBD,CAAAA,CAAAA,GAAG,CAClC,MAAO,CAEL,kBAAmB,CAAC,YAAY,EAEhC,QAAS,CAAC,eAAe,EACzB,UAAW,CAAC,EACZ,YAAa,CAAC,OAAQ,iBAAkB,QAAS,MAAM,EACvD,MAAO,CAAC,YAAa,gBAAiB,iBAAkB,WAAY,cAAc,EAClF,KAAM,CAAC,UAAW,eAAe,EACjC,WAAY,CACV,OACA,eACA,iBACA,SACA,eACA,iBACA,UACA,YACA,YACA,iBACA,WACA,eACA,2BACF,EACA,MAAO,CACL,SACA,OACA,iBACA,8BACA,YACA,iBACA,kBACF,EACA,aAAc,CAAC,aAAc,UAAW,MAAM,EAC9C,YAAa,CAAC,UAAW,iBAAkB,MAAM,EACjD,2BAA4B,CAC1B,iBACA,iBACA,aACA,UACA,cACF,EACA,OAAQ,CACN,wGACF,CACF,EACA,SAAU,CACR,UAAW,CACT,KAAM,CACJ,QAAS,SACT,WAAY,SACZ,kBAAmB,QACrB,EACA,MAAO,CACL,QAAS,QACT,WAAY,QACZ,kBAAmB,OACrB,CACF,EACA,WAAY,CACV,KAAM,CACJ,WACE,kFACJ,EACA,MAAO,CACL,WAAY,8CACd,CACF,EACA,UAAW,CACT,KAAM,CACJ,WAAY,cACd,CACF,EACA,UAAW,CACT,KAAM,CAAC,CACT,EACA,UAAW,CACT,KAAM,CACJ,WAAY,2CACd,CACF,EACA,WAAY,CACV,KAAM,CACJ,WAAY,MACd,CACF,EACA,aAAc,CACZ,KAAM,CACJ,WAAY,MACd,CACF,EACA,SAAU,CACR,KAAM,CAAC,CACT,EACA,eAAgB,CACd,KAAM,CAAC,CACT,EAKA,YAAa,CACX,KAAM,CACJ,MAAO,QACT,EACA,MAAO,CACL,WAAY,QACd,CACF,CACF,EACA,iBAAkB,CAChB,CACE,WAAY,GACZ,UAAW,GACX,UAAW,GACX,UAAW,GACX,UAAW,CACT,WAAY,eACd,CACF,EACA,CACE,eAAgB,GAChB,SAAU,GACV,UAAW,CACT,UAAW,MACb,CACF,EACA,CACE,eAAgB,GAChB,SAAU,GACV,UAAW,CACT,UAAW,gBACb,CACF,EACA,CAAC,CACH,EACA,gBAAiB,CACf,WAAY,GACZ,UAAW,GACX,YAAa,EACf,CACF,CAAC,E"}
|
|
1
|
+
{"version":3,"file":"lyra790.cjs","names":["tv","sharedInputStyles"],"sources":["../src/components/inputs/shared/styles.ts"],"sourcesContent":["import { tv } from \"tailwind-variants\";\n\nexport const sharedInputStyles = tv({\n slots: {\n /** Wrapper of the field components and the outer slots. */\n outerSlotsWrapper: [\"flex gap-2\"],\n /** Wrapper of the field-related components (the field itself, label, description). */\n wrapper: [\"flex flex-col\"],\n outerSlot: [],\n inputHeader: [\"flex\", \"items-baseline\", \"gap-1\", \"mb-1\"],\n label: [\"text-base\", \"font-semibold\", \"transition-all\", \"ease-out\", \"duration-150\"],\n hint: [\"text-sm\", \"text-tertiary\"],\n inputField: [\n \"flex\",\n \"items-center\",\n \"outline-hidden\",\n \"border\",\n \"border-solid\",\n \"border-default\",\n \"rounded\",\n \"font-sans\",\n \"text-base\",\n \"transition-all\",\n \"ease-out\",\n \"duration-150\",\n \"placeholder:text-tertiary\",\n ],\n input: [\n \"w-full\",\n \"grow\",\n \"outline-hidden\",\n \"disabled:cursor-not-allowed\",\n \"text-base\",\n \"bg-transparent\",\n \"min-h-[1.875rem]\",\n ],\n errorMessage: [\"text-error\", \"text-sm\", \"mt-1\"],\n warningMessage: [\"text-warning\", \"text-sm\", \"mt-1\"],\n description: [\"text-sm\", \"text-secondary\", \"mt-1\"],\n buttonExcludedFromTabOrder: [\n \"outline-hidden\",\n \"text-secondary\",\n \"animate-in\",\n \"zoom-in\",\n \"duration-200\",\n ],\n button: [\n \"outline-hidden box-border rounded-xxs focus-visible:bg-action-highlight focus-visible:shadow-highlight\",\n ],\n },\n variants: {\n fullWidth: {\n true: {\n wrapper: \"w-full\",\n inputField: \"w-full\",\n outerSlotsWrapper: \"w-full\",\n },\n false: {\n wrapper: \"w-fit\",\n inputField: \"w-fit\",\n outerSlotsWrapper: \"w-fit\",\n },\n },\n isDisabled: {\n true: {\n inputField:\n \"bg-surface-secondary text-secondary placeholder:text-tertiary cursor-not-allowed\",\n },\n false: {\n inputField: \"bg-surface-primary text-primary shadow-inner\",\n },\n },\n isInvalid: {\n true: {\n inputField: \"border-error\",\n },\n },\n /** Non-blocking warning state. Ignored when the field is invalid. */\n isWarning: {\n true: {\n inputField: \"border-warning\",\n },\n },\n isHovered: {\n true: {},\n },\n isFocused: {\n true: {\n inputField: \"!border-focus !shadow-highlight-and-inner\",\n },\n },\n hasEndSlot: {\n true: {\n inputField: \"pe-2\",\n },\n },\n hasStartSlot: {\n true: {\n inputField: \"ps-2\",\n },\n },\n hasLabel: {\n true: {},\n },\n hasInputHeader: {\n true: {},\n },\n /**\n * This variant should be set to `true` if the field only contains an input element (and it is not a custom input-like component\n * such as `SearchListField`, `Select`, `TagInput` or date / time pickers).\n */\n isInputOnly: {\n true: {\n input: \"px-2.5\",\n },\n false: {\n inputField: \"px-2.5\",\n },\n },\n },\n compoundVariants: [\n {\n isDisabled: false,\n isFocused: false,\n isInvalid: false,\n isWarning: false,\n isHovered: true,\n className: {\n inputField: \"!border-hover\",\n },\n },\n {\n hasInputHeader: true,\n hasLabel: true,\n className: {\n outerSlot: \"pt-5\",\n },\n },\n {\n hasInputHeader: true,\n hasLabel: false,\n className: {\n outerSlot: \"pt-[1.0625rem]\",\n },\n },\n {},\n ],\n defaultVariants: {\n isDisabled: false,\n isWarning: false,\n fullWidth: true,\n isInputOnly: true,\n },\n});\n"],"mappings":"AAEA,IAAaC,E,uBAAoBD,CAAAA,CAAAA,GAAG,CAClC,MAAO,CAEL,kBAAmB,CAAC,YAAY,EAEhC,QAAS,CAAC,eAAe,EACzB,UAAW,CAAC,EACZ,YAAa,CAAC,OAAQ,iBAAkB,QAAS,MAAM,EACvD,MAAO,CAAC,YAAa,gBAAiB,iBAAkB,WAAY,cAAc,EAClF,KAAM,CAAC,UAAW,eAAe,EACjC,WAAY,CACV,OACA,eACA,iBACA,SACA,eACA,iBACA,UACA,YACA,YACA,iBACA,WACA,eACA,2BACF,EACA,MAAO,CACL,SACA,OACA,iBACA,8BACA,YACA,iBACA,kBACF,EACA,aAAc,CAAC,aAAc,UAAW,MAAM,EAC9C,eAAgB,CAAC,eAAgB,UAAW,MAAM,EAClD,YAAa,CAAC,UAAW,iBAAkB,MAAM,EACjD,2BAA4B,CAC1B,iBACA,iBACA,aACA,UACA,cACF,EACA,OAAQ,CACN,wGACF,CACF,EACA,SAAU,CACR,UAAW,CACT,KAAM,CACJ,QAAS,SACT,WAAY,SACZ,kBAAmB,QACrB,EACA,MAAO,CACL,QAAS,QACT,WAAY,QACZ,kBAAmB,OACrB,CACF,EACA,WAAY,CACV,KAAM,CACJ,WACE,kFACJ,EACA,MAAO,CACL,WAAY,8CACd,CACF,EACA,UAAW,CACT,KAAM,CACJ,WAAY,cACd,CACF,EAEA,UAAW,CACT,KAAM,CACJ,WAAY,gBACd,CACF,EACA,UAAW,CACT,KAAM,CAAC,CACT,EACA,UAAW,CACT,KAAM,CACJ,WAAY,2CACd,CACF,EACA,WAAY,CACV,KAAM,CACJ,WAAY,MACd,CACF,EACA,aAAc,CACZ,KAAM,CACJ,WAAY,MACd,CACF,EACA,SAAU,CACR,KAAM,CAAC,CACT,EACA,eAAgB,CACd,KAAM,CAAC,CACT,EAKA,YAAa,CACX,KAAM,CACJ,MAAO,QACT,EACA,MAAO,CACL,WAAY,QACd,CACF,CACF,EACA,iBAAkB,CAChB,CACE,WAAY,GACZ,UAAW,GACX,UAAW,GACX,UAAW,GACX,UAAW,GACX,UAAW,CACT,WAAY,eACd,CACF,EACA,CACE,eAAgB,GAChB,SAAU,GACV,UAAW,CACT,UAAW,MACb,CACF,EACA,CACE,eAAgB,GAChB,SAAU,GACV,UAAW,CACT,UAAW,gBACb,CACF,EACA,CAAC,CACH,EACA,gBAAiB,CACf,WAAY,GACZ,UAAW,GACX,UAAW,GACX,YAAa,EACf,CACF,CAAC,E"}
|
package/dist/lyra791.js
CHANGED
|
@@ -48,6 +48,11 @@ var t = e({
|
|
|
48
48
|
"text-sm",
|
|
49
49
|
"mt-1"
|
|
50
50
|
],
|
|
51
|
+
warningMessage: [
|
|
52
|
+
"text-warning",
|
|
53
|
+
"text-sm",
|
|
54
|
+
"mt-1"
|
|
55
|
+
],
|
|
51
56
|
description: [
|
|
52
57
|
"text-sm",
|
|
53
58
|
"text-secondary",
|
|
@@ -80,6 +85,7 @@ var t = e({
|
|
|
80
85
|
false: { inputField: "bg-surface-primary text-primary shadow-inner" }
|
|
81
86
|
},
|
|
82
87
|
isInvalid: { true: { inputField: "border-error" } },
|
|
88
|
+
isWarning: { true: { inputField: "border-warning" } },
|
|
83
89
|
isHovered: { true: {} },
|
|
84
90
|
isFocused: { true: { inputField: "!border-focus !shadow-highlight-and-inner" } },
|
|
85
91
|
hasEndSlot: { true: { inputField: "pe-2" } },
|
|
@@ -96,6 +102,7 @@ var t = e({
|
|
|
96
102
|
isDisabled: !1,
|
|
97
103
|
isFocused: !1,
|
|
98
104
|
isInvalid: !1,
|
|
105
|
+
isWarning: !1,
|
|
99
106
|
isHovered: !0,
|
|
100
107
|
className: { inputField: "!border-hover" }
|
|
101
108
|
},
|
|
@@ -113,6 +120,7 @@ var t = e({
|
|
|
113
120
|
],
|
|
114
121
|
defaultVariants: {
|
|
115
122
|
isDisabled: !1,
|
|
123
|
+
isWarning: !1,
|
|
116
124
|
fullWidth: !0,
|
|
117
125
|
isInputOnly: !0
|
|
118
126
|
}
|
package/dist/lyra791.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra791.js","names":["tv","ce","sharedInputStyles"],"sources":["../src/components/inputs/shared/styles.ts"],"sourcesContent":["import { tv } from \"tailwind-variants\";\n\nexport const sharedInputStyles = tv({\n slots: {\n /** Wrapper of the field components and the outer slots. */\n outerSlotsWrapper: [\"flex gap-2\"],\n /** Wrapper of the field-related components (the field itself, label, description). */\n wrapper: [\"flex flex-col\"],\n outerSlot: [],\n inputHeader: [\"flex\", \"items-baseline\", \"gap-1\", \"mb-1\"],\n label: [\"text-base\", \"font-semibold\", \"transition-all\", \"ease-out\", \"duration-150\"],\n hint: [\"text-sm\", \"text-tertiary\"],\n inputField: [\n \"flex\",\n \"items-center\",\n \"outline-hidden\",\n \"border\",\n \"border-solid\",\n \"border-default\",\n \"rounded\",\n \"font-sans\",\n \"text-base\",\n \"transition-all\",\n \"ease-out\",\n \"duration-150\",\n \"placeholder:text-tertiary\",\n ],\n input: [\n \"w-full\",\n \"grow\",\n \"outline-hidden\",\n \"disabled:cursor-not-allowed\",\n \"text-base\",\n \"bg-transparent\",\n \"min-h-[1.875rem]\",\n ],\n errorMessage: [\"text-error\", \"text-sm\", \"mt-1\"],\n description: [\"text-sm\", \"text-secondary\", \"mt-1\"],\n buttonExcludedFromTabOrder: [\n \"outline-hidden\",\n \"text-secondary\",\n \"animate-in\",\n \"zoom-in\",\n \"duration-200\",\n ],\n button: [\n \"outline-hidden box-border rounded-xxs focus-visible:bg-action-highlight focus-visible:shadow-highlight\",\n ],\n },\n variants: {\n fullWidth: {\n true: {\n wrapper: \"w-full\",\n inputField: \"w-full\",\n outerSlotsWrapper: \"w-full\",\n },\n false: {\n wrapper: \"w-fit\",\n inputField: \"w-fit\",\n outerSlotsWrapper: \"w-fit\",\n },\n },\n isDisabled: {\n true: {\n inputField:\n \"bg-surface-secondary text-secondary placeholder:text-tertiary cursor-not-allowed\",\n },\n false: {\n inputField: \"bg-surface-primary text-primary shadow-inner\",\n },\n },\n isInvalid: {\n true: {\n inputField: \"border-error\",\n },\n },\n isHovered: {\n true: {},\n },\n isFocused: {\n true: {\n inputField: \"!border-focus !shadow-highlight-and-inner\",\n },\n },\n hasEndSlot: {\n true: {\n inputField: \"pe-2\",\n },\n },\n hasStartSlot: {\n true: {\n inputField: \"ps-2\",\n },\n },\n hasLabel: {\n true: {},\n },\n hasInputHeader: {\n true: {},\n },\n /**\n * This variant should be set to `true` if the field only contains an input element (and it is not a custom input-like component\n * such as `SearchListField`, `Select`, `TagInput` or date / time pickers).\n */\n isInputOnly: {\n true: {\n input: \"px-2.5\",\n },\n false: {\n inputField: \"px-2.5\",\n },\n },\n },\n compoundVariants: [\n {\n isDisabled: false,\n isFocused: false,\n isInvalid: false,\n isHovered: true,\n className: {\n inputField: \"!border-hover\",\n },\n },\n {\n hasInputHeader: true,\n hasLabel: true,\n className: {\n outerSlot: \"pt-5\",\n },\n },\n {\n hasInputHeader: true,\n hasLabel: false,\n className: {\n outerSlot: \"pt-[1.0625rem]\",\n },\n },\n {},\n ],\n defaultVariants: {\n isDisabled: false,\n fullWidth: true,\n isInputOnly: true,\n },\n});\n"],"mappings":";;AAEA,IAAaE,IAAoBF,EAAG;CAClC,OAAO;EAEL,mBAAmB,CAAC,YAAY;EAEhC,SAAS,CAAC,eAAe;EACzB,WAAW,CAAC;EACZ,aAAa;GAAC;GAAQ;GAAkB;GAAS;EAAM;EACvD,OAAO;GAAC;GAAa;GAAiB;GAAkB;GAAY;EAAc;EAClF,MAAM,CAAC,WAAW,eAAe;EACjC,YAAY;GACV;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,cAAc;GAAC;GAAc;GAAW;EAAM;EAC9C,aAAa;GAAC;GAAW;GAAkB;EAAM;EACjD,4BAA4B;GAC1B;GACA;GACA;GACA;GACA;EACF;EACA,QAAQ,CACN,wGACF;CACF;CACA,UAAU;EACR,WAAW;GACT,MAAM;IACJ,SAAS;IACT,YAAY;IACZ,mBAAmB;GACrB;GACA,OAAO;IACL,SAAS;IACT,YAAY;IACZ,mBAAmB;GACrB;EACF;EACA,YAAY;GACV,MAAM,EACJ,YACE,mFACJ;GACA,OAAO,EACL,YAAY,+CACd;EACF;EACA,WAAW,EACT,MAAM,EACJ,YAAY,eACd,EACF;EACA,WAAW,EACT,MAAM,CAAC,EACT;EACA,WAAW,EACT,MAAM,EACJ,YAAY,4CACd,EACF;EACA,YAAY,EACV,MAAM,EACJ,YAAY,OACd,EACF;EACA,cAAc,EACZ,MAAM,EACJ,YAAY,OACd,EACF;EACA,UAAU,EACR,MAAM,CAAC,EACT;EACA,gBAAgB,EACd,MAAM,CAAC,EACT;EAKA,aAAa;GACX,MAAM,EACJ,OAAO,SACT;GACA,OAAO,EACL,YAAY,SACd;EACF;CACF;CACA,kBAAkB;EAChB;GACE,YAAY;GACZ,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW,EACT,YAAY,gBACd;EACF;EACA;GACE,gBAAgB;GAChB,UAAU;GACV,WAAW,EACT,WAAW,OACb;EACF;EACA;GACE,gBAAgB;GAChB,UAAU;GACV,WAAW,EACT,WAAW,iBACb;EACF;EACA,CAAC;CACH;CACA,iBAAiB;EACf,YAAY;EACZ,WAAW;EACX,aAAa;CACf;AACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"lyra791.js","names":["tv","ce","sharedInputStyles"],"sources":["../src/components/inputs/shared/styles.ts"],"sourcesContent":["import { tv } from \"tailwind-variants\";\n\nexport const sharedInputStyles = tv({\n slots: {\n /** Wrapper of the field components and the outer slots. */\n outerSlotsWrapper: [\"flex gap-2\"],\n /** Wrapper of the field-related components (the field itself, label, description). */\n wrapper: [\"flex flex-col\"],\n outerSlot: [],\n inputHeader: [\"flex\", \"items-baseline\", \"gap-1\", \"mb-1\"],\n label: [\"text-base\", \"font-semibold\", \"transition-all\", \"ease-out\", \"duration-150\"],\n hint: [\"text-sm\", \"text-tertiary\"],\n inputField: [\n \"flex\",\n \"items-center\",\n \"outline-hidden\",\n \"border\",\n \"border-solid\",\n \"border-default\",\n \"rounded\",\n \"font-sans\",\n \"text-base\",\n \"transition-all\",\n \"ease-out\",\n \"duration-150\",\n \"placeholder:text-tertiary\",\n ],\n input: [\n \"w-full\",\n \"grow\",\n \"outline-hidden\",\n \"disabled:cursor-not-allowed\",\n \"text-base\",\n \"bg-transparent\",\n \"min-h-[1.875rem]\",\n ],\n errorMessage: [\"text-error\", \"text-sm\", \"mt-1\"],\n warningMessage: [\"text-warning\", \"text-sm\", \"mt-1\"],\n description: [\"text-sm\", \"text-secondary\", \"mt-1\"],\n buttonExcludedFromTabOrder: [\n \"outline-hidden\",\n \"text-secondary\",\n \"animate-in\",\n \"zoom-in\",\n \"duration-200\",\n ],\n button: [\n \"outline-hidden box-border rounded-xxs focus-visible:bg-action-highlight focus-visible:shadow-highlight\",\n ],\n },\n variants: {\n fullWidth: {\n true: {\n wrapper: \"w-full\",\n inputField: \"w-full\",\n outerSlotsWrapper: \"w-full\",\n },\n false: {\n wrapper: \"w-fit\",\n inputField: \"w-fit\",\n outerSlotsWrapper: \"w-fit\",\n },\n },\n isDisabled: {\n true: {\n inputField:\n \"bg-surface-secondary text-secondary placeholder:text-tertiary cursor-not-allowed\",\n },\n false: {\n inputField: \"bg-surface-primary text-primary shadow-inner\",\n },\n },\n isInvalid: {\n true: {\n inputField: \"border-error\",\n },\n },\n /** Non-blocking warning state. Ignored when the field is invalid. */\n isWarning: {\n true: {\n inputField: \"border-warning\",\n },\n },\n isHovered: {\n true: {},\n },\n isFocused: {\n true: {\n inputField: \"!border-focus !shadow-highlight-and-inner\",\n },\n },\n hasEndSlot: {\n true: {\n inputField: \"pe-2\",\n },\n },\n hasStartSlot: {\n true: {\n inputField: \"ps-2\",\n },\n },\n hasLabel: {\n true: {},\n },\n hasInputHeader: {\n true: {},\n },\n /**\n * This variant should be set to `true` if the field only contains an input element (and it is not a custom input-like component\n * such as `SearchListField`, `Select`, `TagInput` or date / time pickers).\n */\n isInputOnly: {\n true: {\n input: \"px-2.5\",\n },\n false: {\n inputField: \"px-2.5\",\n },\n },\n },\n compoundVariants: [\n {\n isDisabled: false,\n isFocused: false,\n isInvalid: false,\n isWarning: false,\n isHovered: true,\n className: {\n inputField: \"!border-hover\",\n },\n },\n {\n hasInputHeader: true,\n hasLabel: true,\n className: {\n outerSlot: \"pt-5\",\n },\n },\n {\n hasInputHeader: true,\n hasLabel: false,\n className: {\n outerSlot: \"pt-[1.0625rem]\",\n },\n },\n {},\n ],\n defaultVariants: {\n isDisabled: false,\n isWarning: false,\n fullWidth: true,\n isInputOnly: true,\n },\n});\n"],"mappings":";;AAEA,IAAaE,IAAoBF,EAAG;CAClC,OAAO;EAEL,mBAAmB,CAAC,YAAY;EAEhC,SAAS,CAAC,eAAe;EACzB,WAAW,CAAC;EACZ,aAAa;GAAC;GAAQ;GAAkB;GAAS;EAAM;EACvD,OAAO;GAAC;GAAa;GAAiB;GAAkB;GAAY;EAAc;EAClF,MAAM,CAAC,WAAW,eAAe;EACjC,YAAY;GACV;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,OAAO;GACL;GACA;GACA;GACA;GACA;GACA;GACA;EACF;EACA,cAAc;GAAC;GAAc;GAAW;EAAM;EAC9C,gBAAgB;GAAC;GAAgB;GAAW;EAAM;EAClD,aAAa;GAAC;GAAW;GAAkB;EAAM;EACjD,4BAA4B;GAC1B;GACA;GACA;GACA;GACA;EACF;EACA,QAAQ,CACN,wGACF;CACF;CACA,UAAU;EACR,WAAW;GACT,MAAM;IACJ,SAAS;IACT,YAAY;IACZ,mBAAmB;GACrB;GACA,OAAO;IACL,SAAS;IACT,YAAY;IACZ,mBAAmB;GACrB;EACF;EACA,YAAY;GACV,MAAM,EACJ,YACE,mFACJ;GACA,OAAO,EACL,YAAY,+CACd;EACF;EACA,WAAW,EACT,MAAM,EACJ,YAAY,eACd,EACF;EAEA,WAAW,EACT,MAAM,EACJ,YAAY,iBACd,EACF;EACA,WAAW,EACT,MAAM,CAAC,EACT;EACA,WAAW,EACT,MAAM,EACJ,YAAY,4CACd,EACF;EACA,YAAY,EACV,MAAM,EACJ,YAAY,OACd,EACF;EACA,cAAc,EACZ,MAAM,EACJ,YAAY,OACd,EACF;EACA,UAAU,EACR,MAAM,CAAC,EACT;EACA,gBAAgB,EACd,MAAM,CAAC,EACT;EAKA,aAAa;GACX,MAAM,EACJ,OAAO,SACT;GACA,OAAO,EACL,YAAY,SACd;EACF;CACF;CACA,kBAAkB;EAChB;GACE,YAAY;GACZ,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW;GACX,WAAW,EACT,YAAY,gBACd;EACF;EACA;GACE,gBAAgB;GAChB,UAAU;GACV,WAAW,EACT,WAAW,OACb;EACF;EACA;GACE,gBAAgB;GAChB,UAAU;GACV,WAAW,EACT,WAAW,iBACb;EACF;EACA,CAAC;CACH;CACA,iBAAiB;EACf,YAAY;EACZ,WAAW;EACX,WAAW;EACX,aAAa;CACf;AACF,CAAC"}
|
package/dist/lyra792.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./lyra583.cjs"),t=require("./lyra617.cjs"),n=require("./lyra758.cjs");require("./lyra759.cjs");const r=require("./lyra790.cjs");require("./lyra793.cjs");let i=require("react/jsx-runtime");var a=({customHtmlValidationMessages:a,description:o,errorMessage:s,hideInputFooter:c=!1})=>{let{description:
|
|
1
|
+
const e=require("./lyra583.cjs"),t=require("./lyra617.cjs"),n=require("./lyra758.cjs");require("./lyra759.cjs");const r=require("./lyra790.cjs");require("./lyra793.cjs");let i=require("react/jsx-runtime");var a=({customHtmlValidationMessages:a,description:o,errorMessage:s,hideInputFooter:c=!1,isInvalid:l=!1,warningMessage:u})=>{let{description:d,errorMessage:f,warningMessage:p}=r.sharedInputStyles(),m=!!u&&!s&&!l;return c?null:(0,i.jsxs)(i.Fragment,{children:[s?(0,i.jsx)(n.Text,{className:f(),variant:`body-small`,color:`error`,slot:`errorMessage`,children:s}):(0,i.jsx)(t.FieldError,{className:f(),children:({defaultChildren:t,validationDetails:n})=>e.getCustomHtmlValidationMessage(n,a)||t}),m?(0,i.jsx)(n.Text,{className:p(),variant:`body-small`,color:`warning`,role:`status`,children:u}):null,o&&(0,i.jsx)(n.Text,{className:d(),variant:`body-small`,color:`secondary`,slot:`description`,children:o})]})};exports.InputFooter=a;
|
package/dist/lyra792.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lyra792.cjs","names":["sharedInputStyles","_Fragment","Text","FieldError","getCustomHtmlValidationMessage","require_helpers","require_FieldError","require_text","require_styles","react_jsx_runtime","InputFooter","descriptionStyle","errorMessageStyle","
|
|
1
|
+
{"version":3,"file":"lyra792.cjs","names":["sharedInputStyles","_Fragment","Text","FieldError","getCustomHtmlValidationMessage","require_helpers","require_FieldError","require_text","require_styles","react_jsx_runtime","InputFooter","descriptionStyle","errorMessageStyle","warningMessageStyle","showWarning","warningMessage","errorMessage","isInvalid","hideInputFooter","validationDetails","customHtmlValidationMessages","defaultChildren","description"],"sources":["../src/components/inputs/shared/input-footer.tsx"],"sourcesContent":["import { FieldError } from \"react-aria-components\";\n\nimport { getCustomHtmlValidationMessage } from \"../../../utils/helpers\";\nimport { Text } from \"../../text\";\n\nimport { sharedInputStyles } from \".\";\n\nexport type InputFooterProps = {\n customHtmlValidationMessages?: Partial<Record<keyof ValidityState, string>>;\n description?: string;\n errorMessage?: string;\n hideInputFooter?: boolean; // Defaults to false\n};\n\nexport type InputWarningProps = {\n /**\n * Non-blocking warning shown below the field with a warning border. Unlike `errorMessage` it\n * does not mark the field as invalid, so the form can still be submitted. Hidden while the\n * field is invalid.\n */\n warningMessage?: string;\n};\n\ntype InputFooterComponentProps = InputFooterProps &\n InputWarningProps & {\n /** Whether the field is currently invalid; suppresses `warningMessage`. */\n isInvalid?: boolean;\n };\n\nexport const InputFooter = ({\n customHtmlValidationMessages,\n description,\n errorMessage,\n hideInputFooter = false,\n isInvalid = false,\n warningMessage,\n}: InputFooterComponentProps) => {\n const {\n description: descriptionStyle,\n errorMessage: errorMessageStyle,\n warningMessage: warningMessageStyle,\n } = sharedInputStyles();\n\n const showWarning = !!warningMessage && !errorMessage && !isInvalid;\n\n if (hideInputFooter) return null;\n\n return (\n <>\n {errorMessage ? (\n <Text\n className={errorMessageStyle()}\n variant=\"body-small\"\n color=\"error\"\n slot=\"errorMessage\"\n >\n {errorMessage}\n </Text>\n ) : (\n <FieldError className={errorMessageStyle()}>\n {({ defaultChildren, validationDetails }) => {\n const customHtmlValidationMessage = getCustomHtmlValidationMessage(\n validationDetails,\n customHtmlValidationMessages,\n );\n return customHtmlValidationMessage || defaultChildren;\n }}\n </FieldError>\n )}\n {showWarning ? (\n <Text className={warningMessageStyle()} variant=\"body-small\" color=\"warning\" role=\"status\">\n {warningMessage}\n </Text>\n ) : null}\n {description && (\n <Text\n className={descriptionStyle()}\n variant=\"body-small\"\n color=\"secondary\"\n slot=\"description\"\n >\n {description}\n </Text>\n )}\n </>\n );\n};\n"],"mappings":"A,6MA6BA,IAAaU,GAAe,CAC1B,+BACA,cACA,eACA,kBAAkB,GAClB,YAAY,GACZ,oBAC+B,CAC/B,GAAM,CACJ,YAAaC,EACb,aAAcC,EACd,eAAgBC,GACdb,EAAAA,kBAAkB,EAEhBc,EAAc,CAAC,CAACC,GAAkB,CAACC,GAAgB,CAACC,EAI1D,OAFIC,EAAwB,MAG1B,EAAAT,EAAA,KAAA,CAAAR,EAAAA,SAAA,CAAA,SAAA,CACGe,GACC,EAAAP,EAAA,IAAA,CAACP,EAAAA,KAAD,CACE,UAAWU,EAAkB,EAC7B,QAAQ,aACR,MAAM,QACN,KAAK,eAEJ,SAAAI,CACG,CAAA,GAEN,EAAAP,EAAA,IAAA,CAACN,EAAAA,WAAD,CAAY,UAAWS,EAAkB,EACrC,UAAA,CAAE,kBAAiB,uBACiBR,EAAAA,+BAClCe,EACAC,CAEK,GAA+BC,CAE9B,CAAA,EAEbP,GACC,EAAAL,EAAA,IAAA,CAACP,EAAAA,KAAD,CAAM,UAAWW,EAAoB,EAAG,QAAQ,aAAa,MAAM,UAAU,KAAK,SAC/E,SAAAE,CACG,CAAA,EACJ,KACHO,IACC,EAAAb,EAAA,IAAA,CAACP,EAAAA,KAAD,CACE,UAAWS,EAAiB,EAC5B,QAAQ,aACR,MAAM,YACN,KAAK,cAEJ,SAAAW,CACG,CAAA,CAER,CAAA,CAAA,CAEN,E"}
|