@intlayer/design-system 5.8.1 → 6.0.0-canary.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/.vite/manifest.json +34 -106
- package/dist/better-auth.CMQ3rA-I-7umXOENE.js.map +1 -1
- package/dist/better-auth.CMQ3rA-I-C2nBKRMa.cjs.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.cjs +3 -1
- package/dist/components/Breadcrumb/breadcrumb.content.cjs.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts +3 -0
- package/dist/components/Breadcrumb/breadcrumb.content.d.ts.map +1 -1
- package/dist/components/Breadcrumb/breadcrumb.content.mjs +3 -1
- package/dist/components/Breadcrumb/breadcrumb.content.mjs.map +1 -1
- package/dist/components/Breadcrumb/index.cjs.map +1 -1
- package/dist/components/Breadcrumb/index.d.ts.map +1 -1
- package/dist/components/Breadcrumb/index.mjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.cjs +3 -1
- package/dist/components/CopyButton/CopyButton.content.cjs.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.d.ts +3 -0
- package/dist/components/CopyButton/CopyButton.content.d.ts.map +1 -1
- package/dist/components/CopyButton/CopyButton.content.mjs +3 -1
- package/dist/components/CopyButton/CopyButton.content.mjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs +7 -3
- package/dist/components/DictionaryEditor/DictionaryEditor.cjs.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.d.ts.map +1 -1
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs +7 -3
- package/dist/components/DictionaryEditor/DictionaryEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.cjs +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.mjs +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs +83 -34
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs +83 -34
- package/dist/components/DictionaryFieldEditor/ContentEditorView/TextEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs +13 -9
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs +12 -8
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/DictionaryCreationForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs +27 -13
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts +27 -0
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs +27 -13
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/dictionaryCreationForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.cjs +9 -4
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts +9 -0
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs +9 -4
- package/dist/components/DictionaryFieldEditor/DictionaryCreationForm/useDictionaryFormSchema.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs +29 -25
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs +27 -23
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/DictionaryDetailsForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs +37 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts +64 -2
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs +37 -17
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/dictionaryDetails.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs +25 -12
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts +25 -0
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs +25 -12
- package/dist/components/DictionaryFieldEditor/DictionaryDetails/useDictionaryDetailsSchema.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs +4 -5
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs +4 -5
- package/dist/components/DictionaryFieldEditor/DictionaryFieldEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/JSONEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/JSONEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs +25 -12
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts +25 -0
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs +25 -12
- package/dist/components/DictionaryFieldEditor/NavigationView/navigationViewNode.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs +36 -31
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs +36 -31
- package/dist/components/DictionaryFieldEditor/SaveForm/SaveForm.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs +32 -28
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts +32 -5
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs +32 -28
- package/dist/components/DictionaryFieldEditor/SaveForm/saveForm.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.cjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureEditor.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureEditor.mjs +2 -2
- package/dist/components/DictionaryFieldEditor/StructureEditor.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs +2 -5
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs +2 -5
- package/dist/components/DictionaryFieldEditor/StructureView/StructureView.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.cjs +9 -4
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts +9 -0
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.mjs +9 -4
- package/dist/components/DictionaryFieldEditor/StructureView/structureView.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcher.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs +4 -6
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts +3 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs +4 -6
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/VersionSwitcherContext.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs +7 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts +7 -0
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs +7 -3
- package/dist/components/DictionaryFieldEditor/VersionSwitcherDropDown/versionSwitcherDropDown.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs +9 -6
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts +9 -4
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs +9 -6
- package/dist/components/DictionaryFieldEditor/dictionaryFieldEditor.content.mjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs +28 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.cjs.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts +29 -2
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.d.ts.map +1 -1
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs +28 -14
- package/dist/components/DictionaryFieldEditor/nodeTypeSelector.content.mjs.map +1 -1
- package/dist/components/DropDown/index.cjs +2 -2
- package/dist/components/DropDown/index.cjs.map +1 -1
- package/dist/components/DropDown/index.d.ts.map +1 -1
- package/dist/components/DropDown/index.mjs +2 -2
- package/dist/components/DropDown/index.mjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.cjs +2 -5
- package/dist/components/EditableField/EditableFieldTextArea.cjs.map +1 -1
- package/dist/components/EditableField/EditableFieldTextArea.mjs +2 -5
- package/dist/components/EditableField/EditableFieldTextArea.mjs.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.cjs.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.d.ts +2 -2
- package/dist/components/ExpandCollapse/ExpandCollapse.d.ts.map +1 -1
- package/dist/components/ExpandCollapse/ExpandCollapse.mjs.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.cjs +5 -2
- package/dist/components/ExpandCollapse/expandCollapse.content.cjs.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.d.ts +3 -0
- package/dist/components/ExpandCollapse/expandCollapse.content.d.ts.map +1 -1
- package/dist/components/ExpandCollapse/expandCollapse.content.mjs +5 -2
- package/dist/components/ExpandCollapse/expandCollapse.content.mjs.map +1 -1
- package/dist/components/Flags/Flag.cjs +2 -1
- package/dist/components/Flags/Flag.cjs.map +1 -1
- package/dist/components/Flags/Flag.d.ts.map +1 -1
- package/dist/components/Flags/Flag.mjs +2 -1
- package/dist/components/Flags/Flag.mjs.map +1 -1
- package/dist/components/IDE/Code.cjs +8 -8
- package/dist/components/IDE/Code.cjs.map +1 -1
- package/dist/components/IDE/Code.mjs +8 -8
- package/dist/components/IDE/Code.mjs.map +1 -1
- package/dist/components/IDE/CodeBlockClient.cjs +1 -1
- package/dist/components/IDE/CodeBlockClient.cjs.map +1 -1
- package/dist/components/IDE/CodeBlockClient.d.ts +1 -1
- package/dist/components/IDE/CodeBlockClient.d.ts.map +1 -1
- package/dist/components/IDE/CodeBlockClient.mjs +1 -1
- package/dist/components/IDE/CodeBlockClient.mjs.map +1 -1
- package/dist/components/IDE/CodeContext.cjs +1 -3
- package/dist/components/IDE/CodeContext.cjs.map +1 -1
- package/dist/components/IDE/CodeContext.mjs +1 -3
- package/dist/components/IDE/CodeContext.mjs.map +1 -1
- package/dist/components/IDE/code.content.cjs +5 -2
- package/dist/components/IDE/code.content.cjs.map +1 -1
- package/dist/components/IDE/code.content.d.ts +5 -0
- package/dist/components/IDE/code.content.d.ts.map +1 -1
- package/dist/components/IDE/code.content.mjs +5 -2
- package/dist/components/IDE/code.content.mjs.map +1 -1
- package/dist/components/IDE/copyCode.content.cjs +5 -2
- package/dist/components/IDE/copyCode.content.cjs.map +1 -1
- package/dist/components/IDE/copyCode.content.d.ts +5 -0
- package/dist/components/IDE/copyCode.content.d.ts.map +1 -1
- package/dist/components/IDE/copyCode.content.mjs +5 -2
- package/dist/components/IDE/copyCode.content.mjs.map +1 -1
- package/dist/components/Input/Checkbox.cjs.map +1 -1
- package/dist/components/Input/Checkbox.d.ts +2 -2
- package/dist/components/Input/Checkbox.d.ts.map +1 -1
- package/dist/components/Input/Checkbox.mjs.map +1 -1
- package/dist/components/Loader/index.content.cjs +6 -1
- package/dist/components/Loader/index.content.cjs.map +1 -1
- package/dist/components/Loader/index.content.d.ts +33 -2
- package/dist/components/Loader/index.content.d.ts.map +1 -1
- package/dist/components/Loader/index.content.mjs +6 -1
- package/dist/components/Loader/index.content.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContent.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs +1 -3
- package/dist/components/LocaleSwitcherContentDropDown/LocaleSwitcherContentContext.mjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs +17 -8
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.cjs.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts +17 -0
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs +17 -8
- package/dist/components/LocaleSwitcherContentDropDown/localeSwitcher.content.mjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs +13 -6
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.cjs.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts +13 -0
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.d.ts.map +1 -1
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs +13 -6
- package/dist/components/LocaleSwitcherDropDown/localeSwitcher.content.mjs.map +1 -1
- package/dist/components/Modal/Modal.cjs +2 -4
- package/dist/components/Modal/Modal.cjs.map +1 -1
- package/dist/components/Modal/Modal.mjs +2 -4
- package/dist/components/Modal/Modal.mjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.cjs +1 -3
- package/dist/components/Navbar/MobileNavbar.cjs.map +1 -1
- package/dist/components/Navbar/MobileNavbar.mjs +1 -3
- package/dist/components/Navbar/MobileNavbar.mjs.map +1 -1
- package/dist/components/Navbar/index.cjs +2 -4
- package/dist/components/Navbar/index.cjs.map +1 -1
- package/dist/components/Navbar/index.mjs +2 -4
- package/dist/components/Navbar/index.mjs.map +1 -1
- package/dist/components/SwitchSelector/index.cjs +1 -3
- package/dist/components/SwitchSelector/index.cjs.map +1 -1
- package/dist/components/SwitchSelector/index.mjs +1 -3
- package/dist/components/SwitchSelector/index.mjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.cjs +1 -3
- package/dist/components/TabSelector/TabSelector.cjs.map +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts +1 -1
- package/dist/components/TabSelector/TabSelector.d.ts.map +1 -1
- package/dist/components/TabSelector/TabSelector.mjs +1 -3
- package/dist/components/TabSelector/TabSelector.mjs.map +1 -1
- package/dist/components/Table/table.content.cjs +3 -1
- package/dist/components/Table/table.content.cjs.map +1 -1
- package/dist/components/Table/table.content.d.ts +3 -0
- package/dist/components/Table/table.content.d.ts.map +1 -1
- package/dist/components/Table/table.content.mjs +3 -1
- package/dist/components/Table/table.content.mjs.map +1 -1
- package/dist/components/Tag/index.cjs +22 -88
- package/dist/components/Tag/index.cjs.map +1 -1
- package/dist/components/Tag/index.d.ts +5 -5
- package/dist/components/Tag/index.mjs +22 -88
- package/dist/components/Tag/index.mjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.cjs +20 -21
- package/dist/components/TextArea/AutocompleteTextArea.cjs.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.d.ts.map +1 -1
- package/dist/components/TextArea/AutocompleteTextArea.mjs +20 -21
- package/dist/components/TextArea/AutocompleteTextArea.mjs.map +1 -1
- package/dist/hooks/auth.cjs +26 -11
- package/dist/hooks/auth.cjs.map +1 -1
- package/dist/hooks/auth.mjs +26 -11
- package/dist/hooks/auth.mjs.map +1 -1
- package/dist/hooks/index.cjs +65 -66
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.ts +1 -3
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.mjs +4 -8
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/hooks/reactQuery.cjs +648 -0
- package/dist/hooks/reactQuery.cjs.map +1 -0
- package/dist/hooks/reactQuery.d.ts +899 -0
- package/dist/hooks/reactQuery.d.ts.map +1 -0
- package/dist/hooks/reactQuery.mjs +646 -0
- package/dist/hooks/reactQuery.mjs.map +1 -0
- package/dist/hooks/useAuth/useOAuth2.cjs +13 -10
- package/dist/hooks/useAuth/useOAuth2.cjs.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.d.ts +1 -1
- package/dist/hooks/useAuth/useOAuth2.d.ts.map +1 -1
- package/dist/hooks/useAuth/useOAuth2.mjs +13 -10
- package/dist/hooks/useAuth/useOAuth2.mjs.map +1 -1
- package/dist/hooks/useAuth/useSession.cjs +23 -26
- package/dist/hooks/useAuth/useSession.cjs.map +1 -1
- package/dist/hooks/useAuth/useSession.d.ts +4 -352
- package/dist/hooks/useAuth/useSession.d.ts.map +1 -1
- package/dist/hooks/useAuth/useSession.mjs +23 -26
- package/dist/hooks/useAuth/useSession.mjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.cjs +2 -3
- package/dist/hooks/useIntlayerAPI.cjs.map +1 -1
- package/dist/hooks/useIntlayerAPI.mjs +2 -3
- package/dist/hooks/useIntlayerAPI.mjs.map +1 -1
- package/dist/hooks/useUser/index.cjs +6 -9
- package/dist/hooks/useUser/index.cjs.map +1 -1
- package/dist/hooks/useUser/index.d.ts +2 -18
- package/dist/hooks/useUser/index.d.ts.map +1 -1
- package/dist/hooks/useUser/index.mjs +6 -9
- package/dist/hooks/useUser/index.mjs.map +1 -1
- package/dist/index-BCuMWKyy.js.map +1 -1
- package/dist/index-BYzBot7l.cjs.map +1 -1
- package/dist/providers/ReactQueryProvider.cjs +85 -0
- package/dist/providers/ReactQueryProvider.cjs.map +1 -0
- package/dist/providers/ReactQueryProvider.d.ts +13 -0
- package/dist/providers/ReactQueryProvider.d.ts.map +1 -0
- package/dist/providers/ReactQueryProvider.mjs +85 -0
- package/dist/providers/ReactQueryProvider.mjs.map +1 -0
- package/dist/providers/index.cjs +5 -0
- package/dist/{hooks/useAsync → providers}/index.cjs.map +1 -1
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.mjs +5 -0
- package/dist/{hooks/useAsync → providers}/index.mjs.map +1 -1
- package/package.json +31 -21
- package/dist/hooks/intlayerAPIHooks.cjs +0 -542
- package/dist/hooks/intlayerAPIHooks.cjs.map +0 -1
- package/dist/hooks/intlayerAPIHooks.d.ts +0 -968
- package/dist/hooks/intlayerAPIHooks.d.ts.map +0 -1
- package/dist/hooks/intlayerAPIHooks.mjs +0 -542
- package/dist/hooks/intlayerAPIHooks.mjs.map +0 -1
- package/dist/hooks/useAsync/index.cjs +0 -8
- package/dist/hooks/useAsync/index.d.ts +0 -3
- package/dist/hooks/useAsync/index.d.ts.map +0 -1
- package/dist/hooks/useAsync/index.mjs +0 -8
- package/dist/hooks/useAsync/useAsync.cjs +0 -244
- package/dist/hooks/useAsync/useAsync.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsync.d.ts +0 -73
- package/dist/hooks/useAsync/useAsync.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsync.mjs +0 -244
- package/dist/hooks/useAsync/useAsync.mjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.cjs +0 -150
- package/dist/hooks/useAsync/useAsyncStateStore.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts +0 -52
- package/dist/hooks/useAsync/useAsyncStateStore.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsyncStateStore.mjs +0 -150
- package/dist/hooks/useAsync/useAsyncStateStore.mjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.cjs +0 -10
- package/dist/hooks/useAsync/useAsyncWrapper.cjs.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.d.ts +0 -37
- package/dist/hooks/useAsync/useAsyncWrapper.d.ts.map +0 -1
- package/dist/hooks/useAsync/useAsyncWrapper.mjs +0 -10
- package/dist/hooks/useAsync/useAsyncWrapper.mjs.map +0 -1
- package/dist/hooks/useGetAllDictionaries.cjs +0 -35
- package/dist/hooks/useGetAllDictionaries.cjs.map +0 -1
- package/dist/hooks/useGetAllDictionaries.d.ts +0 -11
- package/dist/hooks/useGetAllDictionaries.d.ts.map +0 -1
- package/dist/hooks/useGetAllDictionaries.mjs +0 -35
- package/dist/hooks/useGetAllDictionaries.mjs.map +0 -1
|
@@ -5,12 +5,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
5
5
|
require("@intlayer/config/built");
|
|
6
6
|
require("../../better-auth.CMQ3rA-I-C2nBKRMa.cjs");
|
|
7
7
|
require("@intlayer/editor-react");
|
|
8
|
-
require("
|
|
9
|
-
require("react");
|
|
10
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
8
|
+
require("@tanstack/react-query");
|
|
11
9
|
require("@intlayer/api");
|
|
12
10
|
const hooks_useDevice = require("../../hooks/useDevice.cjs");
|
|
13
|
-
require("
|
|
11
|
+
require("react");
|
|
14
12
|
const hooks_useIsMounted = require("../../hooks/useIsMounted.cjs");
|
|
15
13
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
16
14
|
const components_Navbar_DesktopNavbar = require("./DesktopNavbar.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Navbar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement, ReactNode } from 'react';\nimport { useDevice, useIsMounted } from '../../hooks';\nimport type { TabProps } from '../TabSelector';\nimport { DesktopNavbar } from './DesktopNavbar';\nimport { MobileNavbar } from './MobileNavbar';\n\ntype NavbarProps<T extends TabProps> = {\n logo: ReactNode;\n selectedChoice: T['key'];\n desktopSections?: ReactElement<T>[];\n mobileTopChildren?: ReactNode;\n mobileTopSections?: ReactElement<T>[];\n mobileBottomChildren?: ReactNode;\n mobileBottomSections?: ReactElement<T>[];\n rightItemsDesktop?: ReactNode;\n rightItemsMobile?: ReactNode;\n};\n\nexport const Navbar = <T extends TabProps>({\n logo,\n mobileTopChildren,\n desktopSections = [],\n mobileTopSections = [],\n mobileBottomChildren,\n mobileBottomSections = [],\n rightItemsDesktop,\n rightItemsMobile,\n selectedChoice,\n}: NavbarProps<T>) => {\n const { isMobile } = useDevice('lg');\n const isMoUnted = useIsMounted();\n\n if (!isMoUnted) return <></>;\n\n return isMobile ? (\n <MobileNavbar\n topChildren={mobileTopChildren}\n topSections={mobileTopSections}\n bottomChildren={mobileBottomChildren}\n bottomSections={mobileBottomSections}\n logo={logo}\n rightItems={rightItemsMobile}\n />\n ) : (\n <DesktopNavbar\n sections={desktopSections}\n rightItems={rightItemsDesktop}\n logo={logo}\n selectedChoice={selectedChoice}\n />\n );\n};\n"],"names":["useDevice","useIsMounted","jsx","Fragment","MobileNavbar","DesktopNavbar"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Navbar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement, ReactNode } from 'react';\nimport { useDevice, useIsMounted } from '../../hooks';\nimport type { TabProps } from '../TabSelector';\nimport { DesktopNavbar } from './DesktopNavbar';\nimport { MobileNavbar } from './MobileNavbar';\n\ntype NavbarProps<T extends TabProps> = {\n logo: ReactNode;\n selectedChoice: T['key'];\n desktopSections?: ReactElement<T>[];\n mobileTopChildren?: ReactNode;\n mobileTopSections?: ReactElement<T>[];\n mobileBottomChildren?: ReactNode;\n mobileBottomSections?: ReactElement<T>[];\n rightItemsDesktop?: ReactNode;\n rightItemsMobile?: ReactNode;\n};\n\nexport const Navbar = <T extends TabProps>({\n logo,\n mobileTopChildren,\n desktopSections = [],\n mobileTopSections = [],\n mobileBottomChildren,\n mobileBottomSections = [],\n rightItemsDesktop,\n rightItemsMobile,\n selectedChoice,\n}: NavbarProps<T>) => {\n const { isMobile } = useDevice('lg');\n const isMoUnted = useIsMounted();\n\n if (!isMoUnted) return <></>;\n\n return isMobile ? (\n <MobileNavbar\n topChildren={mobileTopChildren}\n topSections={mobileTopSections}\n bottomChildren={mobileBottomChildren}\n bottomSections={mobileBottomSections}\n logo={logo}\n rightItems={rightItemsMobile}\n />\n ) : (\n <DesktopNavbar\n sections={desktopSections}\n rightItems={rightItemsDesktop}\n logo={logo}\n selectedChoice={selectedChoice}\n />\n );\n};\n"],"names":["useDevice","useIsMounted","jsx","Fragment","MobileNavbar","DesktopNavbar"],"mappings":";;;;;;;;;;;;;;;AAoBO,MAAM,SAAS,CAAqB;AAAA,EACzC;AAAA,EACA;AAAA,EACA,kBAAkB,CAAA;AAAA,EAClB,oBAAoB,CAAA;AAAA,EACpB;AAAA,EACA,uBAAuB,CAAA;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,MAAsB;AACpB,QAAM,EAAE,SAAA,IAAaA,gBAAAA,UAAU,IAAI;AACnC,QAAM,YAAYC,mBAAAA,aAAA;AAElB,MAAI,CAAC,UAAW,QAAOC,+BAAAC,WAAAA,UAAA,CAAA,CAAE;AAEzB,SAAO,WACLD,2BAAAA;AAAAA,IAACE,+BAAAA;AAAAA,IAAA;AAAA,MACC,aAAa;AAAA,MACb,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,MAChB;AAAA,MACA,YAAY;AAAA,IAAA;AAAA,EAAA,IAGdF,2BAAAA;AAAAA,IAACG,gCAAAA;AAAAA,IAAA;AAAA,MACC,UAAU;AAAA,MACV,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGN;;"}
|
|
@@ -3,12 +3,10 @@ import { jsx, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import "@intlayer/config/built";
|
|
4
4
|
import "../../better-auth.CMQ3rA-I-7umXOENE.js";
|
|
5
5
|
import "@intlayer/editor-react";
|
|
6
|
-
import "
|
|
7
|
-
import "react";
|
|
8
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
6
|
+
import "@tanstack/react-query";
|
|
9
7
|
import "@intlayer/api";
|
|
10
8
|
import { useDevice } from "../../hooks/useDevice.mjs";
|
|
11
|
-
import "
|
|
9
|
+
import "react";
|
|
12
10
|
import { useIsMounted } from "../../hooks/useIsMounted.mjs";
|
|
13
11
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
14
12
|
import { DesktopNavbar } from "./DesktopNavbar.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/Navbar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement, ReactNode } from 'react';\nimport { useDevice, useIsMounted } from '../../hooks';\nimport type { TabProps } from '../TabSelector';\nimport { DesktopNavbar } from './DesktopNavbar';\nimport { MobileNavbar } from './MobileNavbar';\n\ntype NavbarProps<T extends TabProps> = {\n logo: ReactNode;\n selectedChoice: T['key'];\n desktopSections?: ReactElement<T>[];\n mobileTopChildren?: ReactNode;\n mobileTopSections?: ReactElement<T>[];\n mobileBottomChildren?: ReactNode;\n mobileBottomSections?: ReactElement<T>[];\n rightItemsDesktop?: ReactNode;\n rightItemsMobile?: ReactNode;\n};\n\nexport const Navbar = <T extends TabProps>({\n logo,\n mobileTopChildren,\n desktopSections = [],\n mobileTopSections = [],\n mobileBottomChildren,\n mobileBottomSections = [],\n rightItemsDesktop,\n rightItemsMobile,\n selectedChoice,\n}: NavbarProps<T>) => {\n const { isMobile } = useDevice('lg');\n const isMoUnted = useIsMounted();\n\n if (!isMoUnted) return <></>;\n\n return isMobile ? (\n <MobileNavbar\n topChildren={mobileTopChildren}\n topSections={mobileTopSections}\n bottomChildren={mobileBottomChildren}\n bottomSections={mobileBottomSections}\n logo={logo}\n rightItems={rightItemsMobile}\n />\n ) : (\n <DesktopNavbar\n sections={desktopSections}\n rightItems={rightItemsDesktop}\n logo={logo}\n selectedChoice={selectedChoice}\n />\n );\n};\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/Navbar/index.tsx"],"sourcesContent":["'use client';\n\nimport type { ReactElement, ReactNode } from 'react';\nimport { useDevice, useIsMounted } from '../../hooks';\nimport type { TabProps } from '../TabSelector';\nimport { DesktopNavbar } from './DesktopNavbar';\nimport { MobileNavbar } from './MobileNavbar';\n\ntype NavbarProps<T extends TabProps> = {\n logo: ReactNode;\n selectedChoice: T['key'];\n desktopSections?: ReactElement<T>[];\n mobileTopChildren?: ReactNode;\n mobileTopSections?: ReactElement<T>[];\n mobileBottomChildren?: ReactNode;\n mobileBottomSections?: ReactElement<T>[];\n rightItemsDesktop?: ReactNode;\n rightItemsMobile?: ReactNode;\n};\n\nexport const Navbar = <T extends TabProps>({\n logo,\n mobileTopChildren,\n desktopSections = [],\n mobileTopSections = [],\n mobileBottomChildren,\n mobileBottomSections = [],\n rightItemsDesktop,\n rightItemsMobile,\n selectedChoice,\n}: NavbarProps<T>) => {\n const { isMobile } = useDevice('lg');\n const isMoUnted = useIsMounted();\n\n if (!isMoUnted) return <></>;\n\n return isMobile ? (\n <MobileNavbar\n topChildren={mobileTopChildren}\n topSections={mobileTopSections}\n bottomChildren={mobileBottomChildren}\n bottomSections={mobileBottomSections}\n logo={logo}\n rightItems={rightItemsMobile}\n />\n ) : (\n <DesktopNavbar\n sections={desktopSections}\n rightItems={rightItemsDesktop}\n logo={logo}\n selectedChoice={selectedChoice}\n />\n );\n};\n"],"names":[],"mappings":";;;;;;;;;;;;;AAoBO,MAAM,SAAS,CAAqB;AAAA,EACzC;AAAA,EACA;AAAA,EACA,kBAAkB,CAAA;AAAA,EAClB,oBAAoB,CAAA;AAAA,EACpB;AAAA,EACA,uBAAuB,CAAA;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AACF,MAAsB;AACpB,QAAM,EAAE,SAAA,IAAa,UAAU,IAAI;AACnC,QAAM,YAAY,aAAA;AAElB,MAAI,CAAC,UAAW,QAAO,oBAAA,UAAA,CAAA,CAAE;AAEzB,SAAO,WACL;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,aAAa;AAAA,MACb,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,gBAAgB;AAAA,MAChB;AAAA,MACA,YAAY;AAAA,IAAA;AAAA,EAAA,IAGd;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,UAAU;AAAA,MACV,YAAY;AAAA,MACZ;AAAA,MACA;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -7,10 +7,8 @@ const classVarianceAuthority = require("class-variance-authority");
|
|
|
7
7
|
require("@intlayer/config/built");
|
|
8
8
|
require("../../better-auth.CMQ3rA-I-C2nBKRMa.cjs");
|
|
9
9
|
require("@intlayer/editor-react");
|
|
10
|
-
require("
|
|
11
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
10
|
+
require("@tanstack/react-query");
|
|
12
11
|
require("@intlayer/api");
|
|
13
|
-
require("deepmerge");
|
|
14
12
|
const hooks_useItemSelector = require("../../hooks/useItemSelector.cjs");
|
|
15
13
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
16
14
|
const utils_cn = require("../../utils/cn.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/SwitchSelector/index.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nexport type SwitchSelectorChoice<T = boolean> = {\n content: ReactNode;\n value: T;\n} & HTMLAttributes<HTMLButtonElement>;\nexport type SwitchSelectorChoices<T> = SwitchSelectorChoice<T>[];\n\nconst defaultChoices: SwitchSelectorChoices<boolean> = [\n { content: 'Off', value: false },\n { content: 'On', value: true },\n];\n\nexport type SwitchSelectorProps<T = boolean> = {\n choices?: SwitchSelectorChoices<T>;\n value?: T;\n defaultValue?: T;\n onChange?: (choice: T) => void;\n className?: string;\n} & VariantProps<typeof switchSelectorVariant> &\n VariantProps<typeof choiceVariant>;\n\nexport enum SwitchSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst switchSelectorVariant = cva(\n 'flex flex-row gap-2 rounded-full w-fit border-[1.5px] p-[1.5px]',\n {\n variants: {\n color: {\n [SwitchSelectorColor.PRIMARY]: 'border-primary text-primary',\n [SwitchSelectorColor.SECONDARY]: 'border-secondary text-secondary',\n [SwitchSelectorColor.DESTRUCTIVE]:\n 'border-destructive bg-destructive text-destructive',\n [SwitchSelectorColor.NEUTRAL]: 'border-neutral text-neutral ',\n [SwitchSelectorColor.LIGHT]: 'border-white text-white',\n [SwitchSelectorColor.DARK]: 'border-neutral-800 text-neutral-800',\n [SwitchSelectorColor.TEXT]: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: SwitchSelectorColor.PRIMARY,\n },\n }\n);\n\nexport enum SwitchSelectorSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nconst choiceVariant = cva(\n 'z-1 w-full flex-1 text-sm font-medium transition-all duration-300 ease-in-out cursor-pointer aria-selected:cursor-default aria-selected:text-text-opposite motion-reduce:transition-none',\n {\n variants: {\n size: {\n [SwitchSelectorSize.SM]: 'py-1 px-2 text-xs',\n [SwitchSelectorSize.MD]: 'p-2 text-sm',\n [SwitchSelectorSize.LG]: 'p-4 text-base',\n },\n },\n defaultVariants: {\n size: SwitchSelectorSize.MD,\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n [SwitchSelectorColor.PRIMARY]: 'bg-primary aria-selected:text-text',\n [SwitchSelectorColor.SECONDARY]: 'bg-secondary aria-selected:text-text',\n [SwitchSelectorColor.DESTRUCTIVE]:\n 'bg-destructive aria-selected:text-text',\n [SwitchSelectorColor.NEUTRAL]: 'bg-neutral aria-selected:text-white ',\n [SwitchSelectorColor.LIGHT]: 'bg-white aria-selected:text-black',\n [SwitchSelectorColor.DARK]: 'bg-neutral-800 aria-selected:text-white',\n [SwitchSelectorColor.TEXT]: 'bg-text aria-selected:text-text-opposite',\n },\n },\n }\n);\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <SwitchSelector\n * choices={[\n * { content: 'Option 1', value: 'option1' },\n * { content: 'Option 2', value: 'option2' },\n * { content: 'Option 3', value: 'option3' },\n * ]}\n * value=\"option1\"\n * onChange={(choice) => console.log(choice)}\n * />\n * ```\n */\nexport const SwitchSelector = <T,>({\n choices = defaultChoices as SwitchSelectorChoices<T>,\n value,\n defaultValue,\n onChange,\n color = SwitchSelectorColor.PRIMARY,\n size = SwitchSelectorSize.MD,\n className,\n}: SwitchSelectorProps<T>) => {\n const [valueState, setValue] = useState<T>(\n value ?? defaultValue ?? choices[0].value\n );\n const optionsRefs = useRef<HTMLButtonElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(optionsRefs);\n\n const handleChange = (newValue: T) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n useEffect(() => {\n if (value === undefined) return;\n setValue(value);\n }, [value]);\n\n return (\n <div\n className={switchSelectorVariant({\n color,\n className,\n })}\n role=\"tablist\"\n >\n <div className=\"relative flex size-full flex-row items-center justify-center\">\n {choices.map((choice, index) => {\n const { content, value, ...buttonProps } = choice;\n\n const isKeyOfKey =\n typeof value === 'string' || typeof value === 'number';\n\n const isSelected = value === valueState;\n\n return (\n <button\n {...buttonProps}\n className={cn(\n choiceVariant({\n size,\n })\n )}\n key={isKeyOfKey ? value : index}\n role=\"tab\"\n onClick={() => handleChange(value)}\n aria-selected={isSelected}\n disabled={isSelected}\n ref={(el) => {\n optionsRefs.current[index] = el!;\n }}\n >\n {content}\n </button>\n );\n })}\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["SwitchSelectorColor","cva","SwitchSelectorSize","useState","useRef","useItemSelector","useEffect","jsx","jsxs","value","createElement","cn"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/SwitchSelector/index.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nexport type SwitchSelectorChoice<T = boolean> = {\n content: ReactNode;\n value: T;\n} & HTMLAttributes<HTMLButtonElement>;\nexport type SwitchSelectorChoices<T> = SwitchSelectorChoice<T>[];\n\nconst defaultChoices: SwitchSelectorChoices<boolean> = [\n { content: 'Off', value: false },\n { content: 'On', value: true },\n];\n\nexport type SwitchSelectorProps<T = boolean> = {\n choices?: SwitchSelectorChoices<T>;\n value?: T;\n defaultValue?: T;\n onChange?: (choice: T) => void;\n className?: string;\n} & VariantProps<typeof switchSelectorVariant> &\n VariantProps<typeof choiceVariant>;\n\nexport enum SwitchSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst switchSelectorVariant = cva(\n 'flex flex-row gap-2 rounded-full w-fit border-[1.5px] p-[1.5px]',\n {\n variants: {\n color: {\n [SwitchSelectorColor.PRIMARY]: 'border-primary text-primary',\n [SwitchSelectorColor.SECONDARY]: 'border-secondary text-secondary',\n [SwitchSelectorColor.DESTRUCTIVE]:\n 'border-destructive bg-destructive text-destructive',\n [SwitchSelectorColor.NEUTRAL]: 'border-neutral text-neutral ',\n [SwitchSelectorColor.LIGHT]: 'border-white text-white',\n [SwitchSelectorColor.DARK]: 'border-neutral-800 text-neutral-800',\n [SwitchSelectorColor.TEXT]: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: SwitchSelectorColor.PRIMARY,\n },\n }\n);\n\nexport enum SwitchSelectorSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nconst choiceVariant = cva(\n 'z-1 w-full flex-1 text-sm font-medium transition-all duration-300 ease-in-out cursor-pointer aria-selected:cursor-default aria-selected:text-text-opposite motion-reduce:transition-none',\n {\n variants: {\n size: {\n [SwitchSelectorSize.SM]: 'py-1 px-2 text-xs',\n [SwitchSelectorSize.MD]: 'p-2 text-sm',\n [SwitchSelectorSize.LG]: 'p-4 text-base',\n },\n },\n defaultVariants: {\n size: SwitchSelectorSize.MD,\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n [SwitchSelectorColor.PRIMARY]: 'bg-primary aria-selected:text-text',\n [SwitchSelectorColor.SECONDARY]: 'bg-secondary aria-selected:text-text',\n [SwitchSelectorColor.DESTRUCTIVE]:\n 'bg-destructive aria-selected:text-text',\n [SwitchSelectorColor.NEUTRAL]: 'bg-neutral aria-selected:text-white ',\n [SwitchSelectorColor.LIGHT]: 'bg-white aria-selected:text-black',\n [SwitchSelectorColor.DARK]: 'bg-neutral-800 aria-selected:text-white',\n [SwitchSelectorColor.TEXT]: 'bg-text aria-selected:text-text-opposite',\n },\n },\n }\n);\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <SwitchSelector\n * choices={[\n * { content: 'Option 1', value: 'option1' },\n * { content: 'Option 2', value: 'option2' },\n * { content: 'Option 3', value: 'option3' },\n * ]}\n * value=\"option1\"\n * onChange={(choice) => console.log(choice)}\n * />\n * ```\n */\nexport const SwitchSelector = <T,>({\n choices = defaultChoices as SwitchSelectorChoices<T>,\n value,\n defaultValue,\n onChange,\n color = SwitchSelectorColor.PRIMARY,\n size = SwitchSelectorSize.MD,\n className,\n}: SwitchSelectorProps<T>) => {\n const [valueState, setValue] = useState<T>(\n value ?? defaultValue ?? choices[0].value\n );\n const optionsRefs = useRef<HTMLButtonElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(optionsRefs);\n\n const handleChange = (newValue: T) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n useEffect(() => {\n if (value === undefined) return;\n setValue(value);\n }, [value]);\n\n return (\n <div\n className={switchSelectorVariant({\n color,\n className,\n })}\n role=\"tablist\"\n >\n <div className=\"relative flex size-full flex-row items-center justify-center\">\n {choices.map((choice, index) => {\n const { content, value, ...buttonProps } = choice;\n\n const isKeyOfKey =\n typeof value === 'string' || typeof value === 'number';\n\n const isSelected = value === valueState;\n\n return (\n <button\n {...buttonProps}\n className={cn(\n choiceVariant({\n size,\n })\n )}\n key={isKeyOfKey ? value : index}\n role=\"tab\"\n onClick={() => handleChange(value)}\n aria-selected={isSelected}\n disabled={isSelected}\n ref={(el) => {\n optionsRefs.current[index] = el!;\n }}\n >\n {content}\n </button>\n );\n })}\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["SwitchSelectorColor","cva","SwitchSelectorSize","useState","useRef","useItemSelector","useEffect","jsx","jsxs","value","createElement","cn"],"mappings":";;;;;;;;;;;;;;AAmBA,MAAM,iBAAiD;AAAA,EACrD,EAAE,SAAS,OAAO,OAAO,MAAA;AAAA,EACzB,EAAE,SAAS,MAAM,OAAO,KAAA;AAC1B;AAWO,IAAK,wCAAAA,yBAAL;AACLA,uBAAA,SAAA,IAAU;AACVA,uBAAA,WAAA,IAAY;AACZA,uBAAA,aAAA,IAAc;AACdA,uBAAA,SAAA,IAAU;AACVA,uBAAA,OAAA,IAAQ;AACRA,uBAAA,MAAA,IAAO;AACPA,uBAAA,MAAA,IAAO;AAPG,SAAAA;AAAA,GAAA,uBAAA,CAAA,CAAA;AAUZ,MAAM,wB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cAAA;AAAA,cAEH,KAAK,aAAaF,SAAQ;AAAA,cAC1B,MAAK;AAAA,cACL,SAAS,MAAM,aAAaA,MAAK;AAAA,cACjC,iBAAe;AAAA,cACf,UAAU;AAAA,cACV,KAAK,CAAC,OAAO;AACX,4BAAY,QAAQ,KAAK,IAAI;AAAA,cAC/B;AAAA,YAAA;AAAA,YAEC;AAAA,UAAA;AAAA,QAGP,CAAC;AAAA,QACA,2BACCF,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWI,SAAAA;AAAAA,cACT,iBAAiB;AAAA,gBACf;AAAA,cAAA,CACD;AAAA,YAAA;AAAA,YAEH,OAAO;AAAA,YACP,KAAK;AAAA,UAAA;AAAA,QAAA;AAAA,MACP,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;;;;"}
|
|
@@ -5,10 +5,8 @@ import { cva } from "class-variance-authority";
|
|
|
5
5
|
import "@intlayer/config/built";
|
|
6
6
|
import "../../better-auth.CMQ3rA-I-7umXOENE.js";
|
|
7
7
|
import "@intlayer/editor-react";
|
|
8
|
-
import "
|
|
9
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
8
|
+
import "@tanstack/react-query";
|
|
10
9
|
import "@intlayer/api";
|
|
11
|
-
import "deepmerge";
|
|
12
10
|
import { useItemSelector } from "../../hooks/useItemSelector.mjs";
|
|
13
11
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
14
12
|
import { cn } from "../../utils/cn.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../src/components/SwitchSelector/index.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nexport type SwitchSelectorChoice<T = boolean> = {\n content: ReactNode;\n value: T;\n} & HTMLAttributes<HTMLButtonElement>;\nexport type SwitchSelectorChoices<T> = SwitchSelectorChoice<T>[];\n\nconst defaultChoices: SwitchSelectorChoices<boolean> = [\n { content: 'Off', value: false },\n { content: 'On', value: true },\n];\n\nexport type SwitchSelectorProps<T = boolean> = {\n choices?: SwitchSelectorChoices<T>;\n value?: T;\n defaultValue?: T;\n onChange?: (choice: T) => void;\n className?: string;\n} & VariantProps<typeof switchSelectorVariant> &\n VariantProps<typeof choiceVariant>;\n\nexport enum SwitchSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst switchSelectorVariant = cva(\n 'flex flex-row gap-2 rounded-full w-fit border-[1.5px] p-[1.5px]',\n {\n variants: {\n color: {\n [SwitchSelectorColor.PRIMARY]: 'border-primary text-primary',\n [SwitchSelectorColor.SECONDARY]: 'border-secondary text-secondary',\n [SwitchSelectorColor.DESTRUCTIVE]:\n 'border-destructive bg-destructive text-destructive',\n [SwitchSelectorColor.NEUTRAL]: 'border-neutral text-neutral ',\n [SwitchSelectorColor.LIGHT]: 'border-white text-white',\n [SwitchSelectorColor.DARK]: 'border-neutral-800 text-neutral-800',\n [SwitchSelectorColor.TEXT]: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: SwitchSelectorColor.PRIMARY,\n },\n }\n);\n\nexport enum SwitchSelectorSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nconst choiceVariant = cva(\n 'z-1 w-full flex-1 text-sm font-medium transition-all duration-300 ease-in-out cursor-pointer aria-selected:cursor-default aria-selected:text-text-opposite motion-reduce:transition-none',\n {\n variants: {\n size: {\n [SwitchSelectorSize.SM]: 'py-1 px-2 text-xs',\n [SwitchSelectorSize.MD]: 'p-2 text-sm',\n [SwitchSelectorSize.LG]: 'p-4 text-base',\n },\n },\n defaultVariants: {\n size: SwitchSelectorSize.MD,\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n [SwitchSelectorColor.PRIMARY]: 'bg-primary aria-selected:text-text',\n [SwitchSelectorColor.SECONDARY]: 'bg-secondary aria-selected:text-text',\n [SwitchSelectorColor.DESTRUCTIVE]:\n 'bg-destructive aria-selected:text-text',\n [SwitchSelectorColor.NEUTRAL]: 'bg-neutral aria-selected:text-white ',\n [SwitchSelectorColor.LIGHT]: 'bg-white aria-selected:text-black',\n [SwitchSelectorColor.DARK]: 'bg-neutral-800 aria-selected:text-white',\n [SwitchSelectorColor.TEXT]: 'bg-text aria-selected:text-text-opposite',\n },\n },\n }\n);\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <SwitchSelector\n * choices={[\n * { content: 'Option 1', value: 'option1' },\n * { content: 'Option 2', value: 'option2' },\n * { content: 'Option 3', value: 'option3' },\n * ]}\n * value=\"option1\"\n * onChange={(choice) => console.log(choice)}\n * />\n * ```\n */\nexport const SwitchSelector = <T,>({\n choices = defaultChoices as SwitchSelectorChoices<T>,\n value,\n defaultValue,\n onChange,\n color = SwitchSelectorColor.PRIMARY,\n size = SwitchSelectorSize.MD,\n className,\n}: SwitchSelectorProps<T>) => {\n const [valueState, setValue] = useState<T>(\n value ?? defaultValue ?? choices[0].value\n );\n const optionsRefs = useRef<HTMLButtonElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(optionsRefs);\n\n const handleChange = (newValue: T) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n useEffect(() => {\n if (value === undefined) return;\n setValue(value);\n }, [value]);\n\n return (\n <div\n className={switchSelectorVariant({\n color,\n className,\n })}\n role=\"tablist\"\n >\n <div className=\"relative flex size-full flex-row items-center justify-center\">\n {choices.map((choice, index) => {\n const { content, value, ...buttonProps } = choice;\n\n const isKeyOfKey =\n typeof value === 'string' || typeof value === 'number';\n\n const isSelected = value === valueState;\n\n return (\n <button\n {...buttonProps}\n className={cn(\n choiceVariant({\n size,\n })\n )}\n key={isKeyOfKey ? value : index}\n role=\"tab\"\n onClick={() => handleChange(value)}\n aria-selected={isSelected}\n disabled={isSelected}\n ref={(el) => {\n optionsRefs.current[index] = el!;\n }}\n >\n {content}\n </button>\n );\n })}\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["SwitchSelectorColor","SwitchSelectorSize","value"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../src/components/SwitchSelector/index.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n useEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nexport type SwitchSelectorChoice<T = boolean> = {\n content: ReactNode;\n value: T;\n} & HTMLAttributes<HTMLButtonElement>;\nexport type SwitchSelectorChoices<T> = SwitchSelectorChoice<T>[];\n\nconst defaultChoices: SwitchSelectorChoices<boolean> = [\n { content: 'Off', value: false },\n { content: 'On', value: true },\n];\n\nexport type SwitchSelectorProps<T = boolean> = {\n choices?: SwitchSelectorChoices<T>;\n value?: T;\n defaultValue?: T;\n onChange?: (choice: T) => void;\n className?: string;\n} & VariantProps<typeof switchSelectorVariant> &\n VariantProps<typeof choiceVariant>;\n\nexport enum SwitchSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst switchSelectorVariant = cva(\n 'flex flex-row gap-2 rounded-full w-fit border-[1.5px] p-[1.5px]',\n {\n variants: {\n color: {\n [SwitchSelectorColor.PRIMARY]: 'border-primary text-primary',\n [SwitchSelectorColor.SECONDARY]: 'border-secondary text-secondary',\n [SwitchSelectorColor.DESTRUCTIVE]:\n 'border-destructive bg-destructive text-destructive',\n [SwitchSelectorColor.NEUTRAL]: 'border-neutral text-neutral ',\n [SwitchSelectorColor.LIGHT]: 'border-white text-white',\n [SwitchSelectorColor.DARK]: 'border-neutral-800 text-neutral-800',\n [SwitchSelectorColor.TEXT]: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: SwitchSelectorColor.PRIMARY,\n },\n }\n);\n\nexport enum SwitchSelectorSize {\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n}\n\nconst choiceVariant = cva(\n 'z-1 w-full flex-1 text-sm font-medium transition-all duration-300 ease-in-out cursor-pointer aria-selected:cursor-default aria-selected:text-text-opposite motion-reduce:transition-none',\n {\n variants: {\n size: {\n [SwitchSelectorSize.SM]: 'py-1 px-2 text-xs',\n [SwitchSelectorSize.MD]: 'p-2 text-sm',\n [SwitchSelectorSize.LG]: 'p-4 text-base',\n },\n },\n defaultVariants: {\n size: SwitchSelectorSize.MD,\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-full transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n [SwitchSelectorColor.PRIMARY]: 'bg-primary aria-selected:text-text',\n [SwitchSelectorColor.SECONDARY]: 'bg-secondary aria-selected:text-text',\n [SwitchSelectorColor.DESTRUCTIVE]:\n 'bg-destructive aria-selected:text-text',\n [SwitchSelectorColor.NEUTRAL]: 'bg-neutral aria-selected:text-white ',\n [SwitchSelectorColor.LIGHT]: 'bg-white aria-selected:text-black',\n [SwitchSelectorColor.DARK]: 'bg-neutral-800 aria-selected:text-white',\n [SwitchSelectorColor.TEXT]: 'bg-text aria-selected:text-text-opposite',\n },\n },\n }\n);\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <SwitchSelector\n * choices={[\n * { content: 'Option 1', value: 'option1' },\n * { content: 'Option 2', value: 'option2' },\n * { content: 'Option 3', value: 'option3' },\n * ]}\n * value=\"option1\"\n * onChange={(choice) => console.log(choice)}\n * />\n * ```\n */\nexport const SwitchSelector = <T,>({\n choices = defaultChoices as SwitchSelectorChoices<T>,\n value,\n defaultValue,\n onChange,\n color = SwitchSelectorColor.PRIMARY,\n size = SwitchSelectorSize.MD,\n className,\n}: SwitchSelectorProps<T>) => {\n const [valueState, setValue] = useState<T>(\n value ?? defaultValue ?? choices[0].value\n );\n const optionsRefs = useRef<HTMLButtonElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(optionsRefs);\n\n const handleChange = (newValue: T) => {\n setValue(newValue);\n onChange?.(newValue);\n };\n\n useEffect(() => {\n if (value === undefined) return;\n setValue(value);\n }, [value]);\n\n return (\n <div\n className={switchSelectorVariant({\n color,\n className,\n })}\n role=\"tablist\"\n >\n <div className=\"relative flex size-full flex-row items-center justify-center\">\n {choices.map((choice, index) => {\n const { content, value, ...buttonProps } = choice;\n\n const isKeyOfKey =\n typeof value === 'string' || typeof value === 'number';\n\n const isSelected = value === valueState;\n\n return (\n <button\n {...buttonProps}\n className={cn(\n choiceVariant({\n size,\n })\n )}\n key={isKeyOfKey ? value : index}\n role=\"tab\"\n onClick={() => handleChange(value)}\n aria-selected={isSelected}\n disabled={isSelected}\n ref={(el) => {\n optionsRefs.current[index] = el!;\n }}\n >\n {content}\n </button>\n );\n })}\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["SwitchSelectorColor","SwitchSelectorSize","value"],"mappings":";;;;;;;;;;;;AAmBA,MAAM,iBAAiD;AAAA,EACrD,EAAE,SAAS,OAAO,OAAO,MAAA;AAAA,EACzB,EA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OA,WAAU,YAAY,OAAOA,WAAU;AAEhD,gBAAM,aAAaA,WAAU;AAE7B,iBACE;AAAA,YAAC;AAAA,YAAA;AAAA,cACE,GAAG;AAAA,cACJ,WAAW;AAAA,gBACT,cAAc;AAAA,kBACZ;AAAA,gBAAA,CACD;AAAA,cAAA;AAAA,cAEH,KAAK,aAAaA,SAAQ;AAAA,cAC1B,MAAK;AAAA,cACL,SAAS,MAAM,aAAaA,MAAK;AAAA,cACjC,iBAAe;AAAA,cACf,UAAU;AAAA,cACV,KAAK,CAAC,OAAO;AACX,4BAAY,QAAQ,KAAK,IAAI;AAAA,cAC/B;AAAA,YAAA;AAAA,YAEC;AAAA,UAAA;AAAA,QAGP,CAAC;AAAA,QACA,2BACC;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAW;AAAA,cACT,iBAAiB;AAAA,gBACf;AAAA,cAAA,CACD;AAAA,YAAA;AAAA,YAEH,OAAO;AAAA,YACP,KAAK;AAAA,UAAA;AAAA,QAAA;AAAA,MACP,EAAA,CAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;"}
|
|
@@ -7,10 +7,8 @@ const ReactExports = require("react");
|
|
|
7
7
|
require("@intlayer/config/built");
|
|
8
8
|
require("../../better-auth.CMQ3rA-I-C2nBKRMa.cjs");
|
|
9
9
|
require("@intlayer/editor-react");
|
|
10
|
-
require("
|
|
11
|
-
require("../../hooks/useAsync/useAsyncStateStore.cjs");
|
|
10
|
+
require("@tanstack/react-query");
|
|
12
11
|
require("@intlayer/api");
|
|
13
|
-
require("deepmerge");
|
|
14
12
|
const hooks_useItemSelector = require("../../hooks/useItemSelector.cjs");
|
|
15
13
|
require("../../hooks/useScrollBlockage/useScrollBlockageStore.cjs");
|
|
16
14
|
const utils_cn = require("../../utils/cn.cjs");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabSelector.cjs","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n cloneElement,\n useRef,\n type HTMLAttributes,\n type ReactElement,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nexport enum TabSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary: 'border-primary text-primary',\n secondary: 'border-secondary text-secondary',\n destructive: 'border-destructive bg-destructive text-destructive',\n neutral: 'border-neutral text-neutral ',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-lg transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary: 'bg-primary/10 aria-selected:text-text',\n secondary: 'bg-secondary/10 aria-selected:text-text',\n destructive: 'bg-destructive/10 aria-selected:text-text',\n neutral: 'bg-neutral/10 aria-selected:text-white/10',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-opposite',\n },\n },\n }\n);\n\nexport type TabProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\ntype TabSelectorProps<T extends TabProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n} & HTMLAttributes<HTMLElement> &\n Omit<VariantProps<typeof tabSelectorVariant>, 'color'> & {\n color?: TabSelectorColor
|
|
1
|
+
{"version":3,"file":"TabSelector.cjs","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n cloneElement,\n useRef,\n type HTMLAttributes,\n type ReactElement,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nexport enum TabSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary: 'border-primary text-primary',\n secondary: 'border-secondary text-secondary',\n destructive: 'border-destructive bg-destructive text-destructive',\n neutral: 'border-neutral text-neutral ',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-lg transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary: 'bg-primary/10 aria-selected:text-text',\n secondary: 'bg-secondary/10 aria-selected:text-text',\n destructive: 'bg-destructive/10 aria-selected:text-text',\n neutral: 'bg-neutral/10 aria-selected:text-white/10',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-opposite',\n },\n },\n }\n);\n\nexport type TabProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\ntype TabSelectorProps<T extends TabProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n} & HTMLAttributes<HTMLElement> &\n Omit<VariantProps<typeof tabSelectorVariant>, 'color'> & {\n color?: TabSelectorColor | `${TabSelectorColor}`;\n };\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <TabSelector\n * selectedChoice=\"option1\"\n * onTabClick={(choice) => console.log(choice)}\n * hoverable={true}\n * >\n * <Button key=\"option1\"/>\n * <Button key=\"option2\"/>\n * <Button key=\"option3\"/>\n * </TabSelector>\n * ```\n */\nexport const TabSelector = <T extends TabProps>({\n tabs,\n selectedChoice,\n onTabClick,\n color = TabSelectorColor.PRIMARY,\n hoverable = false,\n className,\n}: TabSelectorProps<T>) => {\n const optionsRefs = useRef<HTMLElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(\n optionsRefs,\n undefined,\n hoverable\n );\n\n return (\n <div\n className={cn(\n tabSelectorVariant({\n color,\n }),\n className\n )}\n aria-orientation=\"horizontal\"\n aria-multiselectable=\"false\"\n role=\"tablist\"\n >\n {tabs.map((Tab, index) => {\n const key = Tab.key!;\n\n const isSelected = selectedChoice === key;\n\n return cloneElement(Tab, {\n key: key ?? index,\n role: 'tab',\n onClick: () => onTabClick?.(key),\n 'aria-selected': isSelected,\n ref: (el: HTMLElement) => {\n optionsRefs.current[index] = el!;\n },\n } as unknown as T);\n })}\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n key={`${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`}\n />\n )}\n </div>\n );\n};\n"],"names":["TabSelectorColor","cva","useRef","useItemSelector","jsxs","cn","cloneElement","jsx"],"mappings":";;;;;;;;;;;;;;AAYO,IAAK,qCAAAA,sBAAL;AACLA,oBAAA,SAAA,IAAU;AACVA,oBAAA,WAAA,IAAY;AACZA,oBAAA,aAAA,IAAc;AACdA,oBAAA,SAAA,IAAU;AACVA,oBAAA,OAAA,IAAQ;AACRA,oBAAA,MAAA,IAAO;AACPA,oBAAA,MAAA,IAAO;AAPG,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAUZ,MAAM,qBAAqBC,uBAAAA;AAAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;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AAI;AAAA,YAC/B;AAAA,UAAA,CACe;AAAA,QACnB,CAAC;AAAA,QACA,2BACCC,2BAAAA;AAAAA,UAAC;AAAA,UAAA;AAAA,YACC,WAAWF,SAAAA;AAAAA,cACT,iBAAiB;AAAA,gBACf;AAAA,cAAA,CACD;AAAA,YAAA;AAAA,YAEH,OAAO;AAAA,YACP,KAAK;AAAA,UAAA;AAAA,UACA,GAAG,cAAc,GAAG,KAAK,UAAU,KAAK,IAAI,CAAC,QAAQ,IAAI,GAAG,CAAC,CAAC;AAAA,QAAA;AAAA,MACrE;AAAA,IAAA;AAAA,EAAA;AAIR;;;"}
|
|
@@ -21,7 +21,7 @@ type TabSelectorProps<T extends TabProps> = {
|
|
|
21
21
|
onTabClick?: (choice: T['key']) => void;
|
|
22
22
|
hoverable?: boolean;
|
|
23
23
|
} & HTMLAttributes<HTMLElement> & Omit<VariantProps<typeof tabSelectorVariant>, 'color'> & {
|
|
24
|
-
color?: TabSelectorColor
|
|
24
|
+
color?: TabSelectorColor | `${TabSelectorColor}`;
|
|
25
25
|
};
|
|
26
26
|
/**
|
|
27
27
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabSelector.d.ts","sourceRoot":"","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,YAAY,EAClB,MAAM,OAAO,CAAC;AAIf,oBAAY,gBAAgB;IAC1B,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;CACd;AAED,QAAA,MAAM,kBAAkB;;8EAkBvB,CAAC;AAmBF,MAAM,MAAM,QAAQ,GAAG,cAAc,CAAC,WAAW,CAAC,GAAG;IACnD,GAAG,EAAE,MAAM,GAAG,MAAM,C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,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,cAAc,CAAC,WAAW,CAAC,GAC7B,IAAI,CAAC,YAAY,CAAC,OAAO,kBAAkB,CAAC,EAAE,OAAO,CAAC,GAAG;IACvD,KAAK,CAAC,EAAE,gBAAgB,GAAG,GAAG,gBAAgB,EAAE,CAAC;CAClD,CAAC;AAEJ;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,WAAW,GAAI,CAAC,SAAS,QAAQ,EAAE,oEAO7C,gBAAgB,CAAC,CAAC,CAAC,4CAkDrB,CAAC"}
|
|
@@ -5,10 +5,8 @@ import { useRef, cloneElement } from "react";
|
|
|
5
5
|
import "@intlayer/config/built";
|
|
6
6
|
import "../../better-auth.CMQ3rA-I-7umXOENE.js";
|
|
7
7
|
import "@intlayer/editor-react";
|
|
8
|
-
import "
|
|
9
|
-
import "../../hooks/useAsync/useAsyncStateStore.mjs";
|
|
8
|
+
import "@tanstack/react-query";
|
|
10
9
|
import "@intlayer/api";
|
|
11
|
-
import "deepmerge";
|
|
12
10
|
import { useItemSelector } from "../../hooks/useItemSelector.mjs";
|
|
13
11
|
import "../../hooks/useScrollBlockage/useScrollBlockageStore.mjs";
|
|
14
12
|
import { cn } from "../../utils/cn.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TabSelector.mjs","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n cloneElement,\n useRef,\n type HTMLAttributes,\n type ReactElement,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nexport enum TabSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary: 'border-primary text-primary',\n secondary: 'border-secondary text-secondary',\n destructive: 'border-destructive bg-destructive text-destructive',\n neutral: 'border-neutral text-neutral ',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-lg transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary: 'bg-primary/10 aria-selected:text-text',\n secondary: 'bg-secondary/10 aria-selected:text-text',\n destructive: 'bg-destructive/10 aria-selected:text-text',\n neutral: 'bg-neutral/10 aria-selected:text-white/10',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-opposite',\n },\n },\n }\n);\n\nexport type TabProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\ntype TabSelectorProps<T extends TabProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n} & HTMLAttributes<HTMLElement> &\n Omit<VariantProps<typeof tabSelectorVariant>, 'color'> & {\n color?: TabSelectorColor
|
|
1
|
+
{"version":3,"file":"TabSelector.mjs","sources":["../../../src/components/TabSelector/TabSelector.tsx"],"sourcesContent":["'use client';\n\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport {\n cloneElement,\n useRef,\n type HTMLAttributes,\n type ReactElement,\n} from 'react';\nimport { useItemSelector } from '../../hooks';\nimport { cn } from '../../utils/cn';\n\nexport enum TabSelectorColor {\n PRIMARY = 'primary',\n SECONDARY = 'secondary',\n DESTRUCTIVE = 'destructive',\n NEUTRAL = 'neutral',\n LIGHT = 'light',\n DARK = 'dark',\n TEXT = 'text',\n}\n\nconst tabSelectorVariant = cva(\n 'relative flex size-full flex-row items-center gap-2',\n {\n variants: {\n color: {\n primary: 'border-primary text-primary',\n secondary: 'border-secondary text-secondary',\n destructive: 'border-destructive bg-destructive text-destructive',\n neutral: 'border-neutral text-neutral ',\n light: 'border-white text-white',\n dark: 'border-neutral-800 text-neutral-800',\n text: 'border-text text-text',\n },\n },\n defaultVariants: {\n color: 'primary',\n },\n }\n);\n\nconst indicatorVariant = cva(\n 'absolute top-0 z-[-1] h-full w-auto rounded-lg transition-[left,width] duration-300 ease-in-out motion-reduce:transition-none',\n {\n variants: {\n color: {\n primary: 'bg-primary/10 aria-selected:text-text',\n secondary: 'bg-secondary/10 aria-selected:text-text',\n destructive: 'bg-destructive/10 aria-selected:text-text',\n neutral: 'bg-neutral/10 aria-selected:text-white/10',\n light: 'bg-white/10 aria-selected:text-black',\n dark: 'bg-neutral-800/10 aria-selected:text-white',\n text: 'bg-text/10 aria-selected:text-text-opposite',\n },\n },\n }\n);\n\nexport type TabProps = HTMLAttributes<HTMLElement> & {\n key: string | number;\n};\n\ntype TabSelectorProps<T extends TabProps> = {\n tabs: ReactElement<T>[];\n selectedChoice: T['key'];\n onTabClick?: (choice: T['key']) => void;\n hoverable?: boolean;\n} & HTMLAttributes<HTMLElement> &\n Omit<VariantProps<typeof tabSelectorVariant>, 'color'> & {\n color?: TabSelectorColor | `${TabSelectorColor}`;\n };\n\n/**\n *\n * Component that allows the user to select one of the provided choices.\n *\n * Example:\n * ```jsx\n * <TabSelector\n * selectedChoice=\"option1\"\n * onTabClick={(choice) => console.log(choice)}\n * hoverable={true}\n * >\n * <Button key=\"option1\"/>\n * <Button key=\"option2\"/>\n * <Button key=\"option3\"/>\n * </TabSelector>\n * ```\n */\nexport const TabSelector = <T extends TabProps>({\n tabs,\n selectedChoice,\n onTabClick,\n color = TabSelectorColor.PRIMARY,\n hoverable = false,\n className,\n}: TabSelectorProps<T>) => {\n const optionsRefs = useRef<HTMLElement[]>([]);\n const indicatorRef = useRef<HTMLDivElement | null>(null);\n const { choiceIndicatorPosition } = useItemSelector(\n optionsRefs,\n undefined,\n hoverable\n );\n\n return (\n <div\n className={cn(\n tabSelectorVariant({\n color,\n }),\n className\n )}\n aria-orientation=\"horizontal\"\n aria-multiselectable=\"false\"\n role=\"tablist\"\n >\n {tabs.map((Tab, index) => {\n const key = Tab.key!;\n\n const isSelected = selectedChoice === key;\n\n return cloneElement(Tab, {\n key: key ?? index,\n role: 'tab',\n onClick: () => onTabClick?.(key),\n 'aria-selected': isSelected,\n ref: (el: HTMLElement) => {\n optionsRefs.current[index] = el!;\n },\n } as unknown as T);\n })}\n {choiceIndicatorPosition && (\n <div\n className={cn(\n indicatorVariant({\n color,\n })\n )}\n style={choiceIndicatorPosition}\n ref={indicatorRef}\n key={`${selectedChoice}${JSON.stringify(tabs.map((tab) => tab.key))}`}\n />\n )}\n </div>\n );\n};\n"],"names":["TabSelectorColor"],"mappings":";;;;;;;;;;;;AAYO,IAAK,qCAAAA,sBAAL;AACLA,oBAAA,SAAA,IAAU;AACVA,oBAAA,WAAA,IAAY;AACZA,oBAAA,aAAA,IAAc;AACdA,oBAAA,SAAA,IAAU;AACVA,oBAAA,OAAA,IAAQ;AACRA,oBAAA,MAAA,IAAO;AACPA,oBAAA,MAAA,IAAO;AAPG,SAAAA;AAAA,GAAA,oBAAA,CAAA,CAAA;AAUZ,MAAM,qBAAqB;AAAA,EACzB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,QACT,WAAW;AAAA,QACX,aAAa;AAAA,QACb,SAAS;AAAA,QACT,OAAO;AAAA,QACP,MAAM;AAAA,QACN,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,IAEF,iBAAiB;AAAA,MACf,OAAO;AAAA,IAAA;AAAA,EACT;AAEJ;AAEA,MAAM,mBAAmB;AAAA,EACvB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,SAAS;AAAA,QACT,WAAW;AAAA,QACX,aAAa;AAAA,QACb,SAAS;AAAA,QACT,OAAO;AAAA,QACP,MAAM;AAAA,QACN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
4
4
|
key: "table",
|
|
5
|
+
autoFill: "./{{key}}.content.json",
|
|
5
6
|
content: {
|
|
6
7
|
show: intlayer.t({
|
|
7
8
|
en: "Show all table content",
|
|
@@ -16,7 +17,8 @@ const tableContent = {
|
|
|
16
17
|
pt: "Mostrar todo o conteúdo da tabela",
|
|
17
18
|
hi: "सभी तालिका सामग्री दिखाएं",
|
|
18
19
|
ar: "اظهار جميع محتويات الجدول",
|
|
19
|
-
ru: "Показать все данные таблицы"
|
|
20
|
+
ru: "Показать все данные таблицы",
|
|
21
|
+
tr: "Tüm tablo içeriğini göster"
|
|
20
22
|
})
|
|
21
23
|
}
|
|
22
24
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.content.cjs","sources":["../../../src/components/Table/table.content.ts"],"sourcesContent":["import { t, type Dictionary } from 'intlayer';\n\nconst tableContent = {\n key: 'table',\n content: {\n show: t({\n en: 'Show all table content',\n fr: 'Afficher tout le contenu du tableau',\n es: 'Mostrar todo el contenido de la tabla',\n 'en-GB': 'Show all table content',\n de: 'Alle Tabellendaten anzeigen',\n ja: 'テーブルのすべての内容を表示',\n ko: '테이블의 모든 내용 표시',\n zh: '显示表格的所有内容',\n it: 'Mostra tutto il contenuto della tabella',\n pt: 'Mostrar todo o conteúdo da tabela',\n hi: 'सभी तालिका सामग्री दिखाएं',\n ar: 'اظهار جميع محتويات الجدول',\n ru: 'Показать все данные таблицы',\n }),\n },\n} satisfies Dictionary;\n\nexport default tableContent;\n"],"names":["t"],"mappings":";;AAEA,MAAM,eAAe;AAAA,EACnB,KAAK;AAAA,EACL,SAAS;AAAA,IACP,MAAMA,SAAAA,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,EAAA;AAEL;;"}
|
|
1
|
+
{"version":3,"file":"table.content.cjs","sources":["../../../src/components/Table/table.content.ts"],"sourcesContent":["import { t, type Dictionary } from 'intlayer';\n\nconst tableContent = {\n key: 'table',\n autoFill: './{{key}}.content.json',\n content: {\n show: t({\n en: 'Show all table content',\n fr: 'Afficher tout le contenu du tableau',\n es: 'Mostrar todo el contenido de la tabla',\n 'en-GB': 'Show all table content',\n de: 'Alle Tabellendaten anzeigen',\n ja: 'テーブルのすべての内容を表示',\n ko: '테이블의 모든 내용 표시',\n zh: '显示表格的所有内容',\n it: 'Mostra tutto il contenuto della tabella',\n pt: 'Mostrar todo o conteúdo da tabela',\n hi: 'सभी तालिका सामग्री दिखाएं',\n ar: 'اظهار جميع محتويات الجدول',\n ru: 'Показать все данные таблицы',\n tr: 'Tüm tablo içeriğini göster',\n }),\n },\n} satisfies Dictionary;\n\nexport default tableContent;\n"],"names":["t"],"mappings":";;AAEA,MAAM,eAAe;AAAA,EACnB,KAAK;AAAA,EACL,UAAU;AAAA,EACV,SAAS;AAAA,IACP,MAAMA,SAAAA,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,EAAA;AAEL;;"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const tableContent: {
|
|
2
2
|
key: string;
|
|
3
|
+
autoFill: string;
|
|
3
4
|
content: {
|
|
4
5
|
show: import('@intlayer/core').TypedNodeModel<import("@intlayer/core").NodeType.Translation, {
|
|
5
6
|
en: string;
|
|
@@ -15,6 +16,7 @@ declare const tableContent: {
|
|
|
15
16
|
hi: string;
|
|
16
17
|
ar: string;
|
|
17
18
|
ru: string;
|
|
19
|
+
tr: string;
|
|
18
20
|
}, {
|
|
19
21
|
nodeType: import("@intlayer/core").NodeType.Translation | "translation";
|
|
20
22
|
} & {
|
|
@@ -32,6 +34,7 @@ declare const tableContent: {
|
|
|
32
34
|
hi: string;
|
|
33
35
|
ar: string;
|
|
34
36
|
ru: string;
|
|
37
|
+
tr: string;
|
|
35
38
|
};
|
|
36
39
|
}>;
|
|
37
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.content.d.ts","sourceRoot":"","sources":["../../../src/components/Table/table.content.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY
|
|
1
|
+
{"version":3,"file":"table.content.d.ts","sourceRoot":"","sources":["../../../src/components/Table/table.content.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBI,CAAC;AAEvB,eAAe,YAAY,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { t } from "intlayer";
|
|
2
2
|
const tableContent = {
|
|
3
3
|
key: "table",
|
|
4
|
+
autoFill: "./{{key}}.content.json",
|
|
4
5
|
content: {
|
|
5
6
|
show: t({
|
|
6
7
|
en: "Show all table content",
|
|
@@ -15,7 +16,8 @@ const tableContent = {
|
|
|
15
16
|
pt: "Mostrar todo o conteúdo da tabela",
|
|
16
17
|
hi: "सभी तालिका सामग्री दिखाएं",
|
|
17
18
|
ar: "اظهار جميع محتويات الجدول",
|
|
18
|
-
ru: "Показать все данные таблицы"
|
|
19
|
+
ru: "Показать все данные таблицы",
|
|
20
|
+
tr: "Tüm tablo içeriğini göster"
|
|
19
21
|
})
|
|
20
22
|
}
|
|
21
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.content.mjs","sources":["../../../src/components/Table/table.content.ts"],"sourcesContent":["import { t, type Dictionary } from 'intlayer';\n\nconst tableContent = {\n key: 'table',\n content: {\n show: t({\n en: 'Show all table content',\n fr: 'Afficher tout le contenu du tableau',\n es: 'Mostrar todo el contenido de la tabla',\n 'en-GB': 'Show all table content',\n de: 'Alle Tabellendaten anzeigen',\n ja: 'テーブルのすべての内容を表示',\n ko: '테이블의 모든 내용 표시',\n zh: '显示表格的所有内容',\n it: 'Mostra tutto il contenuto della tabella',\n pt: 'Mostrar todo o conteúdo da tabela',\n hi: 'सभी तालिका सामग्री दिखाएं',\n ar: 'اظهار جميع محتويات الجدول',\n ru: 'Показать все данные таблицы',\n }),\n },\n} satisfies Dictionary;\n\nexport default tableContent;\n"],"names":[],"mappings":";AAEA,MAAM,eAAe;AAAA,EACnB,KAAK;AAAA,EACL,SAAS;AAAA,IACP,MAAM,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,EAAA;AAEL;"}
|
|
1
|
+
{"version":3,"file":"table.content.mjs","sources":["../../../src/components/Table/table.content.ts"],"sourcesContent":["import { t, type Dictionary } from 'intlayer';\n\nconst tableContent = {\n key: 'table',\n autoFill: './{{key}}.content.json',\n content: {\n show: t({\n en: 'Show all table content',\n fr: 'Afficher tout le contenu du tableau',\n es: 'Mostrar todo el contenido de la tabla',\n 'en-GB': 'Show all table content',\n de: 'Alle Tabellendaten anzeigen',\n ja: 'テーブルのすべての内容を表示',\n ko: '테이블의 모든 내용 표시',\n zh: '显示表格的所有内容',\n it: 'Mostra tutto il contenuto della tabella',\n pt: 'Mostrar todo o conteúdo da tabela',\n hi: 'सभी तालिका सामग्री दिखाएं',\n ar: 'اظهار جميع محتويات الجدول',\n ru: 'Показать все данные таблицы',\n tr: 'Tüm tablo içeriğini göster',\n }),\n },\n} satisfies Dictionary;\n\nexport default tableContent;\n"],"names":[],"mappings":";AAEA,MAAM,eAAe;AAAA,EACnB,KAAK;AAAA,EACL,UAAU;AAAA,EACV,SAAS;AAAA,IACP,MAAM,EAAE;AAAA,MACN,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,SAAS;AAAA,MACT,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,MACJ,IAAI;AAAA,IAAA,CACL;AAAA,EAAA;AAEL;"}
|
|
@@ -42,102 +42,36 @@ var TagBackground = /* @__PURE__ */ ((TagBackground2) => {
|
|
|
42
42
|
const containerVariants = classVarianceAuthority.cva("backdrop-blur w-fit", {
|
|
43
43
|
variants: {
|
|
44
44
|
roundedSize: {
|
|
45
|
-
[
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
]: "rounded-
|
|
49
|
-
[
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
]: "rounded-
|
|
53
|
-
[
|
|
54
|
-
"md"
|
|
55
|
-
/* MD */
|
|
56
|
-
]: "rounded-md",
|
|
57
|
-
[
|
|
58
|
-
"lg"
|
|
59
|
-
/* LG */
|
|
60
|
-
]: "rounded-lg",
|
|
61
|
-
[
|
|
62
|
-
"xl"
|
|
63
|
-
/* XL */
|
|
64
|
-
]: "rounded-xl",
|
|
65
|
-
[
|
|
66
|
-
"2xl"
|
|
67
|
-
/* XXL */
|
|
68
|
-
]: "rounded-2xl",
|
|
69
|
-
[
|
|
70
|
-
"3xl"
|
|
71
|
-
/* XXXL */
|
|
72
|
-
]: "rounded-3xl",
|
|
73
|
-
[
|
|
74
|
-
"full"
|
|
75
|
-
/* FULL */
|
|
76
|
-
]: "rounded-full"
|
|
45
|
+
[`${"none"}`]: "rounded-none",
|
|
46
|
+
[`${"sm"}`]: "rounded-sm",
|
|
47
|
+
[`${"md"}`]: "rounded-md",
|
|
48
|
+
[`${"lg"}`]: "rounded-lg",
|
|
49
|
+
[`${"xl"}`]: "rounded-xl",
|
|
50
|
+
[`${"2xl"}`]: "rounded-2xl",
|
|
51
|
+
[`${"3xl"}`]: "rounded-3xl",
|
|
52
|
+
[`${"full"}`]: "rounded-full"
|
|
77
53
|
},
|
|
78
54
|
color: {
|
|
79
|
-
[
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
]: "bg-
|
|
83
|
-
[
|
|
84
|
-
"error"
|
|
85
|
-
/* ERROR */
|
|
86
|
-
]: "bg-error/10 border-error text-error",
|
|
87
|
-
[
|
|
88
|
-
"warning"
|
|
89
|
-
/* WARNING */
|
|
90
|
-
]: "bg-warning/10 border-warning text-warning",
|
|
91
|
-
[
|
|
92
|
-
"neutral"
|
|
93
|
-
/* NEUTRAL */
|
|
94
|
-
]: "bg-neutral/10 /10 border-neutral text-neutral ",
|
|
95
|
-
[
|
|
96
|
-
"text"
|
|
97
|
-
/* TEXT */
|
|
98
|
-
]: "bg-text/10 border-text text-text"
|
|
55
|
+
[`${"success"}`]: "bg-success/10 border-success text-success ",
|
|
56
|
+
[`${"error"}`]: "bg-error/10 border-error text-error",
|
|
57
|
+
[`${"warning"}`]: "bg-warning/10 border-warning text-warning",
|
|
58
|
+
[`${"neutral"}`]: "bg-neutral/10 /10 border-neutral text-neutral ",
|
|
59
|
+
[`${"text"}`]: "bg-text/10 border-text text-text"
|
|
99
60
|
},
|
|
100
61
|
size: {
|
|
101
|
-
[
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
]: "py-
|
|
105
|
-
[
|
|
106
|
-
"sm"
|
|
107
|
-
/* SM */
|
|
108
|
-
]: "py-0.5 px-2 text-sm border-[1.5px]",
|
|
109
|
-
[
|
|
110
|
-
"md"
|
|
111
|
-
/* MD */
|
|
112
|
-
]: "py-1 px-2 text-base border-2",
|
|
113
|
-
[
|
|
114
|
-
"lg"
|
|
115
|
-
/* LG */
|
|
116
|
-
]: "py-2 px-3 text-lg border-2",
|
|
117
|
-
[
|
|
118
|
-
"xl"
|
|
119
|
-
/* XL */
|
|
120
|
-
]: "py-4 px-5 text-xl border-2"
|
|
62
|
+
[`${"xs"}`]: "py-0.5 px-2 text-xs border-[1.2px]",
|
|
63
|
+
[`${"sm"}`]: "py-0.5 px-2 text-sm border-[1.5px]",
|
|
64
|
+
[`${"md"}`]: "py-1 px-2 text-base border-2",
|
|
65
|
+
[`${"lg"}`]: "py-2 px-3 text-lg border-2",
|
|
66
|
+
[`${"xl"}`]: "py-4 px-5 text-xl border-2"
|
|
121
67
|
},
|
|
122
68
|
border: {
|
|
123
|
-
[
|
|
124
|
-
|
|
125
|
-
/* NONE */
|
|
126
|
-
]: "border-none",
|
|
127
|
-
[
|
|
128
|
-
"with"
|
|
129
|
-
/* WITH */
|
|
130
|
-
]: "border-text border-[1.5px]"
|
|
69
|
+
[`${"none"}`]: "border-none",
|
|
70
|
+
[`${"with"}`]: "border-text border-[1.5px]"
|
|
131
71
|
},
|
|
132
72
|
background: {
|
|
133
|
-
[
|
|
134
|
-
|
|
135
|
-
/* NONE */
|
|
136
|
-
]: "bg-none",
|
|
137
|
-
[
|
|
138
|
-
"with"
|
|
139
|
-
/* WITH */
|
|
140
|
-
]: ""
|
|
73
|
+
[`${"none"}`]: "bg-none",
|
|
74
|
+
[`${"with"}`]: ""
|
|
141
75
|
}
|
|
142
76
|
},
|
|
143
77
|
defaultVariants: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../../../src/components/Tag/index.tsx"],"sourcesContent":["import { type VariantProps, cva } from 'class-variance-authority';\nimport type { FC, HTMLAttributes, PropsWithChildren } from 'react';\n\ntype TagProps = PropsWithChildren<VariantProps<typeof containerVariants>> &\n HTMLAttributes<HTMLDivElement>;\n\nexport enum TagRoundedSize {\n NONE = 'none',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n XXL = '2xl',\n XXXL = '3xl',\n FULL = 'full',\n}\n\nexport enum TagColor {\n SUCCESS = 'success',\n ERROR = 'error',\n WARNING = 'warning',\n NEUTRAL = 'neutral',\n TEXT = 'text',\n}\n\nexport enum TagSize {\n XS = 'xs',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n}\n\nexport enum TagBorder {\n NONE = 'none',\n WITH = 'with',\n}\n\nexport enum TagBackground {\n NONE = 'none',\n WITH = 'with',\n}\n\nconst containerVariants = cva('backdrop-blur w-fit', {\n variants: {\n roundedSize: {\n [TagRoundedSize.NONE]: 'rounded-none',\n [TagRoundedSize.SM]: 'rounded-sm',\n [TagRoundedSize.MD]: 'rounded-md',\n [TagRoundedSize.LG]: 'rounded-lg',\n [TagRoundedSize.XL]: 'rounded-xl',\n [TagRoundedSize.XXL]: 'rounded-2xl',\n [TagRoundedSize.XXXL]: 'rounded-3xl',\n [TagRoundedSize.FULL]: 'rounded-full',\n },\n color: {\n [TagColor.SUCCESS]: 'bg-success/10 border-success text-success ',\n [TagColor.ERROR]: 'bg-error/10 border-error text-error',\n [TagColor.WARNING]: 'bg-warning/10 border-warning text-warning',\n [TagColor.NEUTRAL]: 'bg-neutral/10 /10 border-neutral text-neutral ',\n [TagColor.TEXT]: 'bg-text/10 border-text text-text',\n },\n size: {\n [TagSize.XS]: 'py-0.5 px-2 text-xs border-[1.2px]',\n [TagSize.SM]: 'py-0.5 px-2 text-sm border-[1.5px]',\n [TagSize.MD]: 'py-1 px-2 text-base border-2',\n [TagSize.LG]: 'py-2 px-3 text-lg border-2',\n [TagSize.XL]: 'py-4 px-5 text-xl border-2',\n },\n border: {\n [TagBorder.NONE]: 'border-none',\n [TagBorder.WITH]: 'border-text border-[1.5px]',\n },\n background: {\n [TagBackground.NONE]: 'bg-none',\n [TagBackground.WITH]: '',\n },\n },\n\n defaultVariants: {\n roundedSize: TagRoundedSize.FULL,\n border: TagBorder.NONE,\n color: TagColor.TEXT,\n size: TagSize.MD,\n },\n});\n\nexport const Tag: FC<TagProps> = ({\n children,\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n ...props\n}) => {\n return (\n <div\n className={containerVariants({\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n })}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["TagRoundedSize","TagColor","TagSize","TagBorder","TagBackground","cva","jsx"],"mappings":";;;;AAMO,IAAK,mCAAAA,oBAAL;AACLA,kBAAA,MAAA,IAAO;AACPA,kBAAA,IAAA,IAAK;AACLA,kBAAA,IAAA,IAAK;AACLA,kBAAA,IAAA,IAAK;AACLA,kBAAA,IAAA,IAAK;AACLA,kBAAA,KAAA,IAAM;AACNA,kBAAA,MAAA,IAAO;AACPA,kBAAA,MAAA,IAAO;AARG,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAWL,IAAK,6BAAAC,cAAL;AACLA,YAAA,SAAA,IAAU;AACVA,YAAA,OAAA,IAAQ;AACRA,YAAA,SAAA,IAAU;AACVA,YAAA,SAAA,IAAU;AACVA,YAAA,MAAA,IAAO;AALG,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AAQL,IAAK,4BAAAC,aAAL;AACLA,WAAA,IAAA,IAAK;AACLA,WAAA,IAAA,IAAK;AACLA,WAAA,IAAA,IAAK;AACLA,WAAA,IAAA,IAAK;AACLA,WAAA,IAAA,IAAK;AALK,SAAAA;AAAA,GAAA,WAAA,CAAA,CAAA;AAQL,IAAK,8BAAAC,eAAL;AACLA,aAAA,MAAA,IAAO;AACPA,aAAA,MAAA,IAAO;AAFG,SAAAA;AAAA,GAAA,aAAA,CAAA,CAAA;AAKL,IAAK,kCAAAC,mBAAL;AACLA,iBAAA,MAAA,IAAO;AACPA,iBAAA,MAAA,IAAO;AAFG,SAAAA;AAAA,GAAA,iBAAA,CAAA,CAAA;AAKZ,MAAM,oBAAoBC,uBAAAA,IAAI,uBAAuB;AAAA,EACnD,UAAU;AAAA,IACR,aAAa;AAAA,MACX
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../../../src/components/Tag/index.tsx"],"sourcesContent":["import { type VariantProps, cva } from 'class-variance-authority';\nimport type { FC, HTMLAttributes, PropsWithChildren } from 'react';\n\ntype TagProps = PropsWithChildren<VariantProps<typeof containerVariants>> &\n HTMLAttributes<HTMLDivElement>;\n\nexport enum TagRoundedSize {\n NONE = 'none',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n XXL = '2xl',\n XXXL = '3xl',\n FULL = 'full',\n}\n\nexport enum TagColor {\n SUCCESS = 'success',\n ERROR = 'error',\n WARNING = 'warning',\n NEUTRAL = 'neutral',\n TEXT = 'text',\n}\n\nexport enum TagSize {\n XS = 'xs',\n SM = 'sm',\n MD = 'md',\n LG = 'lg',\n XL = 'xl',\n}\n\nexport enum TagBorder {\n NONE = 'none',\n WITH = 'with',\n}\n\nexport enum TagBackground {\n NONE = 'none',\n WITH = 'with',\n}\n\nconst containerVariants = cva('backdrop-blur w-fit', {\n variants: {\n roundedSize: {\n [`${TagRoundedSize.NONE}`]: 'rounded-none',\n [`${TagRoundedSize.SM}`]: 'rounded-sm',\n [`${TagRoundedSize.MD}`]: 'rounded-md',\n [`${TagRoundedSize.LG}`]: 'rounded-lg',\n [`${TagRoundedSize.XL}`]: 'rounded-xl',\n [`${TagRoundedSize.XXL}`]: 'rounded-2xl',\n [`${TagRoundedSize.XXXL}`]: 'rounded-3xl',\n [`${TagRoundedSize.FULL}`]: 'rounded-full',\n },\n color: {\n [`${TagColor.SUCCESS}`]: 'bg-success/10 border-success text-success ',\n [`${TagColor.ERROR}`]: 'bg-error/10 border-error text-error',\n [`${TagColor.WARNING}`]: 'bg-warning/10 border-warning text-warning',\n [`${TagColor.NEUTRAL}`]: 'bg-neutral/10 /10 border-neutral text-neutral ',\n [`${TagColor.TEXT}`]: 'bg-text/10 border-text text-text',\n },\n size: {\n [`${TagSize.XS}`]: 'py-0.5 px-2 text-xs border-[1.2px]',\n [`${TagSize.SM}`]: 'py-0.5 px-2 text-sm border-[1.5px]',\n [`${TagSize.MD}`]: 'py-1 px-2 text-base border-2',\n [`${TagSize.LG}`]: 'py-2 px-3 text-lg border-2',\n [`${TagSize.XL}`]: 'py-4 px-5 text-xl border-2',\n },\n border: {\n [`${TagBorder.NONE}`]: 'border-none',\n [`${TagBorder.WITH}`]: 'border-text border-[1.5px]',\n },\n background: {\n [`${TagBackground.NONE}`]: 'bg-none',\n [`${TagBackground.WITH}`]: '',\n },\n },\n\n defaultVariants: {\n roundedSize: TagRoundedSize.FULL,\n border: TagBorder.NONE,\n color: TagColor.TEXT,\n size: TagSize.MD,\n },\n});\n\nexport const Tag: FC<TagProps> = ({\n children,\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n ...props\n}) => {\n return (\n <div\n className={containerVariants({\n color,\n roundedSize,\n size,\n border,\n background,\n className,\n })}\n {...props}\n >\n {children}\n </div>\n );\n};\n"],"names":["TagRoundedSize","TagColor","TagSize","TagBorder","TagBackground","cva","jsx"],"mappings":";;;;AAMO,IAAK,mCAAAA,oBAAL;AACLA,kBAAA,MAAA,IAAO;AACPA,kBAAA,IAAA,IAAK;AACLA,kBAAA,IAAA,IAAK;AACLA,kBAAA,IAAA,IAAK;AACLA,kBAAA,IAAA,IAAK;AACLA,kBAAA,KAAA,IAAM;AACNA,kBAAA,MAAA,IAAO;AACPA,kBAAA,MAAA,IAAO;AARG,SAAAA;AAAA,GAAA,kBAAA,CAAA,CAAA;AAWL,IAAK,6BAAAC,cAAL;AACLA,YAAA,SAAA,IAAU;AACVA,YAAA,OAAA,IAAQ;AACRA,YAAA,SAAA,IAAU;AACVA,YAAA,SAAA,IAAU;AACVA,YAAA,MAAA,IAAO;AALG,SAAAA;AAAA,GAAA,YAAA,CAAA,CAAA;AAQL,IAAK,4BAAAC,aAAL;AACLA,WAAA,IAAA,IAAK;AACLA,WAA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AA,EAAY,GAAG;AAAA,MACnB,CAAC,GAAG,IAAA,EAAY,GAAG;AAAA,IAAA;AAAA,IAErB,QAAQ;AAAA,MACN,CAAC,GAAG,MAAA,EAAgB,GAAG;AAAA,MACvB,CAAC,GAAG,MAAA,EAAgB,GAAG;AAAA,IAAA;AAAA,IAEzB,YAAY;AAAA,MACV,CAAC,GAAG,MAAA,EAAoB,GAAG;AAAA,MAC3B,CAAC,GAAG,MAAA,EAAoB,GAAG;AAAA,IAAA;AAAA,EAC7B;AAAA,EAGF,iBAAiB;AAAA,IACf,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,MAAM;AAAA;AAAA,EAAA;AAEV,CAAC;AAEM,MAAM,MAAoB,CAAC;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,GAAG;AACL,MAAM;AACJ,SACEC,2BAAAA;AAAAA,IAAC;AAAA,IAAA;AAAA,MACC,WAAW,kBAAkB;AAAA,QAC3B;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA,CACD;AAAA,MACA,GAAG;AAAA,MAEH;AAAA,IAAA;AAAA,EAAA;AAGP;;;;;;;"}
|
|
@@ -34,11 +34,11 @@ export declare enum TagBackground {
|
|
|
34
34
|
WITH = "with"
|
|
35
35
|
}
|
|
36
36
|
declare const containerVariants: (props?: ({
|
|
37
|
-
roundedSize?:
|
|
38
|
-
color?:
|
|
39
|
-
size?:
|
|
40
|
-
border?:
|
|
41
|
-
background?:
|
|
37
|
+
roundedSize?: "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full" | null | undefined;
|
|
38
|
+
color?: "text" | "neutral" | "error" | "success" | "warning" | null | undefined;
|
|
39
|
+
size?: "sm" | "md" | "lg" | "xl" | "xs" | null | undefined;
|
|
40
|
+
border?: "none" | "with" | null | undefined;
|
|
41
|
+
background?: "none" | "with" | null | undefined;
|
|
42
42
|
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
43
43
|
export declare const Tag: FC<TagProps>;
|
|
44
44
|
export {};
|