@intlayer/design-system 8.3.4 → 8.4.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/esm/components/DictionaryEditor/DictionaryEditor.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs +2 -0
- package/dist/esm/components/DictionaryEditor/NodeWrapper/BooleanWrapper.mjs.map +1 -0
- package/dist/esm/components/DictionaryEditor/NodeWrapper/NestedObjectWrapper.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs +2 -0
- package/dist/esm/components/DictionaryEditor/NodeWrapper/NumberWrapper.mjs.map +1 -0
- package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs +1 -1
- package/dist/esm/components/DictionaryEditor/NodeWrapper/index.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/esm/components/DictionaryFieldEditor/KeyPathBreadcrumb.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/NavigationView/NavigationViewNode.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs +1 -1
- package/dist/esm/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
- package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -1
- package/dist/esm/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs +1 -1
- package/dist/esm/components/LocaleSwitcherDropDown/LocaleSwitcher.mjs.map +1 -1
- package/dist/esm/components/MaxHeightSmoother/index.mjs +1 -1
- package/dist/esm/components/MaxHeightSmoother/index.mjs.map +1 -1
- package/dist/esm/components/index.mjs +1 -1
- package/dist/esm/hooks/index.mjs +1 -1
- package/dist/esm/hooks/useAuth/useOAuth2.mjs +1 -1
- package/dist/esm/hooks/useAuth/useSession.mjs +1 -1
- package/dist/types/components/Badge/index.d.ts +2 -2
- package/dist/types/components/Button/Button.d.ts +4 -4
- package/dist/types/components/Command/index.d.ts +2 -2
- package/dist/types/components/Container/index.d.ts +3 -3
- package/dist/types/components/DictionaryEditor/DictionaryEditor.d.ts +0 -2
- package/dist/types/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
- package/dist/types/components/DictionaryEditor/NodeWrapper/BooleanWrapper.d.ts +11 -0
- package/dist/types/components/DictionaryEditor/NodeWrapper/BooleanWrapper.d.ts.map +1 -0
- package/dist/types/components/DictionaryEditor/NodeWrapper/NumberWrapper.d.ts +11 -0
- package/dist/types/components/DictionaryEditor/NodeWrapper/NumberWrapper.d.ts.map +1 -0
- package/dist/types/components/DictionaryEditor/NodeWrapper/index.d.ts.map +1 -1
- package/dist/types/components/Input/Checkbox.d.ts +1 -1
- package/dist/types/components/Link/Link.d.ts +2 -2
- package/dist/types/components/Pagination/Pagination.d.ts +2 -2
- package/dist/types/components/SwitchSelector/index.d.ts +1 -1
- package/dist/types/components/Tab/Tab.d.ts +1 -1
- package/dist/types/components/TabSelector/TabSelector.d.ts +1 -1
- package/dist/types/components/Tag/index.d.ts +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocaleSwitcherContent.mjs","names":[],"sources":["../../../../src/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.tsx"],"sourcesContent":["'use client';\n\nimport { usePersistedStore } from '@hooks/usePersistedStore';\nimport { getHTMLTextDir, getLocaleName } from '@intlayer/core/localization';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport * as Locales from '@intlayer/types/locales';\nimport Fuse, { type IFuseOptions } from 'fuse.js';\nimport { Check, Globe, MoveVertical } from 'lucide-react';\nimport { type FC, useMemo, useRef, useState } from 'react';\nimport { useIntlayer, useLocale } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n ButtonSize,\n ButtonTextAlign,\n ButtonVariant,\n} from '../Button';\nimport { Container } from '../Container';\nimport { DropDown, type PanelProps } from '../DropDown';\nimport { Input } from '../Input';\nimport {\n SwitchSelector,\n SwitchSelectorColor,\n SwitchSelectorSize,\n} from '../SwitchSelector';\nimport { useLocaleSwitcherContent } from './LocaleSwitcherContentContext';\n\nexport type LocaleSwitcherContentProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n isMultilingual?: boolean;\n};\n\nconst DROPDOWN_IDENTIFIER = 'locale-switcher-content';\n\ntype MultilingualAvailableLocales = {\n locale: LocalesValues;\n englishName: string;\n currentLocaleName: string;\n ownLocaleName: string;\n};\n\nexport const LocaleSwitcherContent: FC<LocaleSwitcherContentProps> = ({\n panelProps,\n isMultilingual = true,\n}) => {\n const {\n switchTo,\n searchInput,\n localeSwitcherLabel,\n languageListLabel,\n seeAllLocalesSwitch,\n } = useIntlayer('locale-switcher-content');\n const inputRef = useRef<HTMLInputElement>(null);\n const { locale } = useLocale();\n const { availableLocales, selectedLocales, setSelectedLocales } =\n useLocaleSwitcherContent();\n\n // 1. Memoize the list construction so it doesn't rebuild every render\n const multilingualAvailableLocales: MultilingualAvailableLocales[] = useMemo(\n () =>\n availableLocales.map((localeEl) => {\n const englishName = getLocaleName(localeEl, Locales.ENGLISH);\n const currentLocaleName = getLocaleName(localeEl, locale);\n const ownLocaleName = getLocaleName(localeEl);\n return {\n locale: localeEl,\n englishName,\n currentLocaleName,\n ownLocaleName,\n };\n }),\n [availableLocales, locale]\n );\n\n // 2. State for Search Query only (Source of Truth)\n const [searchQuery, setSearchQuery] = useState('');\n\n const [seeAllLocales, setSeeAllLocales] = usePersistedStore(\n 'locale-content-selector-see-all-locales',\n false\n );\n\n // 3. Memoize Fuse instance\n const fuse = useMemo(() => {\n const fuseOptions: IFuseOptions<MultilingualAvailableLocales> = {\n keys: [\n { name: 'ownLocaleName', weight: 0.4 },\n { name: 'englishName', weight: 0.2 },\n { name: 'currentLocaleName', weight: 0.2 },\n { name: 'locale', weight: 0.2 },\n ],\n threshold: 0.02,\n };\n return new Fuse(multilingualAvailableLocales, fuseOptions);\n }, [multilingualAvailableLocales]);\n\n // 4. Derive results from Search Query\n const results = useMemo(() => {\n if (!searchQuery) {\n return multilingualAvailableLocales;\n }\n return fuse.search(searchQuery).map((result) => result.item);\n }, [searchQuery, multilingualAvailableLocales, fuse]);\n\n const handleClickLocale = (localeItem: LocalesValues) => {\n if (isMultilingual) {\n if (selectedLocales.includes(localeItem)) {\n if (selectedLocales.length > 1) {\n setSelectedLocales((prev) => prev.filter((el) => el !== localeItem));\n }\n } else {\n setSelectedLocales((prev) => [...prev, localeItem]);\n }\n } else {\n setSelectedLocales([localeItem]);\n }\n };\n\n const handleSeeAllLocales = (value: boolean) => {\n setSeeAllLocales(value);\n\n if (value) {\n setSelectedLocales(availableLocales);\n } else {\n setSelectedLocales([locale]);\n }\n };\n\n return (\n <div className=\"rounded-xl border border-text text-text transition-colors\">\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger\n identifier={DROPDOWN_IDENTIFIER}\n label={localeSwitcherLabel.value}\n className=\"p-0!\"\n roundedSize=\"3xl\"\n >\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"px-2 py-1\">\n <Globe size={16} />\n </div>\n <MoveVertical className=\"self-center\" size={16} />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n className=\"right-0 left-auto\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[60vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"xs\"\n border\n roundedSize=\"2xl\"\n borderColor=\"text\"\n aria-label={languageListLabel.value}\n >\n {isMultilingual && (\n <div className=\"m-auto p-2\">\n <SwitchSelector\n defaultValue={seeAllLocales} // Ensure this uses the persisted state\n onChange={handleSeeAllLocales}\n color={SwitchSelectorColor.TEXT}\n size={SwitchSelectorSize.SM}\n className=\"!w-60\"\n choices={[\n {\n content: seeAllLocalesSwitch.true.value,\n value: true,\n },\n {\n content: seeAllLocalesSwitch.false.value,\n value: false,\n },\n ]}\n />\n </div>\n )}\n\n {!(isMultilingual && seeAllLocales) && (\n <>\n <div className=\"p-3\">\n <Input\n type=\"search\"\n aria-label={searchInput.ariaLabel.value}\n placeholder={searchInput.placeholder.value}\n // Update search query state directly\n onChange={(e) => setSearchQuery(e.target.value)}\n ref={inputRef}\n />\n </div>\n <ol className=\"divide-y divide-dashed divide-text/20 overflow-y-auto p-1\">\n {results.map(\n ({\n locale: localeItem,\n currentLocaleName,\n ownLocaleName,\n }) => (\n <li className=\"px-1.5 py-1\" key={localeItem}>\n <Button\n onClick={() => handleClickLocale(localeItem)}\n label={`${switchTo} ${currentLocaleName}`}\n disabled={\n !(availableLocales ?? availableLocales).includes(\n localeItem\n )\n }\n isActive={selectedLocales.includes(localeItem)}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n isFullWidth\n textAlign={ButtonTextAlign.LEFT}\n size={ButtonSize.SM}\n >\n <div className=\"flex flex-row items-center justify-between gap-3 px-2 py-1\">\n {isMultilingual && (\n <div className=\"w-4\">\n {selectedLocales.includes(localeItem) && (\n <Check className=\"size-full\" />\n )}\n </div>\n )}\n <div className=\"flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1\">\n <div className=\"flex flex-col text-nowrap\">\n <span\n dir={getHTMLTextDir(localeItem)}\n lang={localeItem}\n >\n {ownLocaleName}\n </span>\n <span className=\"text-neutral text-xs\">\n {currentLocaleName}\n </span>\n </div>\n <span className=\"text-neutral text-sm\">\n {localeItem.toUpperCase()}\n </span>\n </div>\n </div>\n </Button>\n </li>\n )\n )}\n </ol>\n </>\n )}\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"LocaleSwitcherContent.mjs","names":[],"sources":["../../../../src/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.tsx"],"sourcesContent":["'use client';\n\nimport { usePersistedStore } from '@hooks/usePersistedStore';\nimport { getHTMLTextDir, getLocaleName } from '@intlayer/core/localization';\nimport * as Locales from '@intlayer/types/locales';\nimport type { LocalesValues } from '@intlayer/types/module_augmentation';\nimport Fuse, { type IFuseOptions } from 'fuse.js';\nimport { Check, Globe, MoveVertical } from 'lucide-react';\nimport { type FC, useMemo, useRef, useState } from 'react';\nimport { useIntlayer, useLocale } from 'react-intlayer';\nimport {\n Button,\n ButtonColor,\n ButtonSize,\n ButtonTextAlign,\n ButtonVariant,\n} from '../Button';\nimport { Container } from '../Container';\nimport { DropDown, type PanelProps } from '../DropDown';\nimport { Input } from '../Input';\nimport {\n SwitchSelector,\n SwitchSelectorColor,\n SwitchSelectorSize,\n} from '../SwitchSelector';\nimport { useLocaleSwitcherContent } from './LocaleSwitcherContentContext';\n\nexport type LocaleSwitcherContentProps = {\n panelProps?: Omit<PanelProps, 'identifier'>;\n isMultilingual?: boolean;\n};\n\nconst DROPDOWN_IDENTIFIER = 'locale-switcher-content';\n\ntype MultilingualAvailableLocales = {\n locale: LocalesValues;\n englishName: string;\n currentLocaleName: string;\n ownLocaleName: string;\n};\n\nexport const LocaleSwitcherContent: FC<LocaleSwitcherContentProps> = ({\n panelProps,\n isMultilingual = true,\n}) => {\n const {\n switchTo,\n searchInput,\n localeSwitcherLabel,\n languageListLabel,\n seeAllLocalesSwitch,\n } = useIntlayer('locale-switcher-content');\n const inputRef = useRef<HTMLInputElement>(null);\n const { locale } = useLocale();\n const { availableLocales, selectedLocales, setSelectedLocales } =\n useLocaleSwitcherContent();\n\n // 1. Memoize the list construction so it doesn't rebuild every render\n const multilingualAvailableLocales: MultilingualAvailableLocales[] = useMemo(\n () =>\n availableLocales.map((localeEl) => {\n const englishName = getLocaleName(localeEl, Locales.ENGLISH);\n const currentLocaleName = getLocaleName(localeEl, locale);\n const ownLocaleName = getLocaleName(localeEl);\n return {\n locale: localeEl,\n englishName,\n currentLocaleName,\n ownLocaleName,\n };\n }),\n [availableLocales, locale]\n );\n\n // 2. State for Search Query only (Source of Truth)\n const [searchQuery, setSearchQuery] = useState('');\n\n const [seeAllLocales, setSeeAllLocales] = usePersistedStore(\n 'locale-content-selector-see-all-locales',\n false\n );\n\n // 3. Memoize Fuse instance\n const fuse = useMemo(() => {\n const fuseOptions: IFuseOptions<MultilingualAvailableLocales> = {\n keys: [\n { name: 'ownLocaleName', weight: 0.4 },\n { name: 'englishName', weight: 0.2 },\n { name: 'currentLocaleName', weight: 0.2 },\n { name: 'locale', weight: 0.2 },\n ],\n threshold: 0.02,\n };\n return new Fuse(multilingualAvailableLocales, fuseOptions);\n }, [multilingualAvailableLocales]);\n\n // 4. Derive results from Search Query\n const results = useMemo(() => {\n if (!searchQuery) {\n return multilingualAvailableLocales;\n }\n return fuse.search(searchQuery).map((result) => result.item);\n }, [searchQuery, multilingualAvailableLocales, fuse]);\n\n const handleClickLocale = (localeItem: LocalesValues) => {\n if (isMultilingual) {\n if (selectedLocales.includes(localeItem)) {\n if (selectedLocales.length > 1) {\n setSelectedLocales((prev) => prev.filter((el) => el !== localeItem));\n }\n } else {\n setSelectedLocales((prev) => [...prev, localeItem]);\n }\n } else {\n setSelectedLocales([localeItem]);\n }\n };\n\n const handleSeeAllLocales = (value: boolean) => {\n setSeeAllLocales(value);\n\n if (value) {\n setSelectedLocales(availableLocales);\n } else {\n setSelectedLocales([locale]);\n }\n };\n\n return (\n <div className=\"rounded-xl border border-text text-text transition-colors\">\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger\n identifier={DROPDOWN_IDENTIFIER}\n label={localeSwitcherLabel.value}\n className=\"p-0!\"\n roundedSize=\"3xl\"\n color=\"text\"\n >\n <div className=\"flex w-full items-center justify-between text-text\">\n <div className=\"px-2 py-1\">\n <Globe size={16} />\n </div>\n <MoveVertical className=\"self-center\" size={16} />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n align=\"end\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[60vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"xs\"\n border\n roundedSize=\"3xl\"\n borderColor=\"text\"\n aria-label={languageListLabel.value}\n >\n {isMultilingual && (\n <div className=\"m-auto p-2\">\n <SwitchSelector\n defaultValue={seeAllLocales} // Ensure this uses the persisted state\n onChange={handleSeeAllLocales}\n color={SwitchSelectorColor.TEXT}\n size={SwitchSelectorSize.SM}\n className=\"!w-60\"\n choices={[\n {\n content: seeAllLocalesSwitch.true.value,\n value: true,\n },\n {\n content: seeAllLocalesSwitch.false.value,\n value: false,\n },\n ]}\n />\n </div>\n )}\n\n {!(isMultilingual && seeAllLocales) && (\n <>\n <div className=\"p-3\">\n <Input\n type=\"search\"\n aria-label={searchInput.ariaLabel.value}\n placeholder={searchInput.placeholder.value}\n // Update search query state directly\n onChange={(e) => setSearchQuery(e.target.value)}\n ref={inputRef}\n />\n </div>\n <ol className=\"divide-y divide-dashed divide-text/20 overflow-y-auto p-1\">\n {results.map(\n ({\n locale: localeItem,\n currentLocaleName,\n ownLocaleName,\n }) => (\n <li className=\"px-1.5 py-1\" key={localeItem}>\n <Button\n onClick={() => handleClickLocale(localeItem)}\n label={`${switchTo} ${currentLocaleName}`}\n disabled={\n !(availableLocales ?? availableLocales).includes(\n localeItem\n )\n }\n isActive={selectedLocales.includes(localeItem)}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n isFullWidth\n textAlign={ButtonTextAlign.LEFT}\n size={ButtonSize.SM}\n >\n <div className=\"flex flex-row items-center justify-between gap-3 px-2 py-1\">\n {isMultilingual && (\n <div className=\"w-4\">\n {selectedLocales.includes(localeItem) && (\n <Check className=\"size-full\" />\n )}\n </div>\n )}\n <div className=\"flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1\">\n <div className=\"flex flex-col text-nowrap\">\n <span\n dir={getHTMLTextDir(localeItem)}\n lang={localeItem}\n >\n {ownLocaleName}\n </span>\n <span className=\"text-neutral text-xs\">\n {currentLocaleName}\n </span>\n </div>\n <span className=\"text-neutral text-sm\">\n {localeItem.toUpperCase()}\n </span>\n </div>\n </div>\n </Button>\n </li>\n )\n )}\n </ol>\n </>\n )}\n </Container>\n </DropDown.Panel>\n </DropDown>\n </div>\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{Container as e}from"../Container/index.mjs";import{Button as t,ButtonColor as n,ButtonTextAlign as r,ButtonVariant as i}from"../Button/Button.mjs";import{Input as a}from"../Input/Input.mjs";import{DropDown as o}from"../DropDown/index.mjs";import{useCallback as s,useMemo as c,useRef as l,useState as u}from"react";import{MoveVertical as d}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useIntlayer as m}from"react-intlayer";import{getHTMLTextDir as h,getLocaleName as g}from"@intlayer/core/localization";import*as _ from"@intlayer/types/locales";import v from"fuse.js";const y=`locale-switcher`,b=({locale:b,localeList:x,availableLocales:S,fullLocaleName:C=!0,setLocale:w,panelProps:T})=>{let E=`Select a locale`,{switchTo:D,searchInput:O,languageListLabel:k,localeSwitcherLabel:A}=m(`locale-switcher`),j=l(null),M=c(()=>x.map(e=>({locale:e,englishName:g(e,_.ENGLISH),currentLocaleName:g(e,b),ownLocaleName:g(e)})),[x,b]),[N,P]=u(M),F=c(()=>new v(M,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[M]),I=s(e=>{P(e?F.search(e).map(e=>e.item):M)},[F,M]);return b&&(E=C?g(b):b.toUpperCase()),f(`nav`,{className:`rounded-xl border border-text
|
|
1
|
+
"use client";import{Container as e}from"../Container/index.mjs";import{Button as t,ButtonColor as n,ButtonTextAlign as r,ButtonVariant as i}from"../Button/Button.mjs";import{Input as a}from"../Input/Input.mjs";import{DropDown as o}from"../DropDown/index.mjs";import{useCallback as s,useMemo as c,useRef as l,useState as u}from"react";import{MoveVertical as d}from"lucide-react";import{jsx as f,jsxs as p}from"react/jsx-runtime";import{useIntlayer as m}from"react-intlayer";import{getHTMLTextDir as h,getLocaleName as g}from"@intlayer/core/localization";import*as _ from"@intlayer/types/locales";import v from"fuse.js";const y=`locale-switcher`,b=({locale:b,localeList:x,availableLocales:S,fullLocaleName:C=!0,setLocale:w,panelProps:T})=>{let E=`Select a locale`,{switchTo:D,searchInput:O,languageListLabel:k,localeSwitcherLabel:A}=m(`locale-switcher`),j=l(null),M=c(()=>x.map(e=>({locale:e,englishName:g(e,_.ENGLISH),currentLocaleName:g(e,b),ownLocaleName:g(e)})),[x,b]),[N,P]=u(M),F=c(()=>new v(M,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[M]),I=s(e=>{P(e?F.search(e).map(e=>e.item):M)},[F,M]);return b&&(E=C?g(b):b.toUpperCase()),f(`nav`,{className:`rounded-xl border border-text`,"aria-label":A.value,children:p(o,{identifier:y,children:[f(o.Trigger,{identifier:y,color:`text`,children:p(`div`,{className:`flex w-full items-center justify-between`,children:[f(`div`,{className:`text-nowrap px-2`,children:E}),f(d,{className:`w-5 self-center`})]})}),f(o.Panel,{identifier:y,isOverable:!0,isFocusable:!0,align:`end`,...T,children:p(e,{className:`max-h-[80vh] min-w-28`,separator:`y`,role:`listbox`,transparency:`xs`,"aria-label":k.value,children:[f(`div`,{className:`p-3`,children:f(a,{type:`search`,"aria-label":O.ariaLabel.value,placeholder:O.placeholder.value,onChange:e=>I(e.target.value),ref:j})}),f(`ol`,{className:`divide-y divide-dashed divide-text/20 overflow-y-auto p-1`,children:N.map(({locale:e,currentLocaleName:a,ownLocaleName:o})=>f(`li`,{className:`px-1.5 py-1`,children:f(t,{onClick:()=>w(e),label:`${D} ${a}`,disabled:!(S??x).includes(e),isActive:b===e,variant:i.HOVERABLE,color:n.TEXT,isFullWidth:!0,textAlign:r.LEFT,children:p(`div`,{className:`flex flex-row items-center justify-between gap-3 px-2 py-1`,children:[p(`div`,{className:`flex flex-col text-nowrap`,children:[f(`span`,{dir:h(e),lang:e,suppressHydrationWarning:!0,children:o}),f(`span`,{className:`text-neutral text-xs`,suppressHydrationWarning:!0,children:a})]}),f(`span`,{className:`text-neutral text-sm`,children:e.toUpperCase()})]})})},e))})]})})]})})};export{b as LocaleSwitcher};
|
|
2
2
|
//# sourceMappingURL=LocaleSwitcher.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LocaleSwitcher.mjs","names":[],"sources":["../../../../src/components/LocaleSwitcherDropDown/LocaleSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { getHTMLTextDir, getLocaleName } from '@intlayer/core/localization';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport * as Locales from '@intlayer/types/locales';\nimport Fuse, { type IFuseOptions } from 'fuse.js';\nimport { MoveVertical } from 'lucide-react';\nimport { type FC, useCallback, useMemo, useRef, useState } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Button, ButtonColor, ButtonTextAlign, ButtonVariant } from '../Button';\nimport { Container } from '../Container';\nimport { DropDown, type PanelProps } from '../DropDown';\nimport { Input } from '../Input';\n\nexport type LocaleSwitcherProps = {\n locale?: Locale;\n localeList: Locale[];\n availableLocales?: Locale[];\n fullLocaleName?: boolean;\n setLocale: (locale: Locale) => void;\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'locale-switcher';\n\ntype MultilingualAvailableLocales = {\n locale: Locale;\n englishName: string;\n currentLocaleName: string;\n ownLocaleName: string;\n};\n\nexport const LocaleSwitcher: FC<LocaleSwitcherProps> = ({\n locale,\n localeList,\n availableLocales,\n fullLocaleName = true,\n setLocale,\n panelProps,\n}) => {\n let localeName = 'Select a locale';\n const { switchTo, searchInput, languageListLabel, localeSwitcherLabel } =\n useIntlayer('locale-switcher');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const multilingualAvailableLocales: MultilingualAvailableLocales[] = useMemo(\n () =>\n localeList.map((localeEl) => {\n const englishName = getLocaleName(localeEl, Locales.ENGLISH);\n const currentLocaleName = getLocaleName(localeEl, locale);\n const ownLocaleName = getLocaleName(localeEl);\n return {\n locale: localeEl,\n englishName,\n currentLocaleName,\n ownLocaleName,\n };\n }),\n [localeList, locale]\n );\n\n const [results, setResults] = useState<MultilingualAvailableLocales[]>(\n multilingualAvailableLocales\n );\n\n // Create a new Fuse instance with the options and documentation data\n const fuse = useMemo(() => {\n const fuseOptions: IFuseOptions<MultilingualAvailableLocales> = {\n keys: [\n { name: 'ownLocaleName', weight: 0.4 },\n { name: 'englishName', weight: 0.2 },\n { name: 'currentLocaleName', weight: 0.2 },\n { name: 'locale', weight: 0.2 },\n ],\n threshold: 0.02, // Defines how fuzzy the matching should be (lower is more strict)\n };\n\n return new Fuse(multilingualAvailableLocales, fuseOptions);\n }, [multilingualAvailableLocales]);\n\n const handleSearch = useCallback(\n (searchQuery: string) => {\n if (searchQuery) {\n // Perform search on every input change\n const searchResults = fuse\n .search(searchQuery)\n .map((result) => result.item);\n setResults(searchResults);\n } else {\n setResults(multilingualAvailableLocales);\n }\n },\n [fuse, multilingualAvailableLocales]\n );\n\n if (locale) {\n localeName = fullLocaleName ? getLocaleName(locale) : locale.toUpperCase();\n }\n\n return (\n <nav\n className=\"rounded-xl border border-text
|
|
1
|
+
{"version":3,"file":"LocaleSwitcher.mjs","names":[],"sources":["../../../../src/components/LocaleSwitcherDropDown/LocaleSwitcher.tsx"],"sourcesContent":["'use client';\n\nimport { getHTMLTextDir, getLocaleName } from '@intlayer/core/localization';\nimport type { Locale } from '@intlayer/types/allLocales';\nimport * as Locales from '@intlayer/types/locales';\nimport Fuse, { type IFuseOptions } from 'fuse.js';\nimport { MoveVertical } from 'lucide-react';\nimport { type FC, useCallback, useMemo, useRef, useState } from 'react';\nimport { useIntlayer } from 'react-intlayer';\nimport { Button, ButtonColor, ButtonTextAlign, ButtonVariant } from '../Button';\nimport { Container } from '../Container';\nimport { DropDown, type PanelProps } from '../DropDown';\nimport { Input } from '../Input';\n\nexport type LocaleSwitcherProps = {\n locale?: Locale;\n localeList: Locale[];\n availableLocales?: Locale[];\n fullLocaleName?: boolean;\n setLocale: (locale: Locale) => void;\n panelProps?: Omit<PanelProps, 'identifier'>;\n};\n\nconst DROPDOWN_IDENTIFIER = 'locale-switcher';\n\ntype MultilingualAvailableLocales = {\n locale: Locale;\n englishName: string;\n currentLocaleName: string;\n ownLocaleName: string;\n};\n\nexport const LocaleSwitcher: FC<LocaleSwitcherProps> = ({\n locale,\n localeList,\n availableLocales,\n fullLocaleName = true,\n setLocale,\n panelProps,\n}) => {\n let localeName = 'Select a locale';\n const { switchTo, searchInput, languageListLabel, localeSwitcherLabel } =\n useIntlayer('locale-switcher');\n const inputRef = useRef<HTMLInputElement>(null);\n\n const multilingualAvailableLocales: MultilingualAvailableLocales[] = useMemo(\n () =>\n localeList.map((localeEl) => {\n const englishName = getLocaleName(localeEl, Locales.ENGLISH);\n const currentLocaleName = getLocaleName(localeEl, locale);\n const ownLocaleName = getLocaleName(localeEl);\n return {\n locale: localeEl,\n englishName,\n currentLocaleName,\n ownLocaleName,\n };\n }),\n [localeList, locale]\n );\n\n const [results, setResults] = useState<MultilingualAvailableLocales[]>(\n multilingualAvailableLocales\n );\n\n // Create a new Fuse instance with the options and documentation data\n const fuse = useMemo(() => {\n const fuseOptions: IFuseOptions<MultilingualAvailableLocales> = {\n keys: [\n { name: 'ownLocaleName', weight: 0.4 },\n { name: 'englishName', weight: 0.2 },\n { name: 'currentLocaleName', weight: 0.2 },\n { name: 'locale', weight: 0.2 },\n ],\n threshold: 0.02, // Defines how fuzzy the matching should be (lower is more strict)\n };\n\n return new Fuse(multilingualAvailableLocales, fuseOptions);\n }, [multilingualAvailableLocales]);\n\n const handleSearch = useCallback(\n (searchQuery: string) => {\n if (searchQuery) {\n // Perform search on every input change\n const searchResults = fuse\n .search(searchQuery)\n .map((result) => result.item);\n setResults(searchResults);\n } else {\n setResults(multilingualAvailableLocales);\n }\n },\n [fuse, multilingualAvailableLocales]\n );\n\n if (locale) {\n localeName = fullLocaleName ? getLocaleName(locale) : locale.toUpperCase();\n }\n\n return (\n <nav\n className=\"rounded-xl border border-text\"\n aria-label={localeSwitcherLabel.value}\n >\n <DropDown identifier={DROPDOWN_IDENTIFIER}>\n <DropDown.Trigger identifier={DROPDOWN_IDENTIFIER} color=\"text\">\n <div className=\"flex w-full items-center justify-between\">\n <div className=\"text-nowrap px-2\">{localeName}</div>\n <MoveVertical className=\"w-5 self-center\" />\n </div>\n </DropDown.Trigger>\n\n <DropDown.Panel\n identifier={DROPDOWN_IDENTIFIER}\n isOverable\n isFocusable\n align=\"end\"\n {...panelProps}\n >\n <Container\n className=\"max-h-[80vh] min-w-28\"\n separator=\"y\"\n role=\"listbox\"\n transparency=\"xs\"\n aria-label={languageListLabel.value}\n >\n <div className=\"p-3\">\n <Input\n type=\"search\"\n aria-label={searchInput.ariaLabel.value}\n placeholder={searchInput.placeholder.value}\n onChange={(e) => handleSearch(e.target.value)}\n ref={inputRef}\n />\n </div>\n <ol className=\"divide-y divide-dashed divide-text/20 overflow-y-auto p-1\">\n {results.map(\n ({ locale: localeItem, currentLocaleName, ownLocaleName }) => (\n <li className=\"px-1.5 py-1\" key={localeItem}>\n <Button\n onClick={() => setLocale(localeItem)}\n label={`${switchTo} ${currentLocaleName}`}\n disabled={\n !(availableLocales ?? localeList).includes(localeItem)\n }\n isActive={locale === localeItem}\n variant={ButtonVariant.HOVERABLE}\n color={ButtonColor.TEXT}\n isFullWidth\n textAlign={ButtonTextAlign.LEFT}\n >\n <div className=\"flex flex-row items-center justify-between gap-3 px-2 py-1\">\n <div className=\"flex flex-col text-nowrap\">\n <span\n dir={getHTMLTextDir(localeItem)}\n lang={localeItem}\n suppressHydrationWarning\n >\n {ownLocaleName}\n </span>\n <span\n className=\"text-neutral text-xs\"\n suppressHydrationWarning\n >\n {currentLocaleName}\n </span>\n </div>\n <span className=\"text-neutral text-sm\">\n {localeItem.toUpperCase()}\n </span>\n </div>\n </Button>\n </li>\n )\n )}\n </ol>\n </Container>\n </DropDown.Panel>\n </DropDown>\n </nav>\n );\n};\n"],"mappings":"0mBAuBA,MAAM,EAAsB,kBASf,GAA2C,CACtD,SACA,aACA,mBACA,iBAAiB,GACjB,YACA,gBACI,CACJ,IAAI,EAAa,kBACX,CAAE,WAAU,cAAa,oBAAmB,uBAChD,EAAY,kBAAkB,CAC1B,EAAW,EAAyB,KAAK,CAEzC,EAA+D,MAEjE,EAAW,IAAK,IAIP,CACL,OAAQ,EACR,YALkB,EAAc,EAAU,EAAQ,QAAQ,CAM1D,kBALwB,EAAc,EAAU,EAAO,CAMvD,cALoB,EAAc,EAAS,CAM5C,EACD,CACJ,CAAC,EAAY,EAAO,CACrB,CAEK,CAAC,EAAS,GAAc,EAC5B,EACD,CAGK,EAAO,MAWJ,IAAI,EAAK,EAVgD,CAC9D,KAAM,CACJ,CAAE,KAAM,gBAAiB,OAAQ,GAAK,CACtC,CAAE,KAAM,cAAe,OAAQ,GAAK,CACpC,CAAE,KAAM,oBAAqB,OAAQ,GAAK,CAC1C,CAAE,KAAM,SAAU,OAAQ,GAAK,CAChC,CACD,UAAW,IACZ,CAEyD,CACzD,CAAC,EAA6B,CAAC,CAE5B,EAAe,EAClB,GAAwB,CAMrB,EALE,EAEoB,EACnB,OAAO,EAAY,CACnB,IAAK,GAAW,EAAO,KAAK,CAGpB,EAA6B,EAG5C,CAAC,EAAM,EAA6B,CACrC,CAMD,OAJI,IACF,EAAa,EAAiB,EAAc,EAAO,CAAG,EAAO,aAAa,EAI1E,EAAC,MAAD,CACE,UAAU,gCACV,aAAY,EAAoB,eAEhC,EAAC,EAAD,CAAU,WAAY,WAAtB,CACE,EAAC,EAAS,QAAV,CAAkB,WAAY,EAAqB,MAAM,gBACvD,EAAC,MAAD,CAAK,UAAU,oDAAf,CACE,EAAC,MAAD,CAAK,UAAU,4BAAoB,EAAiB,CAAA,CACpD,EAAC,EAAD,CAAc,UAAU,kBAAoB,CAAA,CACxC,GACW,CAAA,CAEnB,EAAC,EAAS,MAAV,CACE,WAAY,EACZ,WAAA,GACA,YAAA,GACA,MAAM,MACN,GAAI,WAEJ,EAAC,EAAD,CACE,UAAU,wBACV,UAAU,IACV,KAAK,UACL,aAAa,KACb,aAAY,EAAkB,eALhC,CAOE,EAAC,MAAD,CAAK,UAAU,eACb,EAAC,EAAD,CACE,KAAK,SACL,aAAY,EAAY,UAAU,MAClC,YAAa,EAAY,YAAY,MACrC,SAAW,GAAM,EAAa,EAAE,OAAO,MAAM,CAC7C,IAAK,EACL,CAAA,CACE,CAAA,CACN,EAAC,KAAD,CAAI,UAAU,qEACX,EAAQ,KACN,CAAE,OAAQ,EAAY,oBAAmB,mBACxC,EAAC,KAAD,CAAI,UAAU,uBACZ,EAAC,EAAD,CACE,YAAe,EAAU,EAAW,CACpC,MAAO,GAAG,EAAS,GAAG,IACtB,SACE,EAAE,GAAoB,GAAY,SAAS,EAAW,CAExD,SAAU,IAAW,EACrB,QAAS,EAAc,UACvB,MAAO,EAAY,KACnB,YAAA,GACA,UAAW,EAAgB,cAE3B,EAAC,MAAD,CAAK,UAAU,sEAAf,CACE,EAAC,MAAD,CAAK,UAAU,qCAAf,CACE,EAAC,OAAD,CACE,IAAK,EAAe,EAAW,CAC/B,KAAM,EACN,yBAAA,YAEC,EACI,CAAA,CACP,EAAC,OAAD,CACE,UAAU,uBACV,yBAAA,YAEC,EACI,CAAA,CACH,GACN,EAAC,OAAD,CAAM,UAAU,gCACb,EAAW,aAAa,CACpB,CAAA,CACH,GACC,CAAA,CACN,CAlC4B,EAkC5B,CAER,CACE,CAAA,CACK,GACG,CAAA,CACR,GACP,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{cn as e}from"../../utils/cn.mjs";import{jsx as t}from"react/jsx-runtime";const n=({children:n,isHidden:r,className:i=``,isOverable:a=!1,isFocusable:o=!1,minHeight:s=0
|
|
1
|
+
import{cn as e}from"../../utils/cn.mjs";import{jsx as t}from"react/jsx-runtime";const n=({children:n,isHidden:r,className:i=``,isOverable:a=!1,isFocusable:o=!1,minHeight:s=0,...c})=>t(`div`,{"aria-hidden":o?r:void 0,tabIndex:o?0:void 0,role:o?`button`:`none`,className:e(`group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out`,r!==void 0&&!r&&`grid-rows-[1fr] overflow-x-auto`,a&&`hover:grid-rows-[1fr] hover:overflow-x-auto`,o&&`focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto`,i),...c,children:t(`div`,{style:{minHeight:`${s}px`},className:e(a&&`group-hover/height-smoother:visible`,o&&`group-focus/height-smoother:visible`,i),children:n})});export{n as MaxHeightSmoother};
|
|
2
2
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport type { CSSProperties, FC, HTMLAttributes, ReactNode } from 'react';\n\n/**\n * Props for the MaxHeightSmoother component\n */\ninterface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {\n /** Content to render within the smoother container */\n children: ReactNode;\n /** Controls collapse state. When true, content is collapsed; when false, expanded; when undefined, relies on hover/focus behavior */\n isHidden?: boolean;\n /** Enable expand-on-hover behavior */\n isOverable?: boolean;\n /** Enable expand-on-focus behavior for accessibility and keyboard navigation */\n isFocusable?: boolean;\n /** Minimum height in pixels for the collapsed state */\n minHeight?: number;\n}\n\n/**\n * MaxHeightSmoother Component\n *\n * A sophisticated container component that provides smooth height transitions\n * for collapsible content. Implemented entirely in CSS — no client-side\n * JavaScript, hooks, or event listeners — making it compatible with React\n * Server Components and Next.js App Router without `'use client'`.\n *\n * @component\n * @example\n * Basic controlled usage:\n * ```tsx\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <MaxHeightSmoother isHidden={isCollapsed}>\n * <div>Your collapsible content here</div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Hover-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isOverable>\n * <p>This content expands when you hover over the container.</p>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Focus-triggered expansion (keyboard accessible):\n * ```tsx\n * <MaxHeightSmoother isFocusable>\n * <p>Tab to focus this container to expand the content.</p>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * With minimum height for preview:\n * ```tsx\n * <MaxHeightSmoother isOverable minHeight={100} className=\"border rounded-lg p-4\">\n * <h3>Article Preview</h3>\n * <p>This shows a preview of the content. Hover to see all.</p>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Combined hover and focus:\n * ```tsx\n * <MaxHeightSmoother isOverable isFocusable minHeight={80}>\n * <h4>Interactive Card</h4>\n * <p>Expands on both hover and keyboard focus.</p>\n * </MaxHeightSmoother>\n * ```\n *\n * ## Animation Strategies\n *\n * ### Strategy A — `grid-template-rows` (`minHeight === 0`)\n * Transitions between `grid-rows-[0fr]` and `grid-rows-[1fr]`.\n * Clean and performant; no fixed height ceiling required.\n * Requires `min-h-0` on the inner wrapper so the grid track can fully collapse.\n *\n * ### Strategy B — `max-height` via CSS custom properties (`minHeight > 0`)\n * When a visible preview floor is required, `grid-template-rows` produces a\n * \"dead time\" artifact: the track silently grows from 0 → minHeight before\n * anything visible happens, resulting in a perceived snap.\n *\n * `max-height` sidesteps this entirely — the transition starts from the\n * already-visible floor value, producing a single continuous expansion.\n *\n * The collapsed floor (`--mhs-collapsed`) and expanded ceiling\n * (`--mhs-expanded`) are injected as CSS variables via inline style,\n * NOT as `max-height` directly. This lets Tailwind own `max-height`\n * entirely, so `:hover` and `:focus-within` can override it freely\n * without fighting inline-style specificity.\n *\n * Both variables are consumer-overridable via CSS:\n * ```css\n * .my-container {\n * --mhs-collapsed: 80px;\n * --mhs-expanded: 1200px;\n * }\n * ```\n *\n * Trade-off: easing is applied over [minHeight → 3000px], not the real\n * content height. For typical content this is imperceptible. If pixel-perfect\n * easing is critical, use a JS-measured height with a controlled `isHidden`\n * prop and a `style={{ maxHeight }}` override instead.\n *\n * ## Interaction Modes\n *\n * 1. **Controlled** — Pass `isHidden` for external state control (e.g. accordion)\n * 2. **Hover** — Set `isOverable` for mouse hover expansion\n * 3. **Focus** — Set `isFocusable` for keyboard focus expansion\n * 4. **Combined** — Use `isOverable` and `isFocusable` together\n *\n * ## Accessibility\n *\n * - `role=\"button\"` and `tabIndex={0}` when `isFocusable` is true\n * - `aria-expanded` reflects the current disclosure state\n * - Focus expansion via `:focus-within` CSS pseudo-class\n * - `motion-reduce:transition-none` respects `prefers-reduced-motion`\n *\n * Note: because this component relies on CSS pseudo-classes for interaction,\n * keyboard toggle (Enter / Space) is not supported in uncontrolled mode.\n * For full keyboard toggle behaviour, manage `isHidden` externally and\n * wire an `onClick` / `onKeyDown` handler on the parent.\n *\n * ## Performance\n *\n * - Pure CSS animations — no JavaScript timers or DOM measurements\n * - No `'use client'` directive required\n * - Compatible with React Server Components and Next.js App Router\n * - GPU-accelerated transitions\n *\n * @param props - Component props extending HTML div attributes\n * @param props.children - Content to render within the container\n * @param props.isHidden - Controlled collapse state (`true` = collapsed, `false` = expanded)\n * @param props.isOverable - Enable hover-to-expand behaviour\n * @param props.isFocusable - Enable focus-to-expand behaviour with keyboard navigation\n * @param props.minHeight - Minimum height in pixels for the collapsed state (default: 0)\n * @param props.className - Additional CSS classes\n * @param props.style - Inline styles (CSS variable overrides will be merged)\n *\n * @returns A smooth height-transitioning container with configurable interaction modes\n */\nexport const MaxHeightSmoother: FC<MaxHeightSmootherProps> = ({\n children,\n isHidden,\n className = '',\n isOverable = false,\n isFocusable = false,\n minHeight = 0,\n
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../../../src/components/MaxHeightSmoother/index.tsx"],"sourcesContent":["import { cn } from '@utils/cn';\nimport type { CSSProperties, FC, HTMLAttributes, ReactNode } from 'react';\n\n/**\n * Props for the MaxHeightSmoother component\n */\ninterface MaxHeightSmootherProps extends HTMLAttributes<HTMLDivElement> {\n /** Content to render within the smoother container */\n children: ReactNode;\n /** Controls collapse state. When true, content is collapsed; when false, expanded; when undefined, relies on hover/focus behavior */\n isHidden?: boolean;\n /** Enable expand-on-hover behavior */\n isOverable?: boolean;\n /** Enable expand-on-focus behavior for accessibility and keyboard navigation */\n isFocusable?: boolean;\n /** Minimum height in pixels for the collapsed state */\n minHeight?: number;\n}\n\n/**\n * MaxHeightSmoother Component\n *\n * A sophisticated container component that provides smooth height transitions\n * for collapsible content. Implemented entirely in CSS — no client-side\n * JavaScript, hooks, or event listeners — making it compatible with React\n * Server Components and Next.js App Router without `'use client'`.\n *\n * @component\n * @example\n * Basic controlled usage:\n * ```tsx\n * const [isCollapsed, setIsCollapsed] = useState(true);\n *\n * <MaxHeightSmoother isHidden={isCollapsed}>\n * <div>Your collapsible content here</div>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Hover-triggered expansion:\n * ```tsx\n * <MaxHeightSmoother isOverable>\n * <p>This content expands when you hover over the container.</p>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Focus-triggered expansion (keyboard accessible):\n * ```tsx\n * <MaxHeightSmoother isFocusable>\n * <p>Tab to focus this container to expand the content.</p>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * With minimum height for preview:\n * ```tsx\n * <MaxHeightSmoother isOverable minHeight={100} className=\"border rounded-lg p-4\">\n * <h3>Article Preview</h3>\n * <p>This shows a preview of the content. Hover to see all.</p>\n * </MaxHeightSmoother>\n * ```\n *\n * @example\n * Combined hover and focus:\n * ```tsx\n * <MaxHeightSmoother isOverable isFocusable minHeight={80}>\n * <h4>Interactive Card</h4>\n * <p>Expands on both hover and keyboard focus.</p>\n * </MaxHeightSmoother>\n * ```\n *\n * ## Animation Strategies\n *\n * ### Strategy A — `grid-template-rows` (`minHeight === 0`)\n * Transitions between `grid-rows-[0fr]` and `grid-rows-[1fr]`.\n * Clean and performant; no fixed height ceiling required.\n * Requires `min-h-0` on the inner wrapper so the grid track can fully collapse.\n *\n * ### Strategy B — `max-height` via CSS custom properties (`minHeight > 0`)\n * When a visible preview floor is required, `grid-template-rows` produces a\n * \"dead time\" artifact: the track silently grows from 0 → minHeight before\n * anything visible happens, resulting in a perceived snap.\n *\n * `max-height` sidesteps this entirely — the transition starts from the\n * already-visible floor value, producing a single continuous expansion.\n *\n * The collapsed floor (`--mhs-collapsed`) and expanded ceiling\n * (`--mhs-expanded`) are injected as CSS variables via inline style,\n * NOT as `max-height` directly. This lets Tailwind own `max-height`\n * entirely, so `:hover` and `:focus-within` can override it freely\n * without fighting inline-style specificity.\n *\n * Both variables are consumer-overridable via CSS:\n * ```css\n * .my-container {\n * --mhs-collapsed: 80px;\n * --mhs-expanded: 1200px;\n * }\n * ```\n *\n * Trade-off: easing is applied over [minHeight → 3000px], not the real\n * content height. For typical content this is imperceptible. If pixel-perfect\n * easing is critical, use a JS-measured height with a controlled `isHidden`\n * prop and a `style={{ maxHeight }}` override instead.\n *\n * ## Interaction Modes\n *\n * 1. **Controlled** — Pass `isHidden` for external state control (e.g. accordion)\n * 2. **Hover** — Set `isOverable` for mouse hover expansion\n * 3. **Focus** — Set `isFocusable` for keyboard focus expansion\n * 4. **Combined** — Use `isOverable` and `isFocusable` together\n *\n * ## Accessibility\n *\n * - `role=\"button\"` and `tabIndex={0}` when `isFocusable` is true\n * - `aria-expanded` reflects the current disclosure state\n * - Focus expansion via `:focus-within` CSS pseudo-class\n * - `motion-reduce:transition-none` respects `prefers-reduced-motion`\n *\n * Note: because this component relies on CSS pseudo-classes for interaction,\n * keyboard toggle (Enter / Space) is not supported in uncontrolled mode.\n * For full keyboard toggle behaviour, manage `isHidden` externally and\n * wire an `onClick` / `onKeyDown` handler on the parent.\n *\n * ## Performance\n *\n * - Pure CSS animations — no JavaScript timers or DOM measurements\n * - No `'use client'` directive required\n * - Compatible with React Server Components and Next.js App Router\n * - GPU-accelerated transitions\n *\n * @param props - Component props extending HTML div attributes\n * @param props.children - Content to render within the container\n * @param props.isHidden - Controlled collapse state (`true` = collapsed, `false` = expanded)\n * @param props.isOverable - Enable hover-to-expand behaviour\n * @param props.isFocusable - Enable focus-to-expand behaviour with keyboard navigation\n * @param props.minHeight - Minimum height in pixels for the collapsed state (default: 0)\n * @param props.className - Additional CSS classes\n * @param props.style - Inline styles (CSS variable overrides will be merged)\n *\n * @returns A smooth height-transitioning container with configurable interaction modes\n */\nexport const MaxHeightSmoother: FC<MaxHeightSmootherProps> = ({\n children,\n isHidden,\n className = '',\n isOverable = false,\n isFocusable = false,\n minHeight = 0,\n ...props\n}) => (\n <div\n aria-hidden={isFocusable ? isHidden : undefined}\n tabIndex={isFocusable ? 0 : undefined}\n role={isFocusable ? 'button' : 'none'}\n className={cn(\n 'group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out',\n typeof isHidden !== 'undefined' &&\n !isHidden &&\n 'grid-rows-[1fr] overflow-x-auto',\n isOverable && 'hover:grid-rows-[1fr] hover:overflow-x-auto',\n isFocusable &&\n 'focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto',\n className\n )}\n {...props}\n >\n <div\n style={{\n minHeight: `${minHeight}px`,\n }}\n className={cn(\n isOverable && 'group-hover/height-smoother:visible',\n isFocusable && 'group-focus/height-smoother:visible',\n className\n )}\n >\n {children}\n </div>\n </div>\n);\n"],"mappings":"gFA+IA,MAAa,GAAiD,CAC5D,WACA,WACA,YAAY,GACZ,aAAa,GACb,cAAc,GACd,YAAY,EACZ,GAAG,KAEH,EAAC,MAAD,CACE,cAAa,EAAc,EAAW,IAAA,GACtC,SAAU,EAAc,EAAI,IAAA,GAC5B,KAAM,EAAc,SAAW,OAC/B,UAAW,EACT,qHACO,IAAa,QAClB,CAAC,GACD,kCACF,GAAc,8CACd,GACE,wGACF,EACD,CACD,GAAI,WAEJ,EAAC,MAAD,CACE,MAAO,CACL,UAAW,GAAG,EAAU,IACzB,CACD,UAAW,EACT,GAAc,sCACd,GAAe,sCACf,EACD,CAEA,WACG,CAAA,CACF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Toast as e,ToastAction as t,ToastClose as n,ToastDescription as r,ToastProvider as i,ToastTitle as a,ToastViewport as o}from"./Toaster/Toast.mjs";import{reducer as s,toast as c,useToast as l}from"./Toaster/useToast.mjs";import{Toaster as u}from"./Toaster/Toaster.mjs";import{Container as d,ContainerBackground as f,ContainerBorderColor as p,ContainerGap as m,ContainerPadding as h,ContainerRoundedSize as g,ContainerSeparator as _,ContainerTransparency as v,containerVariants as y}from"./Container/index.mjs";import{Loader as b}from"./Loader/index.mjs";import{Button as x,ButtonColor as S,ButtonSize as C,ButtonTextAlign as w,ButtonVariant as T,buttonVariants as E}from"./Button/Button.mjs";import{MaxHeightSmoother as D}from"./MaxHeightSmoother/index.mjs";import{Accordion as O}from"./Accordion/Accordion.mjs";import{Avatar as k,getCapitals as A}from"./Avatar/index.mjs";import{Badge as j,BadgeColor as M,BadgeSize as N,BadgeVariant as P,badgeVariants as F}from"./Badge/index.mjs";import{Link as I,LinkColor as L,LinkRoundedSize as R,LinkSize as z,LinkUnderlined as B,LinkVariant as V,checkIsExternalLink as H,isTextChildren as U,linkVariants as W}from"./Link/Link.mjs";import{Breadcrumb as G}from"./Breadcrumb/index.mjs";import{Checkbox as K,CheckboxColor as q,CheckboxSize as J,checkboxVariants as Y}from"./Input/Checkbox.mjs";import{Input as X,InputSize as Z,InputVariant as Q,inputVariants as $}from"./Input/Input.mjs";import{InputPassword as ee}from"./Input/InputPassword.mjs";import{InputIndicator as te,InputOTP as ne,InputOTPGroup as re,InputOTPSeparator as ie,InputOTPSlot as ae,OTPInput as oe,OTPInputContext as se,inputSlotVariants as ce,usePasswordManagerBadge as le,usePrevious as ue}from"./Input/OTPInput.mjs";import{SearchInput as de}from"./Input/SearchInput.mjs";import{Browser as fe}from"./Browser/Browser.mjs";import{KeyList as pe,KeyboardShortcut as me}from"./KeyboardShortcut/KeyboardShortcut.mjs";import{Detail as he,PopoverStatic as ge,PopoverXAlign as _e,PopoverYAlign as ve}from"./Popover/static.mjs";import{Popover as ye}from"./Popover/dynamic.mjs";import{Carousel as be}from"./Carousel/index.mjs";import{ClickOutsideDiv as xe}from"./ClickOutsideDiv/index.mjs";import{CollapsibleTable as Se}from"./CollapsibleTable/CollapsibleTable.mjs";import{Command as Ce,CommandRoot as we}from"./Command/index.mjs";import{PressableSpan as Te}from"./PressableSpan/PressableSpan.mjs";import{ContentSelector as Ee}from"./ContentSelector/ContentSelector.mjs";import{CopyButton as De}from"./CopyButton/index.mjs";import{CopyToClipboard as Oe,useCopyToClipboard as ke}from"./CopyToClipboard/index.mjs";import{EditableFieldInput as Ae}from"./EditableField/EditableFieldInput.mjs";import{TextArea as je}from"./TextArea/TextArea.mjs";import{AutoSizedTextArea as Me}from"./TextArea/AutoSizeTextArea.mjs";import{AutoCompleteTextarea as Ne,useDebounce as Pe}from"./TextArea/AutocompleteTextArea.mjs";import{EditableFieldTextArea as Fe}from"./EditableField/EditableFieldTextArea.mjs";import{DictionaryEditor as Ie}from"./DictionaryEditor/DictionaryEditor.mjs";import{DropDown as Le,DropDownAlign as Re,DropDownYAlign as ze}from"./DropDown/index.mjs";import{SwitchSelector as Be,SwitchSelectorColor as Ve,SwitchSelectorSize as He}from"./SwitchSelector/index.mjs";import{LocaleSwitcherContentProvider as Ue,useLocaleSwitcherContent as We}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{LocaleSwitcherContent as Ge}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";import{Label as Ke}from"./Label/index.mjs";import{H1 as qe,H2 as Je,H3 as Ye,H4 as Xe,H5 as Ze,H6 as Qe}from"./Headers/index.mjs";import{ExpandCollapse as $e}from"./ExpandCollapse/ExpandCollapse.mjs";import{CodeBlock as et,CodeDefault as tt}from"./IDE/CodeBlockClient.mjs";import{MultiSelect as nt}from"./Select/Multiselect.mjs";import{Select as rt,SelectContent as it,SelectContentPosition as at,SelectLabel as ot,SelectSeparator as st}from"./Select/Select.mjs";import{Code as ct}from"./IDE/Code.mjs";import{TabSelector as lt,TabSelectorColor as ut}from"./TabSelector/TabSelector.mjs";import{Tab as dt}from"./Tab/Tab.mjs";import{Modal as ft,ModalSize as pt}from"./Modal/Modal.mjs";import{Table as mt}from"./Table/Table.mjs";import{MarkdownRenderer as ht,baseMarkdownComponents as gt,getIntlayerMarkdownOptions as _t}from"./MarkDownRender/MarkDownRender.mjs";import{TextEditor as vt,TextEditorContainer as yt,traceKeys as bt}from"./DictionaryFieldEditor/ContentEditorView/TextEditor.mjs";import{KeyPathBreadcrumb as xt}from"./DictionaryFieldEditor/KeyPathBreadcrumb.mjs";import{ContentEditor as St}from"./DictionaryFieldEditor/ContentEditor.mjs";import{useFormField as Ct}from"./Form/FormField.mjs";import{InformationTag as wt}from"./InformationTag/index.mjs";import{useForm as Tt}from"./Form/FormBase.mjs";import{Form as Et}from"./Form/Form.mjs";import{DictionaryCreationForm as Dt}from"./DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs";import{SaveForm as Ot}from"./DictionaryFieldEditor/SaveForm/SaveForm.mjs";import{DictionaryFieldEditor as kt}from"./DictionaryFieldEditor/DictionaryFieldEditor.mjs";import{VersionSwitcherProvider as At,useVersionSwitcher as jt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs";import{VersionSwitcher as Mt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs";import{Flag as Nt}from"./Flags/Flag.mjs";import{flags_exports as Pt}from"./Flags/flags.mjs";import{Logo as Ft}from"./Logo/Logo.mjs";import{LogoTextOnly as It}from"./Logo/LogoTextOnly.mjs";import{LogoWithText as Lt}from"./Logo/LogoWithText.mjs";import{LogoWithTextBelow as Rt}from"./Logo/LogoWithTextBelow.mjs";import{DiscordLogo as zt}from"./SocialNetworks/DiscordLogo.mjs";import{InstagramLogo as Bt}from"./SocialNetworks/InstagramLogo.mjs";import{LinkedInLogo as Vt}from"./SocialNetworks/LinkedInLogo.mjs";import{ProductHuntLogo as Ht}from"./SocialNetworks/ProductHuntLogo.mjs";import{TiktokLogo as Ut}from"./SocialNetworks/TiktokLogo.mjs";import{XLogo as Wt}from"./SocialNetworks/XLogo.mjs";import{YoutubeLogo as Gt}from"./SocialNetworks/YoutubeLogo.mjs";import{FacebookLogo as Kt}from"./SocialNetworks/FacebookLogo.mjs";import{SocialNetworks as qt}from"./SocialNetworks/index.mjs";import{Footer as Jt}from"./Footer/index.mjs";import{HeightResizer as Yt}from"./HeightResizer/index.mjs";import{HideShow as Xt}from"./HideShow/index.mjs";import{HTMLRenderer as Zt,getIntlayerHTMLOptions as Qt}from"./HTMLRender/HTMLRender.mjs";import{FileList as $t}from"./IDE/FileList.mjs";import{WithResizer as en}from"./WithResizer/index.mjs";import{IDE as tn}from"./IDE/IDE.mjs";import{KeyboardScreenAdapter as nn}from"./KeyboardScreenAdapter/index.mjs";import{LanguageBackground as rn,LanguageSection as an}from"./LanguageBackground/index.mjs";import{LocaleSwitcher as on}from"./LocaleSwitcherDropDown/LocaleSwitcher.mjs";import{MaxWidthSmoother as sn}from"./MaxWidthSmoother/index.mjs";import{Navbar as cn}from"./Navbar/index.mjs";import{NumberItemsSelector as ln}from"./Pagination/NumberItemsSelector.mjs";import{Pagination as un,PaginationSize as dn,PaginationVariant as fn,paginationVariants as pn}from"./Pagination/Pagination.mjs";import{ShowingResultsNumberItems as mn}from"./Pagination/ShowingResultsNumberItems.mjs";import{DotPattern as hn}from"./Pattern/DotPattern.mjs";import{GridPattern as gn}from"./Pattern/GridPattern.mjs";import{Spotlight as _n}from"./Pattern/SpotLight.mjs";import{drawerManager as vn,useRightDrawer as yn}from"./RightDrawer/useRightDrawer.mjs";import{RightDrawer as bn}from"./RightDrawer/RightDrawer.mjs";import{Tag as xn,TagBackground as Sn,TagBorder as Cn,TagColor as wn,TagRoundedSize as Tn,TagSize as En}from"./Tag/index.mjs";import{Terminal as Dn}from"./Terminal/Terminal.mjs";import{Modes as On}from"./ThemeSwitcherDropDown/types.mjs";import{DesktopThemeSwitcher as kn}from"./ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs";import{MobileThemeSwitcher as An}from"./ThemeSwitcherDropDown/MobileThemeSwitcher.mjs";export{O as Accordion,Ne as AutoCompleteTextarea,Me as AutoSizedTextArea,k as Avatar,j as Badge,M as BadgeColor,N as BadgeSize,P as BadgeVariant,G as Breadcrumb,fe as Browser,x as Button,S as ButtonColor,C as ButtonSize,w as ButtonTextAlign,T as ButtonVariant,be as Carousel,K as Checkbox,q as CheckboxColor,J as CheckboxSize,xe as ClickOutsideDiv,ct as Code,et as CodeBlock,tt as CodeDefault,Se as CollapsibleTable,Ce as Command,we as CommandRoot,d as Container,f as ContainerBackground,p as ContainerBorderColor,m as ContainerGap,h as ContainerPadding,g as ContainerRoundedSize,_ as ContainerSeparator,v as ContainerTransparency,St as ContentEditor,Ee as ContentSelector,De as CopyButton,Oe as CopyToClipboard,kn as DesktopThemeSwitcher,he as Detail,Dt as DictionaryCreationForm,Ie as DictionaryEditor,kt as DictionaryFieldEditor,zt as DiscordLogo,hn as DotPattern,Le as DropDown,Re as DropDownAlign,ze as DropDownYAlign,Ae as EditableFieldInput,Fe as EditableFieldTextArea,$e as ExpandCollapse,Kt as FacebookLogo,$t as FileList,Nt as Flag,Pt as Flags,Jt as Footer,Et as Form,gn as GridPattern,qe as H1,Je as H2,Ye as H3,Xe as H4,Ze as H5,Qe as H6,Zt as HTMLRenderer,Yt as HeightResizer,Xt as HideShow,tn as IDE,wt as InformationTag,X as Input,te as InputIndicator,ne as InputOTP,re as InputOTPGroup,ie as InputOTPSeparator,ae as InputOTPSlot,ee as InputPassword,Z as InputSize,Q as InputVariant,Bt as InstagramLogo,pe as KeyList,xt as KeyPathBreadcrumb,nn as KeyboardScreenAdapter,me as KeyboardShortcut,Ke as Label,rn as LanguageBackground,an as LanguageSection,I as Link,L as LinkColor,R as LinkRoundedSize,z as LinkSize,B as LinkUnderlined,V as LinkVariant,Vt as LinkedInLogo,b as Loader,on as LocaleSwitcher,Ge as LocaleSwitcherContent,Ue as LocaleSwitcherContentProvider,Ft as Logo,It as LogoTextOnly,Lt as LogoWithText,Rt as LogoWithTextBelow,ht as MarkdownRenderer,D as MaxHeightSmoother,sn as MaxWidthSmoother,An as MobileThemeSwitcher,ft as Modal,pt as ModalSize,On as Modes,nt as MultiSelect,cn as Navbar,ln as NumberItemsSelector,oe as OTPInput,se as OTPInputContext,un as Pagination,dn as PaginationSize,fn as PaginationVariant,ye as Popover,ge as PopoverStatic,_e as PopoverXAlign,ve as PopoverYAlign,Te as PressableSpan,Ht as ProductHuntLogo,bn as RightDrawer,Ot as SaveForm,de as SearchInput,rt as Select,it as SelectContent,at as SelectContentPosition,ot as SelectLabel,st as SelectSeparator,mn as ShowingResultsNumberItems,qt as SocialNetworks,_n as Spotlight,Be as SwitchSelector,Ve as SwitchSelectorColor,He as SwitchSelectorSize,dt as Tab,lt as TabSelector,ut as TabSelectorColor,mt as Table,xn as Tag,Sn as TagBackground,Cn as TagBorder,wn as TagColor,Tn as TagRoundedSize,En as TagSize,Dn as Terminal,je as TextArea,vt as TextEditor,yt as TextEditorContainer,Ut as TiktokLogo,e as Toast,t as ToastAction,n as ToastClose,r as ToastDescription,i as ToastProvider,a as ToastTitle,o as ToastViewport,u as Toaster,Mt as VersionSwitcher,At as VersionSwitcherProvider,en as WithResizer,Wt as XLogo,Gt as YoutubeLogo,F as badgeVariants,gt as baseMarkdownComponents,E as buttonVariants,H as checkIsExternalLink,Y as checkboxVariants,y as containerVariants,vn as drawerManager,A as getCapitals,Qt as getIntlayerHTMLOptions,_t as getIntlayerMarkdownOptions,ce as inputSlotVariants,$ as inputVariants,U as isTextChildren,W as linkVariants,pn as paginationVariants,s as reducer,c as toast,bt as traceKeys,ke as useCopyToClipboard,Pe as useDebounce,Tt as useForm,Ct as useFormField,We as useLocaleSwitcherContent,le as usePasswordManagerBadge,ue as usePrevious,yn as useRightDrawer,l as useToast,jt as useVersionSwitcher};
|
|
1
|
+
import{Toast as e,ToastAction as t,ToastClose as n,ToastDescription as r,ToastProvider as i,ToastTitle as a,ToastViewport as o}from"./Toaster/Toast.mjs";import{reducer as s,toast as c,useToast as l}from"./Toaster/useToast.mjs";import{Toaster as u}from"./Toaster/Toaster.mjs";import{Container as d,ContainerBackground as f,ContainerBorderColor as p,ContainerGap as m,ContainerPadding as h,ContainerRoundedSize as g,ContainerSeparator as _,ContainerTransparency as v,containerVariants as y}from"./Container/index.mjs";import{Loader as b}from"./Loader/index.mjs";import{Button as x,ButtonColor as S,ButtonSize as C,ButtonTextAlign as w,ButtonVariant as T,buttonVariants as E}from"./Button/Button.mjs";import{MaxHeightSmoother as D}from"./MaxHeightSmoother/index.mjs";import{Accordion as O}from"./Accordion/Accordion.mjs";import{Avatar as k,getCapitals as A}from"./Avatar/index.mjs";import{Badge as j,BadgeColor as M,BadgeSize as N,BadgeVariant as P,badgeVariants as F}from"./Badge/index.mjs";import{Link as I,LinkColor as L,LinkRoundedSize as R,LinkSize as z,LinkUnderlined as B,LinkVariant as V,checkIsExternalLink as H,isTextChildren as U,linkVariants as W}from"./Link/Link.mjs";import{Breadcrumb as G}from"./Breadcrumb/index.mjs";import{Checkbox as K,CheckboxColor as q,CheckboxSize as J,checkboxVariants as Y}from"./Input/Checkbox.mjs";import{Input as X,InputSize as Z,InputVariant as Q,inputVariants as $}from"./Input/Input.mjs";import{InputPassword as ee}from"./Input/InputPassword.mjs";import{InputIndicator as te,InputOTP as ne,InputOTPGroup as re,InputOTPSeparator as ie,InputOTPSlot as ae,OTPInput as oe,OTPInputContext as se,inputSlotVariants as ce,usePasswordManagerBadge as le,usePrevious as ue}from"./Input/OTPInput.mjs";import{SearchInput as de}from"./Input/SearchInput.mjs";import{Browser as fe}from"./Browser/Browser.mjs";import{KeyList as pe,KeyboardShortcut as me}from"./KeyboardShortcut/KeyboardShortcut.mjs";import{Detail as he,PopoverStatic as ge,PopoverXAlign as _e,PopoverYAlign as ve}from"./Popover/static.mjs";import{Popover as ye}from"./Popover/dynamic.mjs";import{Carousel as be}from"./Carousel/index.mjs";import{ClickOutsideDiv as xe}from"./ClickOutsideDiv/index.mjs";import{CollapsibleTable as Se}from"./CollapsibleTable/CollapsibleTable.mjs";import{Command as Ce,CommandRoot as we}from"./Command/index.mjs";import{PressableSpan as Te}from"./PressableSpan/PressableSpan.mjs";import{ContentSelector as Ee}from"./ContentSelector/ContentSelector.mjs";import{CopyButton as De}from"./CopyButton/index.mjs";import{CopyToClipboard as Oe,useCopyToClipboard as ke}from"./CopyToClipboard/index.mjs";import{SwitchSelector as Ae,SwitchSelectorColor as je,SwitchSelectorSize as Me}from"./SwitchSelector/index.mjs";import{EditableFieldInput as Ne}from"./EditableField/EditableFieldInput.mjs";import{TextArea as Pe}from"./TextArea/TextArea.mjs";import{AutoSizedTextArea as Fe}from"./TextArea/AutoSizeTextArea.mjs";import{AutoCompleteTextarea as Ie,useDebounce as Le}from"./TextArea/AutocompleteTextArea.mjs";import{EditableFieldTextArea as Re}from"./EditableField/EditableFieldTextArea.mjs";import{DictionaryEditor as ze}from"./DictionaryEditor/DictionaryEditor.mjs";import{DropDown as Be,DropDownAlign as Ve,DropDownYAlign as He}from"./DropDown/index.mjs";import{LocaleSwitcherContentProvider as Ue,useLocaleSwitcherContent as We}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs";import{LocaleSwitcherContent as Ge}from"./LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs";import{Label as Ke}from"./Label/index.mjs";import{H1 as qe,H2 as Je,H3 as Ye,H4 as Xe,H5 as Ze,H6 as Qe}from"./Headers/index.mjs";import{ExpandCollapse as $e}from"./ExpandCollapse/ExpandCollapse.mjs";import{CodeBlock as et,CodeDefault as tt}from"./IDE/CodeBlockClient.mjs";import{MultiSelect as nt}from"./Select/Multiselect.mjs";import{Select as rt,SelectContent as it,SelectContentPosition as at,SelectLabel as ot,SelectSeparator as st}from"./Select/Select.mjs";import{Code as ct}from"./IDE/Code.mjs";import{TabSelector as lt,TabSelectorColor as ut}from"./TabSelector/TabSelector.mjs";import{Tab as dt}from"./Tab/Tab.mjs";import{Modal as ft,ModalSize as pt}from"./Modal/Modal.mjs";import{Table as mt}from"./Table/Table.mjs";import{MarkdownRenderer as ht,baseMarkdownComponents as gt,getIntlayerMarkdownOptions as _t}from"./MarkDownRender/MarkDownRender.mjs";import{TextEditor as vt,TextEditorContainer as yt,traceKeys as bt}from"./DictionaryFieldEditor/ContentEditorView/TextEditor.mjs";import{KeyPathBreadcrumb as xt}from"./DictionaryFieldEditor/KeyPathBreadcrumb.mjs";import{ContentEditor as St}from"./DictionaryFieldEditor/ContentEditor.mjs";import{useFormField as Ct}from"./Form/FormField.mjs";import{InformationTag as wt}from"./InformationTag/index.mjs";import{useForm as Tt}from"./Form/FormBase.mjs";import{Form as Et}from"./Form/Form.mjs";import{DictionaryCreationForm as Dt}from"./DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs";import{SaveForm as Ot}from"./DictionaryFieldEditor/SaveForm/SaveForm.mjs";import{DictionaryFieldEditor as kt}from"./DictionaryFieldEditor/DictionaryFieldEditor.mjs";import{VersionSwitcherProvider as At,useVersionSwitcher as jt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs";import{VersionSwitcher as Mt}from"./DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs";import{Flag as Nt}from"./Flags/Flag.mjs";import{flags_exports as Pt}from"./Flags/flags.mjs";import{Logo as Ft}from"./Logo/Logo.mjs";import{LogoTextOnly as It}from"./Logo/LogoTextOnly.mjs";import{LogoWithText as Lt}from"./Logo/LogoWithText.mjs";import{LogoWithTextBelow as Rt}from"./Logo/LogoWithTextBelow.mjs";import{DiscordLogo as zt}from"./SocialNetworks/DiscordLogo.mjs";import{InstagramLogo as Bt}from"./SocialNetworks/InstagramLogo.mjs";import{LinkedInLogo as Vt}from"./SocialNetworks/LinkedInLogo.mjs";import{ProductHuntLogo as Ht}from"./SocialNetworks/ProductHuntLogo.mjs";import{TiktokLogo as Ut}from"./SocialNetworks/TiktokLogo.mjs";import{XLogo as Wt}from"./SocialNetworks/XLogo.mjs";import{YoutubeLogo as Gt}from"./SocialNetworks/YoutubeLogo.mjs";import{FacebookLogo as Kt}from"./SocialNetworks/FacebookLogo.mjs";import{SocialNetworks as qt}from"./SocialNetworks/index.mjs";import{Footer as Jt}from"./Footer/index.mjs";import{HeightResizer as Yt}from"./HeightResizer/index.mjs";import{HideShow as Xt}from"./HideShow/index.mjs";import{HTMLRenderer as Zt,getIntlayerHTMLOptions as Qt}from"./HTMLRender/HTMLRender.mjs";import{FileList as $t}from"./IDE/FileList.mjs";import{WithResizer as en}from"./WithResizer/index.mjs";import{IDE as tn}from"./IDE/IDE.mjs";import{KeyboardScreenAdapter as nn}from"./KeyboardScreenAdapter/index.mjs";import{LanguageBackground as rn,LanguageSection as an}from"./LanguageBackground/index.mjs";import{LocaleSwitcher as on}from"./LocaleSwitcherDropDown/LocaleSwitcher.mjs";import{MaxWidthSmoother as sn}from"./MaxWidthSmoother/index.mjs";import{Navbar as cn}from"./Navbar/index.mjs";import{NumberItemsSelector as ln}from"./Pagination/NumberItemsSelector.mjs";import{Pagination as un,PaginationSize as dn,PaginationVariant as fn,paginationVariants as pn}from"./Pagination/Pagination.mjs";import{ShowingResultsNumberItems as mn}from"./Pagination/ShowingResultsNumberItems.mjs";import{DotPattern as hn}from"./Pattern/DotPattern.mjs";import{GridPattern as gn}from"./Pattern/GridPattern.mjs";import{Spotlight as _n}from"./Pattern/SpotLight.mjs";import{drawerManager as vn,useRightDrawer as yn}from"./RightDrawer/useRightDrawer.mjs";import{RightDrawer as bn}from"./RightDrawer/RightDrawer.mjs";import{Tag as xn,TagBackground as Sn,TagBorder as Cn,TagColor as wn,TagRoundedSize as Tn,TagSize as En}from"./Tag/index.mjs";import{Terminal as Dn}from"./Terminal/Terminal.mjs";import{Modes as On}from"./ThemeSwitcherDropDown/types.mjs";import{DesktopThemeSwitcher as kn}from"./ThemeSwitcherDropDown/DesktopThemeSwitcher.mjs";import{MobileThemeSwitcher as An}from"./ThemeSwitcherDropDown/MobileThemeSwitcher.mjs";export{O as Accordion,Ie as AutoCompleteTextarea,Fe as AutoSizedTextArea,k as Avatar,j as Badge,M as BadgeColor,N as BadgeSize,P as BadgeVariant,G as Breadcrumb,fe as Browser,x as Button,S as ButtonColor,C as ButtonSize,w as ButtonTextAlign,T as ButtonVariant,be as Carousel,K as Checkbox,q as CheckboxColor,J as CheckboxSize,xe as ClickOutsideDiv,ct as Code,et as CodeBlock,tt as CodeDefault,Se as CollapsibleTable,Ce as Command,we as CommandRoot,d as Container,f as ContainerBackground,p as ContainerBorderColor,m as ContainerGap,h as ContainerPadding,g as ContainerRoundedSize,_ as ContainerSeparator,v as ContainerTransparency,St as ContentEditor,Ee as ContentSelector,De as CopyButton,Oe as CopyToClipboard,kn as DesktopThemeSwitcher,he as Detail,Dt as DictionaryCreationForm,ze as DictionaryEditor,kt as DictionaryFieldEditor,zt as DiscordLogo,hn as DotPattern,Be as DropDown,Ve as DropDownAlign,He as DropDownYAlign,Ne as EditableFieldInput,Re as EditableFieldTextArea,$e as ExpandCollapse,Kt as FacebookLogo,$t as FileList,Nt as Flag,Pt as Flags,Jt as Footer,Et as Form,gn as GridPattern,qe as H1,Je as H2,Ye as H3,Xe as H4,Ze as H5,Qe as H6,Zt as HTMLRenderer,Yt as HeightResizer,Xt as HideShow,tn as IDE,wt as InformationTag,X as Input,te as InputIndicator,ne as InputOTP,re as InputOTPGroup,ie as InputOTPSeparator,ae as InputOTPSlot,ee as InputPassword,Z as InputSize,Q as InputVariant,Bt as InstagramLogo,pe as KeyList,xt as KeyPathBreadcrumb,nn as KeyboardScreenAdapter,me as KeyboardShortcut,Ke as Label,rn as LanguageBackground,an as LanguageSection,I as Link,L as LinkColor,R as LinkRoundedSize,z as LinkSize,B as LinkUnderlined,V as LinkVariant,Vt as LinkedInLogo,b as Loader,on as LocaleSwitcher,Ge as LocaleSwitcherContent,Ue as LocaleSwitcherContentProvider,Ft as Logo,It as LogoTextOnly,Lt as LogoWithText,Rt as LogoWithTextBelow,ht as MarkdownRenderer,D as MaxHeightSmoother,sn as MaxWidthSmoother,An as MobileThemeSwitcher,ft as Modal,pt as ModalSize,On as Modes,nt as MultiSelect,cn as Navbar,ln as NumberItemsSelector,oe as OTPInput,se as OTPInputContext,un as Pagination,dn as PaginationSize,fn as PaginationVariant,ye as Popover,ge as PopoverStatic,_e as PopoverXAlign,ve as PopoverYAlign,Te as PressableSpan,Ht as ProductHuntLogo,bn as RightDrawer,Ot as SaveForm,de as SearchInput,rt as Select,it as SelectContent,at as SelectContentPosition,ot as SelectLabel,st as SelectSeparator,mn as ShowingResultsNumberItems,qt as SocialNetworks,_n as Spotlight,Ae as SwitchSelector,je as SwitchSelectorColor,Me as SwitchSelectorSize,dt as Tab,lt as TabSelector,ut as TabSelectorColor,mt as Table,xn as Tag,Sn as TagBackground,Cn as TagBorder,wn as TagColor,Tn as TagRoundedSize,En as TagSize,Dn as Terminal,Pe as TextArea,vt as TextEditor,yt as TextEditorContainer,Ut as TiktokLogo,e as Toast,t as ToastAction,n as ToastClose,r as ToastDescription,i as ToastProvider,a as ToastTitle,o as ToastViewport,u as Toaster,Mt as VersionSwitcher,At as VersionSwitcherProvider,en as WithResizer,Wt as XLogo,Gt as YoutubeLogo,F as badgeVariants,gt as baseMarkdownComponents,E as buttonVariants,H as checkIsExternalLink,Y as checkboxVariants,y as containerVariants,vn as drawerManager,A as getCapitals,Qt as getIntlayerHTMLOptions,_t as getIntlayerMarkdownOptions,ce as inputSlotVariants,$ as inputVariants,U as isTextChildren,W as linkVariants,pn as paginationVariants,s as reducer,c as toast,bt as traceKeys,ke as useCopyToClipboard,Le as useDebounce,Tt as useForm,Ct as useFormField,We as useLocaleSwitcherContent,le as usePasswordManagerBadge,ue as usePrevious,yn as useRightDrawer,l as useToast,jt as useVersionSwitcher};
|
package/dist/esm/hooks/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{calculateIsMobile as e,checkIsIOS as t,checkIsIphoneOrSafariDevice as n,checkIsMac as r,checkIsMobileScreen as i,checkIsMobileUserAgent as a,getBreakpointFromSize as o,useDevice as s}from"./useDevice.mjs";import{
|
|
1
|
+
import{calculateIsMobile as e,checkIsIOS as t,checkIsIphoneOrSafariDevice as n,checkIsMac as r,checkIsMobileScreen as i,checkIsMobileUserAgent as a,getBreakpointFromSize as o,useDevice as s}from"./useDevice.mjs";import{useItemSelector as c}from"./useItemSelector.mjs";import{useOAuth2 as l}from"./useAuth/useOAuth2.mjs";import{useSession as u}from"./useAuth/useSession.mjs";import{useAuth as d}from"./useAuth/useAuth.mjs";import{useIntlayerAuth as f,useIntlayerOAuth as p}from"./useIntlayerAPI.mjs";import{useAddDictionary as m,useAddNewAccessKey as h,useAddOrganization as g,useAddOrganizationMember as _,useAddPasskey as v,useAddProject as y,useAddTag as b,useAppQuery as x,useAskDocQuestion as S,useAskResetPassword as C,useAuditContentDeclaration as w,useAuditContentDeclarationField as T,useAuditContentDeclarationMetadata as E,useAuditScan as D,useAuditTag as O,useAutocomplete as k,useBitbucketAuth as A,useBitbucketCheckConfig as j,useBitbucketGetConfigFile as M,useBitbucketRepos as N,useCancelSubscription as P,useChangePassword as F,useCreateUser as I,useDeleteAccessKey as L,useDeleteDictionary as R,useDeleteOrganization as z,useDeletePasskey as B,useDeleteProject as V,useDeleteSSOProvider as H,useDeleteShowcaseProject as U,useDeleteTag as W,useDeleteUser as G,useDisableTwoFactor as K,useEnableTwoFactor as q,useGetCIConfig as J,useGetDictionaries as Y,useGetDictionariesKeys as X,useGetDictionary as Z,useGetDiscussions as Q,useGetDiscussionsData as $,useGetEditorDictionaries as ee,useGetNewsletterStatus as te,useGetOrganizations as ne,useGetOtherShowcaseProjects as re,useGetPricing as ie,useGetProjects as ae,useGetRecursiveAuditStatus as oe,useGetShowcaseProjectById as se,useGetShowcaseProjects as ce,useGetSubscription as le,useGetTags as ue,useGetUserByAccount as de,useGetUserById as fe,useGetUsers as pe,useGetVerifyEmailStatus as me,useGithubAuth as he,useGithubCheckConfig as ge,useGithubGetAuthUrl as _e,useGithubGetConfigFile as ve,useGithubRepos as ye,useGitlabAuth as be,useGitlabCheckConfig as xe,useGitlabGetConfigFile as Se,useGitlabProjects as Ce,useInfiniteGetDictionaries as we,useListPasskeys as Te,useListSSOProviders as Ee,useLogin as De,useLogout as Oe,usePushCIConfig as ke,usePushDictionaries as Ae,useQueryClient as je,useRefreshAccessKey as Me,useRegister as Ne,useRegisterSSO as Pe,useResetPassword as Fe,useSearchDoc as Ie,useSelectOrganization as Le,useSelectProject as Re,useSignInMagicLink as ze,useSignInPasskey as Be,useSignInSSO as Ve,useStartRecursiveAudit as He,useSubmitShowcaseProject as Ue,useSubscribeToNewsletter as We,useToggleShowcaseDownvote as Ge,useToggleShowcaseUpvote as Ke,useTranslateJSONDeclaration as qe,useTriggerBuild as Je,useTriggerWebhook as Ye,useUnselectOrganization as Xe,useUnselectProject as Ze,useUnsubscribeFromNewsletter as Qe,useUpdateDictionary as $e,useUpdateOrganization as et,useUpdateOrganizationMembers as tt,useUpdateOrganizationMembersById as nt,useUpdateProject as rt,useUpdateProjectMembers as it,useUpdateShowcaseProject as at,useUpdateTag as ot,useUpdateUser as st,useVerifyBackupCode as ct,useVerifyEmail as lt,useVerifyTotp as ut,useWriteDictionary as dt}from"./reactQuery.mjs";import{usePersistedStore as ft}from"./usePersistedStore.mjs";import{useUser as pt}from"./useUser/index.mjs";import{useHorizontalSwipe as mt}from"./useHorizontalSwipe.mjs";import{useGetElementById as ht}from"./useGetElementById.mjs";import{useGetElementOrWindow as gt}from"./useGetElementOrWindow.mjs";import{useIsDarkMode as _t}from"./useIsDarkMode.mjs";import{useIsMounted as vt}from"./useIsMounted.mjs";import{useKeyboardDetector as yt}from"./useKeyboardDetector.mjs";import{useScreenWidth as bt}from"./useScreenWidth.mjs";import{useScrollBlockage as xt}from"./useScrollBlockage/index.mjs";import{useScrollDetection as St}from"./useScrollDetection.mjs";import{useScrollY as Ct}from"./useScrollY.mjs";import{useSearch as wt}from"./useSearch.mjs";export{e as calculateIsMobile,t as checkIsIOS,n as checkIsIphoneOrSafariDevice,r as checkIsMac,i as checkIsMobileScreen,a as checkIsMobileUserAgent,o as getBreakpointFromSize,m as useAddDictionary,h as useAddNewAccessKey,g as useAddOrganization,_ as useAddOrganizationMember,v as useAddPasskey,y as useAddProject,b as useAddTag,x as useAppQuery,S as useAskDocQuestion,C as useAskResetPassword,w as useAuditContentDeclaration,T as useAuditContentDeclarationField,E as useAuditContentDeclarationMetadata,D as useAuditScan,O as useAuditTag,d as useAuth,k as useAutocomplete,A as useBitbucketAuth,j as useBitbucketCheckConfig,M as useBitbucketGetConfigFile,N as useBitbucketRepos,P as useCancelSubscription,F as useChangePassword,I as useCreateUser,L as useDeleteAccessKey,R as useDeleteDictionary,z as useDeleteOrganization,B as useDeletePasskey,V as useDeleteProject,H as useDeleteSSOProvider,U as useDeleteShowcaseProject,W as useDeleteTag,G as useDeleteUser,s as useDevice,K as useDisableTwoFactor,q as useEnableTwoFactor,J as useGetCIConfig,Y as useGetDictionaries,X as useGetDictionariesKeys,Z as useGetDictionary,Q as useGetDiscussions,$ as useGetDiscussionsData,ee as useGetEditorDictionaries,ht as useGetElementById,gt as useGetElementOrWindow,te as useGetNewsletterStatus,ne as useGetOrganizations,re as useGetOtherShowcaseProjects,ie as useGetPricing,ae as useGetProjects,oe as useGetRecursiveAuditStatus,se as useGetShowcaseProjectById,ce as useGetShowcaseProjects,le as useGetSubscription,ue as useGetTags,de as useGetUserByAccount,fe as useGetUserById,pe as useGetUsers,me as useGetVerifyEmailStatus,he as useGithubAuth,ge as useGithubCheckConfig,_e as useGithubGetAuthUrl,ve as useGithubGetConfigFile,ye as useGithubRepos,be as useGitlabAuth,xe as useGitlabCheckConfig,Se as useGitlabGetConfigFile,Ce as useGitlabProjects,mt as useHorizontalSwipe,we as useInfiniteGetDictionaries,f as useIntlayerAuth,p as useIntlayerOAuth,_t as useIsDarkMode,vt as useIsMounted,c as useItemSelector,yt as useKeyboardDetector,Te as useListPasskeys,Ee as useListSSOProviders,De as useLogin,Oe as useLogout,l as useOAuth2,ft as usePersistedStore,ke as usePushCIConfig,Ae as usePushDictionaries,je as useQueryClient,Me as useRefreshAccessKey,Ne as useRegister,Pe as useRegisterSSO,Fe as useResetPassword,bt as useScreenWidth,xt as useScrollBlockage,St as useScrollDetection,Ct as useScrollY,wt as useSearch,Ie as useSearchDoc,Le as useSelectOrganization,Re as useSelectProject,u as useSession,ze as useSignInMagicLink,Be as useSignInPasskey,Ve as useSignInSSO,He as useStartRecursiveAudit,Ue as useSubmitShowcaseProject,We as useSubscribeToNewsletter,Ge as useToggleShowcaseDownvote,Ke as useToggleShowcaseUpvote,qe as useTranslateJSONDeclaration,Je as useTriggerBuild,Ye as useTriggerWebhook,Xe as useUnselectOrganization,Ze as useUnselectProject,Qe as useUnsubscribeFromNewsletter,$e as useUpdateDictionary,et as useUpdateOrganization,tt as useUpdateOrganizationMembers,nt as useUpdateOrganizationMembersById,rt as useUpdateProject,it as useUpdateProjectMembers,at as useUpdateShowcaseProject,ot as useUpdateTag,st as useUpdateUser,pt as useUser,ct as useVerifyBackupCode,lt as useVerifyEmail,ut as useVerifyTotp,dt as useWriteDictionary};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import e
|
|
1
|
+
"use client";import{useQuery as e}from"@tanstack/react-query";import t from"@intlayer/config/built";import{useConfiguration as n}from"@intlayer/editor-react";import{getOAuthAPI as r}from"@intlayer/api";const i=i=>{let a=n(),o=i??a??t,{data:s}=e({queryKey:[`oAuth2AccessToken`],queryFn:r(o).getOAuth2AccessToken,enabled:!!(o.editor.clientId&&o.editor.clientSecret),staleTime:0,gcTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1});return{oAuth2AccessToken:s?.data}};export{i as useOAuth2};
|
|
2
2
|
//# sourceMappingURL=useOAuth2.mjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{getAuthAPI as e}from"../../libs/auth.mjs";import{useQueryClient as t}from"../reactQuery.mjs";import n
|
|
1
|
+
"use client";import{getAuthAPI as e}from"../../libs/auth.mjs";import{useQueryClient as t}from"../reactQuery.mjs";import{useQuery as n}from"@tanstack/react-query";import r from"@intlayer/config/built";import{useConfiguration as i}from"@intlayer/editor-react";const a=(a,o)=>{let s=i(),c=o??s??r,l=t(),{data:u,isFetched:d,refetch:f}=n({queryKey:[`session`],queryFn:async()=>(await e(c).getSession()).data,staleTime:60*1e3,gcTime:300*1e3,refetchOnMount:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1,enabled:!a}),p=u??(d?null:void 0),m=e=>{l.setQueryData([`session`],e)},h=async()=>(await f()).data;return{session:p,fetchSession:h,revalidateSession:h,setSession:m}};export{a as useSession};
|
|
2
2
|
//# sourceMappingURL=useSession.mjs.map
|
|
@@ -43,8 +43,8 @@ declare enum BadgeSize {
|
|
|
43
43
|
* @description Defines the styling variants for different badge combinations
|
|
44
44
|
*/
|
|
45
45
|
declare const badgeVariants: (props?: {
|
|
46
|
-
color?: "
|
|
47
|
-
variant?: "none" | "default" | "
|
|
46
|
+
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "error" | "success" | "custom";
|
|
47
|
+
variant?: "none" | "default" | "hoverable" | "outline";
|
|
48
48
|
size?: "sm" | "md" | "lg";
|
|
49
49
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
50
50
|
/**
|
|
@@ -61,10 +61,10 @@ declare enum ButtonTextAlign {
|
|
|
61
61
|
*/
|
|
62
62
|
declare const buttonVariants: (props?: {
|
|
63
63
|
size?: "sm" | "md" | "lg" | "xl" | "icon-sm" | "icon-md" | "icon-lg" | "icon-xl";
|
|
64
|
-
color?: "
|
|
65
|
-
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "
|
|
66
|
-
variant?: "input" | "none" | "default" | "
|
|
67
|
-
textAlign?: "left" | "
|
|
64
|
+
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "error" | "success" | "custom" | "card" | "current";
|
|
65
|
+
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full" | "4xl" | "5xl";
|
|
66
|
+
variant?: "input" | "none" | "default" | "invisible-link" | "hoverable" | "outline" | "link" | "fade";
|
|
67
|
+
textAlign?: "left" | "center" | "right";
|
|
68
68
|
isFullWidth?: boolean;
|
|
69
69
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
70
70
|
/**
|
|
@@ -29,7 +29,7 @@ declare const Command: {
|
|
|
29
29
|
ref?: React.Ref<HTMLInputElement>;
|
|
30
30
|
} & {
|
|
31
31
|
asChild?: boolean;
|
|
32
|
-
}, "key" | "asChild" | keyof react.InputHTMLAttributes<HTMLInputElement>>, "
|
|
32
|
+
}, "key" | "asChild" | keyof react.InputHTMLAttributes<HTMLInputElement>>, "type" | "onChange" | "value"> & {
|
|
33
33
|
value?: string;
|
|
34
34
|
onValueChange?: (search: string) => void;
|
|
35
35
|
} & react.RefAttributes<HTMLInputElement>>;
|
|
@@ -73,7 +73,7 @@ declare const Command: {
|
|
|
73
73
|
ref?: React.Ref<HTMLDivElement>;
|
|
74
74
|
} & {
|
|
75
75
|
asChild?: boolean;
|
|
76
|
-
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild">, "
|
|
76
|
+
}, "key" | keyof HTMLAttributes<HTMLDivElement> | "asChild">, "disabled" | "onSelect" | "value"> & {
|
|
77
77
|
disabled?: boolean;
|
|
78
78
|
onSelect?: (value: string) => void;
|
|
79
79
|
value?: string;
|
|
@@ -12,9 +12,9 @@ declare const containerVariants: (props?: {
|
|
|
12
12
|
transparency?: "xs" | "sm" | "md" | "lg" | "xl" | "none" | "full";
|
|
13
13
|
padding?: "sm" | "md" | "lg" | "xl" | "2xl" | "none";
|
|
14
14
|
separator?: "both" | "without" | "x" | "y";
|
|
15
|
-
border?: "
|
|
16
|
-
borderColor?: "error" | "success" | "primary" | "secondary" | "neutral" | "
|
|
17
|
-
background?: "
|
|
15
|
+
border?: "with" | "none";
|
|
16
|
+
borderColor?: "error" | "success" | "primary" | "secondary" | "neutral" | "card" | "text" | "warning";
|
|
17
|
+
background?: "with" | "none" | "hoverable";
|
|
18
18
|
gap?: "sm" | "md" | "lg" | "xl" | "2xl" | "none";
|
|
19
19
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
20
20
|
/** Available rounded corner sizes for the container */
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { FC } from "react";
|
|
2
2
|
import { Dictionary } from "@intlayer/types/dictionary";
|
|
3
|
-
import { Locale } from "@intlayer/types/allLocales";
|
|
4
3
|
|
|
5
4
|
//#region src/components/DictionaryEditor/DictionaryEditor.d.ts
|
|
6
5
|
type DictionaryEditorProps = {
|
|
7
6
|
dictionary: Dictionary;
|
|
8
|
-
locale: Locale;
|
|
9
7
|
onDelete?: () => void;
|
|
10
8
|
};
|
|
11
9
|
declare const DictionaryEditor: FC<DictionaryEditorProps>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DictionaryEditor.d.ts","names":[],"sources":["../../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"DictionaryEditor.d.ts","names":[],"sources":["../../../../src/components/DictionaryEditor/DictionaryEditor.tsx"],"mappings":";;;;KAYK,qBAAA;EACH,UAAA,EAAY,UAAA;EACZ,QAAA;AAAA;AAAA,cAGW,gBAAA,EAAkB,EAAA,CAAG,qBAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeWrapperProps } from "./index.js";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/DictionaryEditor/NodeWrapper/BooleanWrapper.d.ts
|
|
5
|
+
type BooleanWrapperProps = Omit<NodeWrapperProps, 'section'> & {
|
|
6
|
+
section: boolean;
|
|
7
|
+
};
|
|
8
|
+
declare const BooleanWrapper: FC<BooleanWrapperProps>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { BooleanWrapper, BooleanWrapperProps };
|
|
11
|
+
//# sourceMappingURL=BooleanWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BooleanWrapper.d.ts","names":[],"sources":["../../../../../src/components/DictionaryEditor/NodeWrapper/BooleanWrapper.tsx"],"mappings":";;;;KASY,mBAAA,GAAsB,IAAA,CAAK,gBAAA;EACrC,OAAA;AAAA;AAAA,cAGW,cAAA,EAAgB,EAAA,CAAG,mBAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NodeWrapperProps } from "./index.js";
|
|
2
|
+
import { FC } from "react";
|
|
3
|
+
|
|
4
|
+
//#region src/components/DictionaryEditor/NodeWrapper/NumberWrapper.d.ts
|
|
5
|
+
type NumberWrapperProps = Omit<NodeWrapperProps, 'section'> & {
|
|
6
|
+
section: number;
|
|
7
|
+
};
|
|
8
|
+
declare const NumberWrapper: FC<NumberWrapperProps>;
|
|
9
|
+
//#endregion
|
|
10
|
+
export { NumberWrapper, NumberWrapperProps };
|
|
11
|
+
//# sourceMappingURL=NumberWrapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NumberWrapper.d.ts","names":[],"sources":["../../../../../src/components/DictionaryEditor/NodeWrapper/NumberWrapper.tsx"],"mappings":";;;;KAOY,kBAAA,GAAqB,IAAA,CAAK,gBAAA;EACpC,OAAA;AAAA;AAAA,cAGW,aAAA,EAAe,EAAA,CAAG,kBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../../../../src/components/DictionaryEditor/NodeWrapper/index.tsx"],"mappings":";;;;;;cAkCa,SAAA;AAAA,KAED,gBAAA;EACV,OAAA,EAAS,OAAA;EACT,UAAA,EAAY,UAAA;EACZ,OAAA,EAAS,WAAA;EACT,eAAA,GAAkB,OAAA;IAAW,OAAA,EAAS,OAAA;IAAW,QAAA;EAAA;EACjD,MAAA,EAAQ,MAAA;EACR,aAAA,EAAe,WAAA;EACf,cAAA,EAAgB,OAAA;EAChB,cAAA,GAAiB,OAAA,EAAS,OAAA;EAC1B,WAAA,IAAe,OAAA,EAAS,OAAA;EACxB,aAAA,IAAiB,OAAA,aAAoB,SAAA;AAAA;AAAA,cAG1B,WAAA,EAAa,EAAA,CAAG,gBAAA"}
|
|
@@ -6,7 +6,7 @@ import { VariantProps } from "class-variance-authority";
|
|
|
6
6
|
declare const checkboxVariants: (props?: {
|
|
7
7
|
variant?: "default";
|
|
8
8
|
size?: "xs" | "sm" | "md" | "lg";
|
|
9
|
-
color?: "error" | "success" | "primary" | "secondary" | "
|
|
9
|
+
color?: "error" | "success" | "primary" | "secondary" | "neutral" | "text" | "destructive" | "light" | "dark" | "custom";
|
|
10
10
|
validationStyleEnabled?: "enabled" | "disabled";
|
|
11
11
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
12
12
|
declare enum CheckboxSize {
|
|
@@ -53,9 +53,9 @@ declare enum LinkUnderlined {
|
|
|
53
53
|
FALSE = "false"
|
|
54
54
|
}
|
|
55
55
|
declare const linkVariants: (props?: {
|
|
56
|
-
variant?: "default" | "
|
|
56
|
+
variant?: "default" | "invisible-link" | "button" | "button-outlined" | "hoverable";
|
|
57
57
|
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full";
|
|
58
|
-
color?: "
|
|
58
|
+
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark" | "text-inverse" | "error" | "success" | "custom";
|
|
59
59
|
size?: "sm" | "md" | "lg" | "xl" | "custom";
|
|
60
60
|
underlined?: boolean | LinkUnderlined.DEFAULT;
|
|
61
61
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
@@ -5,8 +5,8 @@ import { VariantProps } from "class-variance-authority";
|
|
|
5
5
|
//#region src/components/Pagination/Pagination.d.ts
|
|
6
6
|
declare const paginationVariants: (props?: {
|
|
7
7
|
size?: "sm" | "md" | "lg";
|
|
8
|
-
color?: "primary" | "secondary" | "
|
|
9
|
-
variant?: "default" | "
|
|
8
|
+
color?: "primary" | "secondary" | "neutral" | "text" | "destructive";
|
|
9
|
+
variant?: "default" | "ghost" | "bordered";
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
11
11
|
declare enum PaginationSize {
|
|
12
12
|
SM = "sm",
|
|
@@ -29,7 +29,7 @@ declare enum SwitchSelectorColor {
|
|
|
29
29
|
TEXT = "text"
|
|
30
30
|
}
|
|
31
31
|
declare const switchSelectorVariant: (props?: {
|
|
32
|
-
color?: "
|
|
32
|
+
color?: "text" | "primary" | "secondary" | "destructive" | "neutral" | "light" | "dark";
|
|
33
33
|
disabled?: boolean;
|
|
34
34
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
35
35
|
declare enum SwitchSelectorSize {
|
|
@@ -6,7 +6,7 @@ import * as react_jsx_runtime0 from "react/jsx-runtime";
|
|
|
6
6
|
//#region src/components/Tab/Tab.d.ts
|
|
7
7
|
declare const tabContainerVariant: (props?: {
|
|
8
8
|
background?: "with" | "without";
|
|
9
|
-
variant?: "default" | "
|
|
9
|
+
variant?: "default" | "ghost" | "bordered";
|
|
10
10
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
11
11
|
type TabProps = HTMLAttributes<HTMLDivElement> & VariantProps<typeof tabContainerVariant> & {
|
|
12
12
|
defaultTab?: string;
|
|
@@ -15,7 +15,7 @@ declare enum TabSelectorColor {
|
|
|
15
15
|
TEXT = "text"
|
|
16
16
|
}
|
|
17
17
|
declare const tabSelectorVariant: (props?: {
|
|
18
|
-
color?: "primary" | "secondary" | "
|
|
18
|
+
color?: "primary" | "secondary" | "neutral" | "text" | "destructive" | "light" | "dark";
|
|
19
19
|
} & class_variance_authority_types0.ClassProp) => string;
|
|
20
20
|
type TabSelectorItemProps = HTMLAttributes<HTMLElement> & {
|
|
21
21
|
key: string | number;
|
|
@@ -186,7 +186,7 @@ declare enum TagBackground {
|
|
|
186
186
|
}
|
|
187
187
|
declare const containerVariants: (props?: {
|
|
188
188
|
roundedSize?: "sm" | "md" | "lg" | "xl" | "2xl" | "none" | "3xl" | "full";
|
|
189
|
-
color?: "
|
|
189
|
+
color?: "text" | "primary" | "neutral" | "error" | "success" | "warning" | "blue" | "yellow" | "green" | "red" | "orange" | "purple" | "pink" | "brown" | "gray" | "black" | "white";
|
|
190
190
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
191
191
|
border?: "none" | "with";
|
|
192
192
|
background?: "none" | "with";
|