se-design 1.0.81 → 1.0.83-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/icons/chat.svg +4 -0
- package/dist/assets/icons/tag.svg +2 -2
- package/dist/assets/style.css +1 -1
- package/dist/components/AccessibleDiv/index.d.ts +23 -1
- package/dist/components/Dropdown/index.d.ts +2 -0
- package/dist/components/DropdownWithInputTags/index.d.ts +3 -0
- package/dist/components/Link/index.d.ts +6 -2
- package/dist/components/MessageBar/index.d.ts +20 -1
- package/dist/index.js +62 -54
- package/dist/index.js.map +1 -1
- package/dist/index100.js +1 -1
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +1 -1
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +1 -1
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +1 -1
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +1 -1
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +1 -1
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +1 -1
- package/dist/index106.js.map +1 -1
- package/dist/index107.js +1 -1
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +1 -1
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +1 -1
- package/dist/index109.js.map +1 -1
- package/dist/index110.js +1 -1
- package/dist/index110.js.map +1 -1
- package/dist/index111.js +1 -1
- package/dist/index111.js.map +1 -1
- package/dist/index112.js +1 -1
- package/dist/index112.js.map +1 -1
- package/dist/index113.js +2 -2
- package/dist/index113.js.map +1 -1
- package/dist/index114.js +2 -2
- package/dist/index114.js.map +1 -1
- package/dist/index115.js +1 -1
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +2 -2
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +2 -2
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +2 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +2 -2
- package/dist/index119.js.map +1 -1
- package/dist/index12.js +2 -2
- package/dist/index120.js +1 -1
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +2 -2
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +2 -2
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +1 -1
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +1 -1
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -2
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +2 -2
- package/dist/index129.js.map +1 -1
- package/dist/index13.js +1 -1
- package/dist/index130.js +1 -1
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +1 -1
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +1 -1
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +2 -2
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +1 -1
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +2 -2
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +1 -1
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +2 -2
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +2 -2
- package/dist/index139.js.map +1 -1
- package/dist/index140.js +1 -1
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +1 -1
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +1 -1
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +1 -1
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +1 -1
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +1 -1
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +2 -2
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +1 -1
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +1 -1
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +2 -2
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +1 -1
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +1 -1
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +1 -1
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +1 -1
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +1 -1
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +2 -2
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +2 -2
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +1 -1
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +2 -2
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +1 -1
- package/dist/index159.js.map +1 -1
- package/dist/index16.js +25 -23
- package/dist/index16.js.map +1 -1
- package/dist/index160.js +1 -1
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +2 -2
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +2 -2
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +1 -1
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +1 -1
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +1 -1
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +1 -1
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +1 -1
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +1 -1
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +1 -1
- package/dist/index169.js.map +1 -1
- package/dist/index17.js +29 -29
- package/dist/index17.js.map +1 -1
- package/dist/index170.js +1 -1
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +1 -1
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +1 -1
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +1 -1
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +1 -1
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +1 -1
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +1 -1
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +1 -1
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +1 -1
- package/dist/index178.js.map +1 -1
- package/dist/index179.js +1 -1
- package/dist/index179.js.map +1 -1
- package/dist/index18.js +85 -63
- package/dist/index18.js.map +1 -1
- package/dist/index180.js +1 -1
- package/dist/index180.js.map +1 -1
- package/dist/index181.js +1 -1
- package/dist/index181.js.map +1 -1
- package/dist/index182.js +1 -1
- package/dist/index182.js.map +1 -1
- package/dist/index183.js +1 -1
- package/dist/index183.js.map +1 -1
- package/dist/index184.js +1 -1
- package/dist/index184.js.map +1 -1
- package/dist/index185.js +2 -2
- package/dist/index185.js.map +1 -1
- package/dist/index186.js +1 -1
- package/dist/index186.js.map +1 -1
- package/dist/index187.js +1 -1
- package/dist/index187.js.map +1 -1
- package/dist/index188.js +2 -2
- package/dist/index188.js.map +1 -1
- package/dist/index189.js +2 -2
- package/dist/index189.js.map +1 -1
- package/dist/index19.js +181 -166
- package/dist/index19.js.map +1 -1
- package/dist/index190.js +1 -1
- package/dist/index190.js.map +1 -1
- package/dist/index191.js +1 -1
- package/dist/index191.js.map +1 -1
- package/dist/index192.js +2 -2
- package/dist/index192.js.map +1 -1
- package/dist/index193.js +1 -1
- package/dist/index193.js.map +1 -1
- package/dist/index194.js +1 -1
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +1 -1
- package/dist/index195.js.map +1 -1
- package/dist/index196.js +1 -1
- package/dist/index196.js.map +1 -1
- package/dist/index197.js +1 -1
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +1 -1
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +1 -1
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +2 -2
- package/dist/index200.js.map +1 -1
- package/dist/index201.js +1 -1
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +2 -2
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +149 -2
- package/dist/index203.js.map +1 -1
- package/dist/index204.js +9 -2
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +6 -2
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +5 -149
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +41 -4
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +24 -0
- package/dist/index208.js.map +1 -0
- package/dist/index215.js +26 -0
- package/dist/index215.js.map +1 -0
- package/dist/index216.js +75 -0
- package/dist/index216.js.map +1 -0
- package/dist/{index221.js → index224.js} +1 -1
- package/dist/{index221.js.map → index224.js.map} +1 -1
- package/dist/index23.js +3 -3
- package/dist/index232.js +1233 -43
- package/dist/index232.js.map +1 -1
- package/dist/index235.js +46 -0
- package/dist/index235.js.map +1 -0
- package/dist/index244.js +168 -8
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +3 -9
- package/dist/index245.js.map +1 -1
- package/dist/index247.js +18 -169
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +10 -11
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +8 -4
- package/dist/index249.js.map +1 -1
- package/dist/index25.js +175 -161
- package/dist/index25.js.map +1 -1
- package/dist/index250.js +4 -5
- package/dist/index250.js.map +1 -1
- package/dist/index251.js +168 -36
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +11 -2
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +5 -7
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +5 -326
- package/dist/index254.js.map +1 -1
- package/dist/index255.js +36 -48
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +2 -2
- package/dist/index257.js +7 -75
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +308 -74
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +45 -47
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +2 -8
- package/dist/index260.js.map +1 -1
- package/dist/index261.js +75 -4
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +89 -48
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +52 -2
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +8 -2
- package/dist/index264.js.map +1 -1
- package/dist/index265.js +8 -0
- package/dist/index265.js.map +1 -0
- package/dist/index266.js +55 -0
- package/dist/index266.js.map +1 -0
- package/dist/index267.js +5 -0
- package/dist/index267.js.map +1 -0
- package/dist/index268.js +5 -0
- package/dist/index268.js.map +1 -0
- package/dist/index28.js +5 -5
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +1 -1
- package/dist/index3.js +59 -49
- package/dist/index3.js.map +1 -1
- package/dist/index30.js +1 -1
- package/dist/index33.js +1 -1
- package/dist/index35.js +1 -1
- package/dist/index36.js +2 -2
- package/dist/index38.js +209 -194
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +3 -3
- package/dist/index4.js +1 -1
- package/dist/index40.js +1 -1
- package/dist/index43.js +96 -57
- package/dist/index43.js.map +1 -1
- package/dist/index45.js +60 -59
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +3 -3
- package/dist/index49.js +1 -1
- package/dist/index51.js +1 -1
- package/dist/index52.js +2 -2
- package/dist/index53.js +1 -1
- package/dist/index55.js +2 -2
- package/dist/index55.js.map +1 -1
- package/dist/index57.js +1 -1
- package/dist/index6.js +238 -236
- package/dist/index6.js.map +1 -1
- package/dist/index61.js +9 -8
- package/dist/index61.js.map +1 -1
- package/dist/index63.js +1 -1
- package/dist/index64.js +35 -34
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +1 -1
- package/dist/index67.js +1 -1
- package/dist/index68.js +80 -58
- package/dist/index68.js.map +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.js +1 -1
- package/dist/index75.js +108 -5
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +18 -54
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +10 -23
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +5 -9
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +57 -21
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +22 -17
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +8 -8
- package/dist/index81.js.map +1 -1
- package/dist/index83.js +2 -6
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +2 -68
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +2 -21
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +5 -0
- package/dist/index86.js.map +1 -0
- package/dist/index87.js +2 -2
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +2 -2
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +1 -1
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +3 -3
- package/dist/index90.js +2 -2
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +1 -1
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +1 -1
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +1 -1
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +1 -1
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +1 -1
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +1 -1
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +1 -1
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +1 -1
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +1 -1
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
- package/dist/index229.js +0 -1236
- package/dist/index229.js.map +0 -1
- package/dist/index241.js +0 -173
- package/dist/index241.js.map +0 -1
- package/dist/index242.js +0 -7
- package/dist/index242.js.map +0 -1
- package/dist/index246.js +0 -8
- package/dist/index246.js.map +0 -1
- package/dist/index82.js +0 -45
- package/dist/index82.js.map +0 -1
package/dist/index45.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index45.js","sources":["../src/components/AutoCompleteInput/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useCallback, useState } from 'react';\nimport './style.scss';\nimport { Icon } from '../Icon';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes, useCombobox } from '../../utils/a11y';\n\nexport interface AutoCompleteInputProps {\n value: string;\n disabled?: boolean;\n maxLength?: number;\n /** Called when the user types in the input. Not called on suggestion selection. */\n onChange: (value: string) => void;\n tag?: string;\n error?: boolean;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n /**\n * Suggestion items. Default rendering expects { label, value } shape.\n * When renderOption is provided, any shape is accepted.\n */\n suggestions?: any[];\n /**\n * Called when a suggestion is selected (click or Enter key).\n * Receives the full item object from the suggestions array.\n */\n onSelect?: (item: any) => void;\n /**\n * Render custom content for each suggestion option. The component handles the option wrapper\n * (ARIA props, highlight, click, keyboard navigation). You only provide the inner content.\n */\n renderOption?: (suggestion: any, context: { isHighlighted: boolean; index: number }) => React.ReactNode;\n /**\n * Custom CSS class for option elements. Replaces the default 'suggestion-item' class.\n * Useful with renderOption to apply custom styling to option wrappers.\n */\n optionClassName?: string;\n automationId?: string;\n /**\n * Accessible label for the input. Used when no visible label is provided.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this input. Takes precedence over ariaLabel.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) providing additional description.\n */\n ariaDescribedBy?: string;\n}\n\nexport const AutoCompleteInput: React.FC<AutoCompleteInputProps> = React.memo(\n ({\n value,\n onChange,\n disabled = false,\n maxLength,\n tag = 'input',\n error = false,\n errorMessage,\n label,\n placeholder,\n suggestions = [],\n onSelect,\n renderOption,\n optionClassName,\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ...props\n }) => {\n const [filteredSuggestions, setFilteredSuggestions] = useState<any[]>([...suggestions]);\n const [isSuggestionBoxVisible, setSuggestionBoxVisible] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Generate stable unique IDs per instance so label, input, listbox, and error never share IDs (HTML/ARIA require unique ids).\n const instanceId = useStableId(undefined, 'autocomplete');\n const inputId = `${instanceId}-input`;\n const listboxId = `${instanceId}-listbox`;\n const labelId = `${instanceId}-label`;\n const errorId = `${instanceId}-error`;\n\n const handleSelectSuggestion = useCallback(\n (item: any) => {\n setSuggestionBoxVisible(false);\n onSelect?.(item);\n },\n [onSelect]\n );\n\n // Use the comprehensive useCombobox hook\n const {\n containerProps,\n inputProps: comboboxInputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex\n } = useCombobox<any>({\n items: filteredSuggestions,\n isOpen: isSuggestionBoxVisible,\n onOpenChange: setSuggestionBoxVisible,\n onSelect: handleSelectSuggestion,\n listboxId\n });\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n setHighlightedIndex(-1); // Reset highlight on input change\n onChange(inputValue);\n\n // Internal filtering for default rendering (when no renderOption, component manages filtering)\n if (!renderOption) {\n if (inputValue === '') {\n setFilteredSuggestions([...suggestions]);\n } else {\n const filtered = suggestions?.filter(\n (suggestion) =>\n typeof suggestion === 'object' &&\n suggestion?.label?.toLowerCase().includes(inputValue?.toLowerCase() ?? '')\n );\n setFilteredSuggestions([...filtered]);\n }\n }\n },\n [onChange, suggestions, renderOption, setHighlightedIndex]\n );\n\n useEffect(() => {\n setFilteredSuggestions([...suggestions]);\n }, [suggestions]);\n\n const handleInputClick = () => {\n setSuggestionBoxVisible(true);\n };\n\n const handleInputFocus = () => {\n if (filteredSuggestions.length > 0) {\n setSuggestionBoxVisible(true);\n }\n };\n\n const handleClearInput = () => {\n onChange('');\n setHighlightedIndex(-1);\n inputRef.current?.focus();\n };\n\n // Build ARIA name attributes: when ariaLabel is provided use it (e.g. \"Signer 1 name\"); otherwise use visible label or ariaLabelledBy\n const a11yNameProps = getA11yNameAttributes({\n ariaLabelledBy: label && !ariaLabel ? labelId : ariaLabelledBy,\n ariaLabel,\n ariaDescribedBy: error ? errorId : ariaDescribedBy\n });\n\n return (\n <div \n className=\"main-container-autocomplete-se-design\" \n ref={containerRef} \n data-automation-id={automationId}\n {...containerProps}\n >\n {label && (\n <span\n id={labelId}\n className={`label-container ${disabled ? 'label-container-disabled' : ''}`}\n >\n {label}\n </span>\n )}\n <div className=\"input-container-wrapper\">\n <div className=\"input-wrapper\" style={{ pointerEvents: disabled ? 'none' : 'auto' }}>\n {React.createElement(tag, {\n ref: inputRef,\n id: inputId,\n value: value,\n onChange: handleInputChange,\n onClick: handleInputClick,\n onFocus: handleInputFocus,\n ...comboboxInputProps,\n disabled,\n className: `${error ? 'input-container-error' : 'input-container-default'} ${disabled ? 'input-container-disabled' : ''} ${filteredSuggestions.length > 0 || value ? 'with-icon' : ''} ${filteredSuggestions.length > 0 && value ? 'with-icons' : ''}`,\n maxLength,\n placeholder,\n 'aria-invalid': error || undefined,\n ...a11yNameProps,\n ...props\n })}\n {value && (\n <Icon\n name=\"close\"\n className=\"input-icon-close\"\n size={15}\n onClick={handleClearInput}\n stroke={disabled ? 'var(--color-gray-600)' : ''}\n ariaLabel=\"Clear input\"\n />\n )}\n {filteredSuggestions.length > 0 && (\n <Icon\n name=\"chevron\"\n rotation={isSuggestionBoxVisible ? '180' : '0'}\n className=\"input-icon-chevron\"\n stroke={disabled ? 'var(--color-gray-600)' : ''}\n aria-hidden=\"true\"\n />\n )}\n </div>\n {isSuggestionBoxVisible && filteredSuggestions.length > 0 && (\n <div\n {...listboxProps}\n aria-label={label || ariaLabel || 'Suggestions'}\n className=\"suggestions-list\"\n data-automation-id=\"autocomplete-suggestions-list\"\n >\n {filteredSuggestions.map((suggestion, index) => {\n const optionProps = getOptionProps(index, false);\n const isHighlighted = highlightedIndex === index;\n return (\n <div\n key={index}\n {...optionProps}\n className={`${optionClassName || 'suggestion-item'} ${isHighlighted ? 'suggestion-item-highlighted' : ''}`}\n onClick={() => handleSelectSuggestion(suggestion)}\n onMouseEnter={() => setHighlightedIndex(index)}\n data-automation-id={`autocomplete-suggestion-item-${index}`}\n >\n {renderOption\n ? renderOption(suggestion, { isHighlighted, index })\n : suggestion.label}\n </div>\n );\n })}\n </div>\n )}\n </div>\n {(error || maxLength) && (\n <div className={`${error ? 'error-and-max-word' : 'max-word-container'} ${disabled ? 'disabled' : ''}`}>\n {error && (\n <div id={errorId} className=\"error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n {maxLength && (\n <div className=\"max-word\">\n {value.length}/{maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n"],"names":["AutoCompleteInput","React","memo","value","onChange","disabled","maxLength","tag","error","errorMessage","label","placeholder","suggestions","onSelect","renderOption","optionClassName","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","props","filteredSuggestions","setFilteredSuggestions","useState","isSuggestionBoxVisible","setSuggestionBoxVisible","containerRef","useRef","inputRef","instanceId","useStableId","undefined","inputId","listboxId","labelId","errorId","handleSelectSuggestion","useCallback","item","containerProps","inputProps","comboboxInputProps","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","useCombobox","items","isOpen","onOpenChange","handleInputChange","e","inputValue","target","filtered","filter","suggestion","toLowerCase","includes","useEffect","handleInputClick","handleInputFocus","length","handleClearInput","current","focus","a11yNameProps","getA11yNameAttributes","createElement","_extends","className","ref","id","style","pointerEvents","onClick","onFocus","Icon","name","size","stroke","rotation","map","index","optionProps","isHighlighted","key","onMouseEnter","role"],"mappings":";;;;;;;;;;;;;;;;AAoDO,MAAMA,KAAsDC,gBAAAA,EAAMC,KACvE,CAAC;AAAA,EACCC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA;AAAAA,EACAC,KAAAA,IAAM;AAAA,EACNC,OAAAA,IAAQ;AAAA,EACRC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,aAAAA,IAAc,CAAA;AAAA,EACdC,UAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAAgB,CAAC,GAAGX,CAAW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AA,IAAA,CAAG,GAE3DrE,IACGA,EAAa0C,GAAY;AAAA,MAAE6B,eAAAA;AAAAA,MAAeF,OAAAA;AAAAA,IAAAA,CAAO,IACjD3B,EAAW9C,KACZ;AAAA,EAET,CAAC,CACE,CAEJ,IACHF,KAASF,MACTL,gBAAAA,EAAAmE,cAAA,OAAA;AAAA,IAAKE,WAAW,GAAG9D,IAAQ,uBAAuB,oBAAoB,IAAIH,IAAW,aAAa,EAAE;AAAA,EAAA,GACjGG,KACCP,gBAAAA,EAAAmE,cAAA,OAAA;AAAA,IAAKI,IAAIrC;AAAAA,IAASmC,WAAU;AAAA,IAAgBkB,MAAK;AAAA,EAAA,GAC9C/E,CACE,GAENH,KACCL,gBAAAA,EAAAmE,cAAA,OAAA;AAAA,IAAKE,WAAU;AAAA,EAAA,GACZnE,EAAM2D,QAAO,KAAExD,CACb,CAEJ,CAEJ;AAET,CACF;"}
|
|
1
|
+
{"version":3,"file":"index45.js","sources":["../src/components/AutoCompleteInput/index.tsx"],"sourcesContent":["import React, { useEffect, useRef, useCallback, useState } from 'react';\nimport './style.scss';\nimport { Icon } from '../Icon';\nimport { useStableId } from '../../utils/useStableId';\nimport { getA11yNameAttributes, useCombobox } from '../../utils/a11y';\n\nexport interface AutoCompleteInputProps {\n value: string;\n disabled?: boolean;\n maxLength?: number;\n /** Called when the user types in the input. Not called on suggestion selection. */\n onChange: (value: string) => void;\n tag?: string;\n error?: boolean;\n errorMessage?: string;\n label?: string;\n placeholder?: string;\n /**\n * Suggestion items. Default rendering expects { label, value } shape.\n * When renderOption is provided, any shape is accepted.\n */\n suggestions?: any[];\n /**\n * Called when a suggestion is selected (click or Enter key).\n * Receives the full item object from the suggestions array.\n */\n onSelect?: (item: any) => void;\n /**\n * Render custom content for each suggestion option. The component handles the option wrapper\n * (ARIA props, highlight, click, keyboard navigation). You only provide the inner content.\n */\n renderOption?: (suggestion: any, context: { isHighlighted: boolean; index: number }) => React.ReactNode;\n /**\n * Custom CSS class for option elements. Replaces the default 'suggestion-item' class.\n * Useful with renderOption to apply custom styling to option wrappers.\n */\n optionClassName?: string;\n automationId?: string;\n /**\n * Accessible label for the input. Used when no visible label is provided.\n */\n ariaLabel?: string;\n /**\n * ID(s) of element(s) that label this input. Takes precedence over ariaLabel.\n */\n ariaLabelledBy?: string;\n /**\n * ID(s) of element(s) providing additional description.\n */\n ariaDescribedBy?: string;\n}\n\nexport const AutoCompleteInput: React.FC<AutoCompleteInputProps> = React.memo(\n ({\n value,\n onChange,\n disabled = false,\n maxLength,\n tag = 'input',\n error = false,\n errorMessage,\n label,\n placeholder,\n suggestions = [],\n onSelect,\n renderOption,\n optionClassName,\n automationId = '',\n ariaLabel,\n ariaLabelledBy,\n ariaDescribedBy,\n ...props\n }) => {\n const [filteredSuggestions, setFilteredSuggestions] = useState<any[]>([...suggestions]);\n const [isSuggestionBoxVisible, setSuggestionBoxVisible] = useState<boolean>(false);\n const containerRef = useRef<HTMLDivElement>(null);\n const inputRef = useRef<HTMLInputElement>(null);\n\n // Generate stable unique IDs per instance so label, input, listbox, and error never share IDs (HTML/ARIA require unique ids).\n const instanceId = useStableId(undefined, 'autocomplete');\n const inputId = `${instanceId}-input`;\n const listboxId = `${instanceId}-listbox`;\n const labelId = `${instanceId}-label`;\n const errorId = `${instanceId}-error`;\n\n const handleSelectSuggestion = useCallback(\n (item: any) => {\n setSuggestionBoxVisible(false);\n onSelect?.(item);\n },\n [onSelect]\n );\n\n // Use the comprehensive useCombobox hook\n const {\n containerProps,\n inputProps: comboboxInputProps,\n listboxProps,\n getOptionProps,\n highlightedIndex,\n setHighlightedIndex,\n isKeyboardFocused\n } = useCombobox<any>({\n items: filteredSuggestions,\n isOpen: isSuggestionBoxVisible,\n onOpenChange: setSuggestionBoxVisible,\n onSelect: handleSelectSuggestion,\n listboxId\n });\n\n const handleInputChange = useCallback(\n (e: React.ChangeEvent<HTMLInputElement>) => {\n const inputValue = e.target.value;\n setHighlightedIndex(-1); // Reset highlight on input change\n onChange(inputValue);\n\n // Internal filtering for default rendering (when no renderOption, component manages filtering)\n if (!renderOption) {\n if (inputValue === '') {\n setFilteredSuggestions([...suggestions]);\n } else {\n const filtered = suggestions?.filter(\n (suggestion) =>\n typeof suggestion === 'object' &&\n suggestion?.label?.toLowerCase().includes(inputValue?.toLowerCase() ?? '')\n );\n setFilteredSuggestions([...filtered]);\n }\n }\n },\n [onChange, suggestions, renderOption, setHighlightedIndex]\n );\n\n useEffect(() => {\n setFilteredSuggestions([...suggestions]);\n }, [suggestions]);\n\n const handleInputClick = () => {\n setSuggestionBoxVisible(true);\n };\n\n const handleInputFocus = () => {\n if (filteredSuggestions.length > 0) {\n setSuggestionBoxVisible(true);\n }\n };\n\n const handleClearInput = () => {\n onChange('');\n setHighlightedIndex(-1);\n inputRef.current?.focus();\n };\n\n // Build ARIA name attributes: when ariaLabel is provided use it (e.g. \"Signer 1 name\"); otherwise use visible label or ariaLabelledBy\n const a11yNameProps = getA11yNameAttributes({\n ariaLabelledBy: label && !ariaLabel ? labelId : ariaLabelledBy,\n ariaLabel,\n ariaDescribedBy: error ? errorId : ariaDescribedBy\n });\n\n return (\n <div \n className=\"main-container-autocomplete-se-design\" \n ref={containerRef} \n data-automation-id={automationId}\n {...containerProps}\n >\n {label && (\n <span\n id={labelId}\n className={`label-container ${disabled ? 'label-container-disabled' : ''}`}\n >\n {label}\n </span>\n )}\n <div className=\"input-container-wrapper\">\n <div className=\"input-wrapper\" style={{ pointerEvents: disabled ? 'none' : 'auto' }}>\n {React.createElement(tag, {\n ref: inputRef,\n id: inputId,\n value: value,\n onChange: handleInputChange,\n onClick: handleInputClick,\n onFocus: handleInputFocus,\n ...comboboxInputProps,\n disabled,\n className: `${error ? 'input-container-error' : 'input-container-default'} ${disabled ? 'input-container-disabled' : ''} ${filteredSuggestions.length > 0 || value ? 'with-icon' : ''} ${filteredSuggestions.length > 0 && value ? 'with-icons' : ''}`,\n maxLength,\n placeholder,\n 'aria-invalid': error || undefined,\n ...a11yNameProps,\n ...props\n })}\n {value && (\n <Icon\n name=\"close\"\n className=\"input-icon-close\"\n size={15}\n onClick={handleClearInput}\n stroke={disabled ? 'var(--color-gray-600)' : ''}\n ariaLabel=\"Clear input\"\n />\n )}\n {filteredSuggestions.length > 0 && (\n <Icon\n name=\"chevron\"\n rotation={isSuggestionBoxVisible ? '180' : '0'}\n className=\"input-icon-chevron\"\n stroke={disabled ? 'var(--color-gray-600)' : ''}\n aria-hidden=\"true\"\n />\n )}\n </div>\n {isSuggestionBoxVisible && filteredSuggestions.length > 0 && (\n <div\n {...listboxProps}\n aria-label={label || ariaLabel || 'Suggestions'}\n className=\"suggestions-list\"\n data-automation-id=\"autocomplete-suggestions-list\"\n >\n {filteredSuggestions.map((suggestion, index) => {\n const optionProps = getOptionProps(index, false);\n const isHighlighted = highlightedIndex === index;\n return (\n <div\n key={index}\n {...optionProps}\n className={`${optionClassName || 'suggestion-item'} ${isHighlighted ? `suggestion-item-highlighted${isKeyboardFocused ? ' suggestion-item-keyboard-highlight' : ''}` : ''}`}\n onClick={() => handleSelectSuggestion(suggestion)}\n onMouseEnter={() => setHighlightedIndex(index)}\n data-automation-id={`autocomplete-suggestion-item-${index}`}\n >\n {renderOption\n ? renderOption(suggestion, { isHighlighted, index })\n : suggestion.label}\n </div>\n );\n })}\n </div>\n )}\n </div>\n {(error || maxLength) && (\n <div className={`${error ? 'error-and-max-word' : 'max-word-container'} ${disabled ? 'disabled' : ''}`}>\n {error && (\n <div id={errorId} className=\"error-message\" role=\"alert\">\n {errorMessage}\n </div>\n )}\n {maxLength && (\n <div className=\"max-word\">\n {value.length}/{maxLength}\n </div>\n )}\n </div>\n )}\n </div>\n );\n }\n);\n"],"names":["AutoCompleteInput","React","memo","value","onChange","disabled","maxLength","tag","error","errorMessage","label","placeholder","suggestions","onSelect","renderOption","optionClassName","automationId","ariaLabel","ariaLabelledBy","ariaDescribedBy","props","filteredSuggestions","setFilteredSuggestions","useState","isSuggestionBoxVisible","setSuggestionBoxVisible","containerRef","useRef","inputRef","instanceId","useStableId","undefined","inputId","listboxId","labelId","errorId","handleSelectSuggestion","useCallback","item","containerProps","inputProps","comboboxInputProps","listboxProps","getOptionProps","highlightedIndex","setHighlightedIndex","isKeyboardFocused","useCombobox","items","isOpen","onOpenChange","handleInputChange","e","inputValue","target","filtered","filter","suggestion","toLowerCase","includes","useEffect","handleInputClick","handleInputFocus","length","handleClearInput","current","focus","a11yNameProps","getA11yNameAttributes","createElement","_extends","className","ref","id","style","pointerEvents","onClick","onFocus","Icon","name","size","stroke","rotation","map","index","optionProps","isHighlighted","key","onMouseEnter","role"],"mappings":";;;;;;;;;;;;;;;;AAoDO,MAAMA,KAAsDC,gBAAAA,EAAMC,KACvE,CAAC;AAAA,EACCC,OAAAA;AAAAA,EACAC,UAAAA;AAAAA,EACAC,UAAAA,IAAW;AAAA,EACXC,WAAAA;AAAAA,EACAC,KAAAA,IAAM;AAAA,EACNC,OAAAA,IAAQ;AAAA,EACRC,cAAAA;AAAAA,EACAC,OAAAA;AAAAA,EACAC,aAAAA;AAAAA,EACAC,aAAAA,IAAc,CAAA;AAAA,EACdC,UAAAA;AAAAA,EACAC,cAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACAC,cAAAA,IAAe;AAAA,EACfC,WAAAA;AAAAA,EACAC,gBAAAA;AAAAA,EACAC,iBAAAA;AAAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAM,CAACC,GAAqBC,CAAsB,IAAIC,EAAgB,CAAC,GAAGX,CAAW,CAAC,GAChF,CAACY,GAAwBC,CAAuB,IAAIF,EAAkB,EAAK,GAC3EG,IAAeC,EAAuB,IAAI,GAC1CC,IAAWD,EAAyB,IAAI,GAGxCE,IAAaC,EAAYC,QAAW,cAAc,GAClDC,IAAU,GAAGH,CAAU,UACvBI,IAAY,GAAGJ,CAAU,YACzBK,IAAU,GAAGL,CAAU,UACvBM,IAAU,GAAGN,CAAU,UAEvBO,IAAyBC,EAC7B,CAACC,MAAc;AACbb,IAAAA,EAAwB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B,oBAAoB,IAAIH,IAAW,aAAa,EAAE;AAAA,EAAA,GACjGG,KACCP,gBAAAA,EAAAoE,cAAA,OAAA;AAAA,IAAKI,IAAItC;AAAAA,IAASoC,WAAU;AAAA,IAAgBkB,MAAK;AAAA,EAAA,GAC9ChF,CACE,GAENH,KACCL,gBAAAA,EAAAoE,cAAA,OAAA;AAAA,IAAKE,WAAU;AAAA,EAAA,GACZpE,EAAM4D,QAAO,KAAEzD,CACb,CAEJ,CAEJ;AAET,CACF;"}
|
package/dist/index46.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import t, { useState as h, useRef as f, useCallback as g, useEffect as _ } from "react";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import C from "./
|
|
3
|
+
import C from "./index232.js";
|
|
4
4
|
import { Icon as M } from "./index6.js";
|
|
5
|
-
import { useStableId as v } from "./
|
|
6
|
-
import { getA11yNameAttributes as T } from "./
|
|
5
|
+
import { useStableId as v } from "./index205.js";
|
|
6
|
+
import { getA11yNameAttributes as T } from "./index81.js";
|
|
7
7
|
import "./index72.js";
|
|
8
8
|
import { useCombobox as le } from "./index68.js";
|
|
9
9
|
function c() {
|
package/dist/index49.js
CHANGED
|
@@ -31,7 +31,7 @@ import { Popover as $ } from "./index19.js";
|
|
|
31
31
|
/* empty css */
|
|
32
32
|
/* empty css */
|
|
33
33
|
/* empty css */
|
|
34
|
-
import { TabButton as j } from "./
|
|
34
|
+
import { TabButton as j } from "./index235.js";
|
|
35
35
|
/* empty css */
|
|
36
36
|
/* empty css */
|
|
37
37
|
/* empty css */
|
package/dist/index51.js
CHANGED
|
@@ -2,7 +2,7 @@ import r, { useState as S } from "react";
|
|
|
2
2
|
import { Button as z } from "./index4.js";
|
|
3
3
|
import { Icon as _ } from "./index6.js";
|
|
4
4
|
import { Dropdown as te } from "./index25.js";
|
|
5
|
-
import { useDatePickerA11y as Fe, formatDateId as Pe, getCellAriaLabel as Ce } from "./
|
|
5
|
+
import { useDatePickerA11y as Fe, formatDateId as Pe, getCellAriaLabel as Ce } from "./index244.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
function T() {
|
|
8
8
|
return T = Object.assign ? Object.assign.bind() : function(p) {
|
package/dist/index52.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import t from "react";
|
|
2
2
|
import { Icon as W } from "./index6.js";
|
|
3
|
-
import { useStableId as j } from "./
|
|
4
|
-
import { getA11yNameAttributes as q } from "./
|
|
3
|
+
import { useStableId as j } from "./index205.js";
|
|
4
|
+
import { getA11yNameAttributes as q } from "./index81.js";
|
|
5
5
|
import "./index72.js";
|
|
6
6
|
/* empty css */
|
|
7
7
|
function U({
|
package/dist/index53.js
CHANGED
package/dist/index55.js
CHANGED
|
@@ -60,8 +60,8 @@ const n = ({
|
|
|
60
60
|
structure: e,
|
|
61
61
|
className: d = "",
|
|
62
62
|
animationDuration: s = 3,
|
|
63
|
-
baseColor: m = "var(--color-gray-
|
|
64
|
-
highlightColor: i = "var(--color-gray-
|
|
63
|
+
baseColor: m = "var(--color-gray-700)",
|
|
64
|
+
highlightColor: i = "var(--color-gray-600)",
|
|
65
65
|
width: r,
|
|
66
66
|
height: a
|
|
67
67
|
}) => {
|
package/dist/index55.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index55.js","sources":["../src/components/ShimmerLoader/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport './style.scss';\n\nexport interface ShimmerElement {\n type: 'text' | 'rect' | 'rect-sm' | 'circle' | 'avatar' | 'image' | 'button';\n width: number | string;\n height: number | string;\n borderRadius?: number | string;\n margin?: string;\n className?: string;\n children?: ShimmerElement[];\n}\n\nexport interface ShimmerContainer {\n type: 'container';\n direction?: 'row' | 'column';\n gap?: number | string;\n padding?: string;\n margin?: string;\n alignItems?: string;\n flex?: number | string;\n className?: string;\n children: (ShimmerElement | ShimmerContainer)[];\n}\n\nexport type ShimmerStructure = (ShimmerElement | ShimmerContainer)[];\n\nexport interface ShimmerLoaderProps {\n structure: ShimmerStructure;\n className?: string;\n animationDuration?: number;\n baseColor?: string;\n highlightColor?: string;\n width?: number | string;\n height?: number | string;\n}\n\nconst ShimmerElementComponent: FC<{\n element: ShimmerElement;\n animationDuration: number;\n baseColor: string;\n highlightColor: string;\n}> = ({ element, animationDuration, baseColor, highlightColor }) => {\n const style: React.CSSProperties = {\n width: typeof element.width === 'number' ? `${element.width}px` : element.width,\n height: typeof element.height === 'number' ? `${element.height}px` : element.height,\n borderRadius: element.borderRadius\n ? typeof element.borderRadius === 'number'\n ? `${element.borderRadius}px`\n : element.borderRadius\n : undefined,\n margin: element.margin,\n '--shimmer-duration': `${animationDuration}s`,\n '--shimmer-base-color': baseColor,\n '--shimmer-highlight-color': highlightColor\n } as React.CSSProperties;\n\n const shimmerClass = `se-design-shimmer-element se-design-shimmer-${element.type}`;\n\n return (\n <div className={shimmerClass} style={style}>\n {element.children &&\n element.children.map((child, index) => (\n <ShimmerElementComponent\n key={index}\n element={child}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ))}\n </div>\n );\n};\n\nconst ShimmerContainerComponent: FC<{\n container: ShimmerContainer;\n animationDuration: number;\n baseColor: string;\n highlightColor: string;\n}> = ({ container, animationDuration, baseColor, highlightColor }) => {\n const style: React.CSSProperties = {\n display: 'flex',\n flexDirection: container.direction || 'column',\n gap: typeof container.gap === 'number' ? `${container.gap}px` : container.gap,\n padding: container.padding,\n margin: container.margin,\n alignItems: container.alignItems,\n flex: container.flex\n };\n\n return (\n <div className={`se-design-shimmer-container ${container.className || ''}`} style={style}>\n {container.children.map((element, index) =>\n element.type === 'container' ? (\n <ShimmerContainerComponent\n key={index}\n container={element}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ) : (\n <ShimmerElementComponent\n key={index}\n element={element}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n )\n )}\n </div>\n );\n};\n\nexport const ShimmerLoader: FC<ShimmerLoaderProps> = ({\n structure,\n className = '',\n animationDuration = 3,\n baseColor = 'var(--color-gray-
|
|
1
|
+
{"version":3,"file":"index55.js","sources":["../src/components/ShimmerLoader/index.tsx"],"sourcesContent":["import React, { FC } from 'react';\nimport './style.scss';\n\nexport interface ShimmerElement {\n type: 'text' | 'rect' | 'rect-sm' | 'circle' | 'avatar' | 'image' | 'button';\n width: number | string;\n height: number | string;\n borderRadius?: number | string;\n margin?: string;\n className?: string;\n children?: ShimmerElement[];\n}\n\nexport interface ShimmerContainer {\n type: 'container';\n direction?: 'row' | 'column';\n gap?: number | string;\n padding?: string;\n margin?: string;\n alignItems?: string;\n flex?: number | string;\n className?: string;\n children: (ShimmerElement | ShimmerContainer)[];\n}\n\nexport type ShimmerStructure = (ShimmerElement | ShimmerContainer)[];\n\nexport interface ShimmerLoaderProps {\n structure: ShimmerStructure;\n className?: string;\n animationDuration?: number;\n baseColor?: string;\n highlightColor?: string;\n width?: number | string;\n height?: number | string;\n}\n\nconst ShimmerElementComponent: FC<{\n element: ShimmerElement;\n animationDuration: number;\n baseColor: string;\n highlightColor: string;\n}> = ({ element, animationDuration, baseColor, highlightColor }) => {\n const style: React.CSSProperties = {\n width: typeof element.width === 'number' ? `${element.width}px` : element.width,\n height: typeof element.height === 'number' ? `${element.height}px` : element.height,\n borderRadius: element.borderRadius\n ? typeof element.borderRadius === 'number'\n ? `${element.borderRadius}px`\n : element.borderRadius\n : undefined,\n margin: element.margin,\n '--shimmer-duration': `${animationDuration}s`,\n '--shimmer-base-color': baseColor,\n '--shimmer-highlight-color': highlightColor\n } as React.CSSProperties;\n\n const shimmerClass = `se-design-shimmer-element se-design-shimmer-${element.type}`;\n\n return (\n <div className={shimmerClass} style={style}>\n {element.children &&\n element.children.map((child, index) => (\n <ShimmerElementComponent\n key={index}\n element={child}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ))}\n </div>\n );\n};\n\nconst ShimmerContainerComponent: FC<{\n container: ShimmerContainer;\n animationDuration: number;\n baseColor: string;\n highlightColor: string;\n}> = ({ container, animationDuration, baseColor, highlightColor }) => {\n const style: React.CSSProperties = {\n display: 'flex',\n flexDirection: container.direction || 'column',\n gap: typeof container.gap === 'number' ? `${container.gap}px` : container.gap,\n padding: container.padding,\n margin: container.margin,\n alignItems: container.alignItems,\n flex: container.flex\n };\n\n return (\n <div className={`se-design-shimmer-container ${container.className || ''}`} style={style}>\n {container.children.map((element, index) =>\n element.type === 'container' ? (\n <ShimmerContainerComponent\n key={index}\n container={element}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n ) : (\n <ShimmerElementComponent\n key={index}\n element={element}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n )\n )}\n </div>\n );\n};\n\nexport const ShimmerLoader: FC<ShimmerLoaderProps> = ({\n structure,\n className = '',\n animationDuration = 3,\n baseColor = 'var(--color-gray-700)',\n highlightColor = 'var(--color-gray-600)',\n width,\n height\n}) => {\n const containerStyle: React.CSSProperties = {\n width: width ? (typeof width === 'number' ? `${width}px` : width) : '100%',\n height: height ? (typeof height === 'number' ? `${height}px` : height) : 'auto',\n '--shimmer-duration': `${animationDuration}s`,\n '--shimmer-base-color': baseColor,\n '--shimmer-highlight-color': highlightColor\n } as React.CSSProperties;\n\n return (\n <div className={`se-design-shimmer-loader ${className}`} style={containerStyle}>\n {structure.map((item, index) => {\n if (item.type === 'container') {\n return (\n <ShimmerContainerComponent\n key={index}\n container={item}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n );\n } else {\n return (\n <ShimmerElementComponent\n key={index}\n element={item}\n animationDuration={animationDuration}\n baseColor={baseColor}\n highlightColor={highlightColor}\n />\n );\n }\n })}\n </div>\n );\n};\n\nexport default ShimmerLoader;\n"],"names":["ShimmerElementComponent","element","animationDuration","baseColor","highlightColor","style","width","height","borderRadius","undefined","margin","shimmerClass","type","React","createElement","className","children","map","child","index","key","ShimmerContainerComponent","container","display","flexDirection","direction","gap","padding","alignItems","flex","ShimmerLoader","structure","containerStyle","item"],"mappings":";;AAqCA,MAAMA,IAKDA,CAAC;AAAA,EAAEC,SAAAA;AAAAA,EAASC,mBAAAA;AAAAA,EAAmBC,WAAAA;AAAAA,EAAWC,gBAAAA;AAAe,MAAM;AAClE,QAAMC,IAA6B;AAAA,IACjCC,OAAO,OAAOL,EAAQK,SAAU,WAAW,GAAGL,EAAQK,KAAK,OAAOL,EAAQK;AAAAA,IAC1EC,QAAQ,OAAON,EAAQM,UAAW,WAAW,GAAGN,EAAQM,MAAM,OAAON,EAAQM;AAAAA,IAC7EC,cAAcP,EAAQO,eAClB,OAAOP,EAAQO,gBAAiB,WAC9B,GAAGP,EAAQO,YAAY,OACvBP,EAAQO,eACVC;AAAAA,IACJC,QAAQT,EAAQS;AAAAA,IAChB,sBAAsB,GAAGR,CAAiB;AAAA,IAC1C,wBAAwBC;AAAAA,IACxB,6BAA6BC;AAAAA,EAAAA,GAGzBO,IAAe,+CAA+CV,EAAQW,IAAI;AAEhF,SACEC,gBAAAA,EAAAC,cAAA,OAAA;AAAA,IAAKC,WAAWJ;AAAAA,IAAcN,OAAAA;AAAAA,EAAAA,GAC3BJ,EAAQe,YACPf,EAAQe,SAASC,IAAI,CAACC,GAAOC,MAC3BN,gBAAAA,EAAAC,cAACd,GAAuB;AAAA,IACtBoB,KAAKD;AAAAA,IACLlB,SAASiB;AAAAA,IACThB,mBAAAA;AAAAA,IACAC,WAAAA;AAAAA,IACAC,gBAAAA;AAAAA,EAAAA,CACD,CACF,CACA;AAET,GAEMiB,IAKDA,CAAC;AAAA,EAAEC,WAAAA;AAAAA,EAAWpB,mBAAAA;AAAAA,EAAmBC,WAAAA;AAAAA,EAAWC,gBAAAA;AAAe,MAAM;AACpE,QAAMC,IAA6B;AAAA,IACjCkB,SAAS;AAAA,IACTC,eAAeF,EAAUG,aAAa;AAAA,IACtCC,KAAK,OAAO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