@nlabs/gothamui 1.8.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/LICENSE +21 -0
- package/MIGRATION.md +36 -0
- package/README.md +768 -0
- package/docs/assets/gothamui-app-architecture.svg +159 -0
- package/docs/assets/gothamui-logo.png +0 -0
- package/docs/assets/gothamui-logo.svg +42 -0
- package/docs/render-performance.md +34 -0
- package/lib/actions/GothamActions.d.ts +42 -0
- package/lib/actions/GothamActions.js +67 -0
- package/lib/actions/MarkdownActions.d.ts +4 -0
- package/lib/actions/MarkdownActions.js +48 -0
- package/lib/app.d.ts +1 -0
- package/lib/app.js +198 -0
- package/lib/components/Alert/Alert.d.ts +8 -0
- package/lib/components/Alert/Alert.js +24 -0
- package/lib/components/Alert/Alert.stories.js +59 -0
- package/lib/components/AuthRoute/AuthRoute.d.ts +3 -0
- package/lib/components/AuthRoute/AuthRoute.js +21 -0
- package/lib/components/AuthRoute/AuthRoute.stories.js +45 -0
- package/lib/components/AutocompleteField/AutocompleteField.d.ts +24 -0
- package/lib/components/AutocompleteField/AutocompleteField.js +148 -0
- package/lib/components/AutocompleteField/AutocompleteField.stories.js +62 -0
- package/lib/components/Avatar/Avatar.d.ts +29 -0
- package/lib/components/Avatar/Avatar.js +154 -0
- package/lib/components/Avatar/Avatar.stories.js +105 -0
- package/lib/components/Badge/Badge.d.ts +9 -0
- package/lib/components/Badge/Badge.js +22 -0
- package/lib/components/Badge/Badge.stories.js +53 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +19 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.js +74 -0
- package/lib/components/Breadcrumbs/Breadcrumbs.stories.js +95 -0
- package/lib/components/Button/Button.d.ts +25 -0
- package/lib/components/Button/Button.js +157 -0
- package/lib/components/Button/Button.stories.js +119 -0
- package/lib/components/Card/Card.d.ts +8 -0
- package/lib/components/Card/Card.js +39 -0
- package/lib/components/Card/Card.stories.js +60 -0
- package/lib/components/CategoryGrid/CategoryGrid.d.ts +15 -0
- package/lib/components/CategoryGrid/CategoryGrid.js +42 -0
- package/lib/components/CategoryGrid/CategoryGrid.stories.js +35 -0
- package/lib/components/Chat/AudioMessage/AudioMessage.css +1 -0
- package/lib/components/Chat/AudioMessage/AudioMessage.d.ts +3 -0
- package/lib/components/Chat/AudioMessage/AudioMessage.js +28 -0
- package/lib/components/Chat/Avatar/Avatar.css +1 -0
- package/lib/components/Chat/Avatar/Avatar.d.ts +3 -0
- package/lib/components/Chat/Avatar/Avatar.js +72 -0
- package/lib/components/Chat/Button/Button.css +1 -0
- package/lib/components/Chat/Button/Button.d.ts +3 -0
- package/lib/components/Chat/Button/Button.js +37 -0
- package/lib/components/Chat/Chat.stories.js +688 -0
- package/lib/components/Chat/ChatItem/ChatItem.css +1 -0
- package/lib/components/Chat/ChatItem/ChatItem.d.ts +3 -0
- package/lib/components/Chat/ChatItem/ChatItem.js +183 -0
- package/lib/components/Chat/ChatList/ChatList.css +1 -0
- package/lib/components/Chat/ChatList/ChatList.d.ts +3 -0
- package/lib/components/Chat/ChatList/ChatList.js +84 -0
- package/lib/components/Chat/Circle/Circle.d.ts +3 -0
- package/lib/components/Chat/Circle/Circle.js +27 -0
- package/lib/components/Chat/Dropdown/Dropdown.css +1 -0
- package/lib/components/Chat/Dropdown/Dropdown.d.ts +3 -0
- package/lib/components/Chat/Dropdown/Dropdown.js +66 -0
- package/lib/components/Chat/FileMessage/FileMessage.css +1 -0
- package/lib/components/Chat/FileMessage/FileMessage.d.ts +3 -0
- package/lib/components/Chat/FileMessage/FileMessage.js +77 -0
- package/lib/components/Chat/Input/Input.css +1 -0
- package/lib/components/Chat/Input/Input.d.ts +3 -0
- package/lib/components/Chat/Input/Input.js +108 -0
- package/lib/components/Chat/LocationMessage/LocationMessage.css +1 -0
- package/lib/components/Chat/LocationMessage/LocationMessage.d.ts +3 -0
- package/lib/components/Chat/LocationMessage/LocationMessage.js +36 -0
- package/lib/components/Chat/MeetingItem/MeetingItem.css +1 -0
- package/lib/components/Chat/MeetingItem/MeetingItem.d.ts +3 -0
- package/lib/components/Chat/MeetingItem/MeetingItem.js +106 -0
- package/lib/components/Chat/MeetingLink/MeetingLink.css +1 -0
- package/lib/components/Chat/MeetingLink/MeetingLink.d.ts +3 -0
- package/lib/components/Chat/MeetingLink/MeetingLink.js +26 -0
- package/lib/components/Chat/MeetingList/MeetingList.css +1 -0
- package/lib/components/Chat/MeetingList/MeetingList.d.ts +3 -0
- package/lib/components/Chat/MeetingList/MeetingList.js +52 -0
- package/lib/components/Chat/MeetingMessage/MeetingMessage.css +1 -0
- package/lib/components/Chat/MeetingMessage/MeetingMessage.d.ts +3 -0
- package/lib/components/Chat/MeetingMessage/MeetingMessage.js +227 -0
- package/lib/components/Chat/MessageBox/MessageBox.css +1 -0
- package/lib/components/Chat/MessageBox/MessageBox.d.ts +3 -0
- package/lib/components/Chat/MessageBox/MessageBox.js +263 -0
- package/lib/components/Chat/MessageList/MessageList.css +1 -0
- package/lib/components/Chat/MessageList/MessageList.d.ts +2 -0
- package/lib/components/Chat/MessageList/MessageList.js +196 -0
- package/lib/components/Chat/Navbar/Navbar.css +1 -0
- package/lib/components/Chat/Navbar/Navbar.d.ts +3 -0
- package/lib/components/Chat/Navbar/Navbar.js +21 -0
- package/lib/components/Chat/PhotoMessage/PhotoMessage.css +1 -0
- package/lib/components/Chat/PhotoMessage/PhotoMessage.d.ts +3 -0
- package/lib/components/Chat/PhotoMessage/PhotoMessage.js +73 -0
- package/lib/components/Chat/Popup/Popup.css +1 -0
- package/lib/components/Chat/Popup/Popup.d.ts +3 -0
- package/lib/components/Chat/Popup/Popup.js +45 -0
- package/lib/components/Chat/README.md +50 -0
- package/lib/components/Chat/ReplyMessage/ReplyMessage.css +1 -0
- package/lib/components/Chat/ReplyMessage/ReplyMessage.d.ts +3 -0
- package/lib/components/Chat/ReplyMessage/ReplyMessage.js +42 -0
- package/lib/components/Chat/SideBar/SideBar.css +1 -0
- package/lib/components/Chat/SideBar/SideBar.d.ts +3 -0
- package/lib/components/Chat/SideBar/SideBar.js +21 -0
- package/lib/components/Chat/SpotifyMessage/SpotifyMessage.css +1 -0
- package/lib/components/Chat/SpotifyMessage/SpotifyMessage.d.ts +3 -0
- package/lib/components/Chat/SpotifyMessage/SpotifyMessage.js +28 -0
- package/lib/components/Chat/SystemMessage/SystemMessage.css +1 -0
- package/lib/components/Chat/SystemMessage/SystemMessage.d.ts +3 -0
- package/lib/components/Chat/SystemMessage/SystemMessage.js +14 -0
- package/lib/components/Chat/VideoMessage/VideoMessage.css +1 -0
- package/lib/components/Chat/VideoMessage/VideoMessage.d.ts +3 -0
- package/lib/components/Chat/VideoMessage/VideoMessage.js +88 -0
- package/lib/components/Chat/assets/img/leftArrow.svg +6 -0
- package/lib/components/Chat/assets/img/rightArrow.svg +6 -0
- package/lib/components/Chat/index.d.ts +25 -0
- package/lib/components/Chat/index.js +27 -0
- package/lib/components/Chat/type.d.js +52 -0
- package/lib/components/Chat/utils/formatRelativeDate.d.ts +4 -0
- package/lib/components/Chat/utils/formatRelativeDate.js +110 -0
- package/lib/components/Checkbox/Checkbox.d.ts +15 -0
- package/lib/components/Checkbox/Checkbox.js +106 -0
- package/lib/components/Checkbox/Checkbox.stories.js +51 -0
- package/lib/components/ComponentUtils/renderWithAsChild.d.ts +9 -0
- package/lib/components/ComponentUtils/renderWithAsChild.js +27 -0
- package/lib/components/Container/Container.d.ts +7 -0
- package/lib/components/Container/Container.js +16 -0
- package/lib/components/Container/Container.stories.js +36 -0
- package/lib/components/DateField/DateField.d.ts +22 -0
- package/lib/components/DateField/DateField.js +145 -0
- package/lib/components/DateField/DateField.stories.js +125 -0
- package/lib/components/DateField/DatePicker.d.ts +9 -0
- package/lib/components/DateField/DatePicker.js +205 -0
- package/lib/components/DateField/DatePicker.stories.js +33 -0
- package/lib/components/DescriptionList/DescriptionList.d.ts +4 -0
- package/lib/components/DescriptionList/DescriptionList.js +19 -0
- package/lib/components/DescriptionList/DescriptionList.stories.js +34 -0
- package/lib/components/Dialog/Dialog.d.ts +25 -0
- package/lib/components/Dialog/Dialog.js +66 -0
- package/lib/components/Dialog/Dialog.stories.js +88 -0
- package/lib/components/DropUpload/DropUpload.d.ts +37 -0
- package/lib/components/DropUpload/DropUpload.js +323 -0
- package/lib/components/DropUpload/DropUpload.stories.js +48 -0
- package/lib/components/Empty/Empty.d.ts +11 -0
- package/lib/components/Empty/Empty.js +39 -0
- package/lib/components/Empty/Empty.stories.js +52 -0
- package/lib/components/EmptyState/EmptyState.d.ts +15 -0
- package/lib/components/EmptyState/EmptyState.js +44 -0
- package/lib/components/EmptyState/EmptyState.stories.js +36 -0
- package/lib/components/ErrorMessage/ErrorMessage.d.ts +7 -0
- package/lib/components/ErrorMessage/ErrorMessage.js +20 -0
- package/lib/components/ErrorMessage/ErrorMessage.stories.js +25 -0
- package/lib/components/FaqSection/FaqSection.d.ts +14 -0
- package/lib/components/FaqSection/FaqSection.js +37 -0
- package/lib/components/FaqSection/FaqSection.stories.js +31 -0
- package/lib/components/Fieldset/Fieldset.d.ts +21 -0
- package/lib/components/Fieldset/Fieldset.js +39 -0
- package/lib/components/Fieldset/Fieldset.stories.js +42 -0
- package/lib/components/Footer/Footer.d.ts +26 -0
- package/lib/components/Footer/Footer.js +119 -0
- package/lib/components/Footer/Footer.stories.js +184 -0
- package/lib/components/Form/Form.d.ts +42 -0
- package/lib/components/Form/Form.js +198 -0
- package/lib/components/Form/Form.stories.js +65 -0
- package/lib/components/Form/FormContext.d.ts +35 -0
- package/lib/components/Form/FormContext.js +71 -0
- package/lib/components/GothamRoute/GothamRoute.d.ts +0 -0
- package/lib/components/GothamRoute/GothamRoute.js +56 -0
- package/lib/components/GothamRouter/GothamRouter.d.ts +0 -0
- package/lib/components/GothamRouter/GothamRouter.js +52 -0
- package/lib/components/Heading/Heading.d.ts +7 -0
- package/lib/components/Heading/Heading.js +20 -0
- package/lib/components/Heading/Heading.stories.js +51 -0
- package/lib/components/IncentiveGrid/IncentiveGrid.d.ts +15 -0
- package/lib/components/IncentiveGrid/IncentiveGrid.js +34 -0
- package/lib/components/IncentiveGrid/IncentiveGrid.stories.js +41 -0
- package/lib/components/InputField/InputField.d.ts +25 -0
- package/lib/components/InputField/InputField.js +68 -0
- package/lib/components/InputField/InputField.stories.js +58 -0
- package/lib/components/Item/Item.d.ts +25 -0
- package/lib/components/Item/Item.js +79 -0
- package/lib/components/Item/Item.stories.js +94 -0
- package/lib/components/Kbd/Kbd.d.ts +2 -0
- package/lib/components/Kbd/Kbd.js +9 -0
- package/lib/components/Kbd/Kbd.stories.js +24 -0
- package/lib/components/Label/Label.d.ts +11 -0
- package/lib/components/Label/Label.js +23 -0
- package/lib/components/Label/Label.stories.js +38 -0
- package/lib/components/Link/Link.d.ts +7 -0
- package/lib/components/Link/Link.js +13 -0
- package/lib/components/Link/Link.stories.js +28 -0
- package/lib/components/ListContainer/ListContainer.d.ts +8 -0
- package/lib/components/ListContainer/ListContainer.js +14 -0
- package/lib/components/ListContainer/ListContainer.stories.js +45 -0
- package/lib/components/Loader/Loader.d.ts +9 -0
- package/lib/components/Loader/Loader.js +36 -0
- package/lib/components/Loader/Loader.stories.js +94 -0
- package/lib/components/LogoCloud/LogoCloud.d.ts +15 -0
- package/lib/components/LogoCloud/LogoCloud.js +43 -0
- package/lib/components/LogoCloud/LogoCloud.stories.js +28 -0
- package/lib/components/Markdown/Markdown.d.ts +8 -0
- package/lib/components/Markdown/Markdown.js +64 -0
- package/lib/components/Markdown/Markdown.stories.js +34 -0
- package/lib/components/MediaLightbox/MediaLightbox.d.ts +22 -0
- package/lib/components/MediaLightbox/MediaLightbox.js +80 -0
- package/lib/components/MediaObject/MediaObject.d.ts +8 -0
- package/lib/components/MediaObject/MediaObject.js +37 -0
- package/lib/components/MediaObject/MediaObject.stories.js +28 -0
- package/lib/components/Navbar/Navbar.d.ts +43 -0
- package/lib/components/Navbar/Navbar.js +213 -0
- package/lib/components/Navbar/Navbar.stories.js +235 -0
- package/lib/components/NotFound/NotFound.d.ts +34 -0
- package/lib/components/NotFound/NotFound.js +351 -0
- package/lib/components/NotFound/NotFound.stories.js +80 -0
- package/lib/components/Notify/Notify.d.ts +18 -0
- package/lib/components/Notify/Notify.js +178 -0
- package/lib/components/Notify/Notify.stories.js +148 -0
- package/lib/components/Notify/NotifyExample.d.ts +1 -0
- package/lib/components/Notify/NotifyExample.js +174 -0
- package/lib/components/Notify/README.md +103 -0
- package/lib/components/Pagination/Pagination.d.ts +18 -0
- package/lib/components/Pagination/Pagination.js +225 -0
- package/lib/components/Pagination/Pagination.stories.js +69 -0
- package/lib/components/PasswordStrengthMeter/PasswordStrengthMeter.d.ts +12 -0
- package/lib/components/PasswordStrengthMeter/PasswordStrengthMeter.js +88 -0
- package/lib/components/PasswordStrengthMeter/PasswordStrengthMeter.stories.js +16 -0
- package/lib/components/PaymentMethodPanel/PaymentMethodPanel.d.ts +18 -0
- package/lib/components/PaymentMethodPanel/PaymentMethodPanel.js +113 -0
- package/lib/components/PaymentMethodPanel/PaymentMethodPanel.stories.js +88 -0
- package/lib/components/Pricing/Pricing.d.ts +78 -0
- package/lib/components/Pricing/Pricing.js +764 -0
- package/lib/components/Pricing/Pricing.stories.js +146 -0
- package/lib/components/ProductGrid/ProductGrid.d.ts +23 -0
- package/lib/components/ProductGrid/ProductGrid.js +79 -0
- package/lib/components/ProductGrid/ProductGrid.stories.js +50 -0
- package/lib/components/ProgressSteps/ProgressSteps.d.ts +13 -0
- package/lib/components/ProgressSteps/ProgressSteps.js +51 -0
- package/lib/components/ProgressSteps/ProgressSteps.stories.js +35 -0
- package/lib/components/RadioField/RadioField.d.ts +16 -0
- package/lib/components/RadioField/RadioField.js +63 -0
- package/lib/components/RadioField/RadioField.stories.js +140 -0
- package/lib/components/ReviewList/ReviewList.d.ts +15 -0
- package/lib/components/ReviewList/ReviewList.js +51 -0
- package/lib/components/ReviewList/ReviewList.stories.js +29 -0
- package/lib/components/SectionHeader/SectionHeader.d.ts +9 -0
- package/lib/components/SectionHeader/SectionHeader.js +36 -0
- package/lib/components/SectionHeader/SectionHeader.stories.js +35 -0
- package/lib/components/SelectField/SelectField.d.ts +18 -0
- package/lib/components/SelectField/SelectField.js +145 -0
- package/lib/components/SelectField/SelectField.stories.js +155 -0
- package/lib/components/SelectField/SelectOption.d.ts +13 -0
- package/lib/components/SelectField/SelectOption.js +40 -0
- package/lib/components/SelectField/SelectOption.stories.js +40 -0
- package/lib/components/Separator/Separator.d.ts +6 -0
- package/lib/components/Separator/Separator.js +13 -0
- package/lib/components/Separator/Separator.stories.js +70 -0
- package/lib/components/Skeleton/Skeleton.d.ts +2 -0
- package/lib/components/Skeleton/Skeleton.js +9 -0
- package/lib/components/Skeleton/Skeleton.stories.js +24 -0
- package/lib/components/Svg/Svg.d.ts +9 -0
- package/lib/components/Svg/Svg.js +25 -0
- package/lib/components/Svg/Svg.stories.js +34 -0
- package/lib/components/Switch/Switch.d.ts +12 -0
- package/lib/components/Switch/Switch.js +54 -0
- package/lib/components/Switch/Switch.stories.js +61 -0
- package/lib/components/Table/Table.d.ts +18 -0
- package/lib/components/Table/Table.js +99 -0
- package/lib/components/Table/Table.stories.js +79 -0
- package/lib/components/Tabs/Tabs.d.ts +17 -0
- package/lib/components/Tabs/Tabs.js +85 -0
- package/lib/components/Tabs/Tabs.stories.js +45 -0
- package/lib/components/Text/Text.d.ts +5 -0
- package/lib/components/Text/Text.js +24 -0
- package/lib/components/Text/Text.stories.js +35 -0
- package/lib/components/TextField/TextField.d.ts +31 -0
- package/lib/components/TextField/TextField.js +91 -0
- package/lib/components/TextField/TextField.stories.js +158 -0
- package/lib/components/Textarea/Textarea.d.ts +5 -0
- package/lib/components/Textarea/Textarea.js +10 -0
- package/lib/components/Textarea/Textarea.stories.js +32 -0
- package/lib/components/index.d.ts +60 -0
- package/lib/components/index.js +62 -0
- package/lib/config/appConfig.d.ts +5 -0
- package/lib/config/appConfig.js +20 -0
- package/lib/constants/AuthConstants.d.ts +8 -0
- package/lib/constants/AuthConstants.js +9 -0
- package/lib/constants/GothamConstants.d.ts +24 -0
- package/lib/constants/GothamConstants.js +25 -0
- package/lib/constants/MarkdownConstants.d.ts +8 -0
- package/lib/constants/MarkdownConstants.js +9 -0
- package/lib/constants/MessageConstants.d.ts +10 -0
- package/lib/constants/MessageConstants.js +11 -0
- package/lib/docs/analytics.md +231 -0
- package/lib/docs/api-reference.md +364 -0
- package/lib/docs/comparison.md +83 -0
- package/lib/docs/containers.md +11 -0
- package/lib/docs/gettingStarted.md +338 -0
- package/lib/docs/payments.md +79 -0
- package/lib/editor/CodeEditor.d.ts +11 -0
- package/lib/editor/CodeEditor.js +15 -0
- package/lib/editor/CodeEditor.stories.js +24 -0
- package/lib/editor/index.d.ts +1 -0
- package/lib/editor/index.js +3 -0
- package/lib/errors/UserError.d.ts +8 -0
- package/lib/errors/UserError.js +12 -0
- package/lib/examples/OptimizedFormExample.d.ts +1 -0
- package/lib/examples/OptimizedFormExample.js +130 -0
- package/lib/form/index.d.ts +11 -0
- package/lib/form/index.js +13 -0
- package/lib/hooks/useIsMobile.d.ts +1 -0
- package/lib/hooks/useIsMobile.js +12 -0
- package/lib/i18n/index.d.ts +8 -0
- package/lib/i18n/index.js +7 -0
- package/lib/icons/Dual Ring-1s-100px.svg +1 -0
- package/lib/icons/gotham-logo.svg +17 -0
- package/lib/icons/gotham.svg +8 -0
- package/lib/icons/index.d.ts +5 -0
- package/lib/icons/index.js +6 -0
- package/lib/icons/pencil.svg +6 -0
- package/lib/img/arkhamjs-logo.png +0 -0
- package/lib/img/logo.png +0 -0
- package/lib/index.d.ts +25 -0
- package/lib/index.js +25 -0
- package/lib/router/index.d.ts +5 -0
- package/lib/router/index.js +6 -0
- package/lib/stores/GothamAppStore.d.ts +35 -0
- package/lib/stores/GothamAppStore.js +70 -0
- package/lib/stories/Button.d.ts +28 -0
- package/lib/stories/Button.js +22 -0
- package/lib/stories/Header.d.ts +12 -0
- package/lib/stories/Header.js +78 -0
- package/lib/stories/Page.d.ts +3 -0
- package/lib/stories/Page.js +108 -0
- package/lib/stories/assets/accessibility.png +0 -0
- package/lib/stories/assets/accessibility.svg +5 -0
- package/lib/stories/assets/addon-library.png +0 -0
- package/lib/stories/assets/assets.png +0 -0
- package/lib/stories/assets/context.png +0 -0
- package/lib/stories/assets/discord.svg +15 -0
- package/lib/stories/assets/docs.png +0 -0
- package/lib/stories/assets/figma-plugin.png +0 -0
- package/lib/stories/assets/github.svg +3 -0
- package/lib/stories/assets/share.png +0 -0
- package/lib/stories/assets/styling.png +0 -0
- package/lib/stories/assets/testing.png +0 -0
- package/lib/stories/assets/theming.png +0 -0
- package/lib/stories/assets/tutorials.svg +12 -0
- package/lib/stories/assets/youtube.svg +4 -0
- package/lib/stories/button.css +1 -0
- package/lib/stories/header.css +1 -0
- package/lib/stories/page.css +1 -0
- package/lib/styles/chat.css +1 -0
- package/lib/styles/index.css +2 -0
- package/lib/styles/tailwind.css +1 -0
- package/lib/types/assets.d.js +2 -0
- package/lib/types/gotham.d.ts +12 -0
- package/lib/types/gotham.js +3 -0
- package/lib/types/vitest-globals.d.js +3 -0
- package/lib/utils/GothamContext.d.ts +14 -0
- package/lib/utils/GothamContext.js +14 -0
- package/lib/utils/awsRum.d.ts +23 -0
- package/lib/utils/awsRum.js +50 -0
- package/lib/utils/colorUtils.d.ts +20 -0
- package/lib/utils/colorUtils.js +499 -0
- package/lib/utils/contentUtils.d.ts +2 -0
- package/lib/utils/contentUtils.js +18 -0
- package/lib/utils/i18nUtil.d.ts +1 -0
- package/lib/utils/i18nUtil.js +7 -0
- package/lib/utils/imageUtils.d.ts +5 -0
- package/lib/utils/imageUtils.js +48 -0
- package/lib/utils/interactionAnalytics.d.ts +10 -0
- package/lib/utils/interactionAnalytics.js +142 -0
- package/lib/utils/navEventQueue.d.ts +6 -0
- package/lib/utils/navEventQueue.js +50 -0
- package/lib/utils/refUtils.d.ts +2 -0
- package/lib/utils/refUtils.js +11 -0
- package/lib/utils/routeUtils.d.ts +12 -0
- package/lib/utils/routeUtils.js +109 -0
- package/lib/utils/sizeUtils.d.ts +5 -0
- package/lib/utils/sizeUtils.js +6 -0
- package/lib/utils/storyInteractions.d.ts +6 -0
- package/lib/utils/storyInteractions.js +45 -0
- package/lib/utils/storyUtils.d.ts +1 -0
- package/lib/utils/storyUtils.js +11 -0
- package/lib/utils/testUtils.d.ts +3 -0
- package/lib/utils/testUtils.js +56 -0
- package/lib/utils/timer.d.ts +21 -0
- package/lib/utils/timer.js +38 -0
- package/lib/utils/useBreakpoint.d.ts +6 -0
- package/lib/utils/useBreakpoint.js +56 -0
- package/lib/utils/viewPerformance.d.ts +34 -0
- package/lib/utils/viewPerformance.js +103 -0
- package/lib/utils/viewUtils.d.ts +9 -0
- package/lib/utils/viewUtils.js +44 -0
- package/lib/views/AuthSignInView/AuthSignInView.d.ts +20 -0
- package/lib/views/AuthSignInView/AuthSignInView.js +107 -0
- package/lib/views/AuthSignInView/AuthSignInView.stories.js +29 -0
- package/lib/views/AuthSignUpView/AuthSignUpView.d.ts +21 -0
- package/lib/views/AuthSignUpView/AuthSignUpView.js +146 -0
- package/lib/views/AuthSignUpView/AuthSignUpView.stories.js +30 -0
- package/lib/views/AuthView/AuthView.d.ts +16 -0
- package/lib/views/AuthView/AuthView.js +60 -0
- package/lib/views/AuthView/AuthView.stories.js +34 -0
- package/lib/views/DefaultView/DefaultView.d.ts +5 -0
- package/lib/views/DefaultView/DefaultView.js +134 -0
- package/lib/views/Gotham/Gotham.d.ts +44 -0
- package/lib/views/Gotham/Gotham.js +24 -0
- package/lib/views/Gotham/Gotham.stories.js +31 -0
- package/lib/views/Gotham/GothamListeners.d.ts +0 -0
- package/lib/views/Gotham/GothamListeners.js +2 -0
- package/lib/views/Gotham/GothamProvider.d.ts +43 -0
- package/lib/views/Gotham/GothamProvider.js +217 -0
- package/lib/views/Gotham/GothamRoot.d.ts +6 -0
- package/lib/views/Gotham/GothamRoot.js +69 -0
- package/lib/views/HomeView/HomeView.d.ts +10 -0
- package/lib/views/HomeView/HomeView.js +134 -0
- package/lib/views/LoaderView/LoaderView.d.ts +8 -0
- package/lib/views/LoaderView/LoaderView.js +30 -0
- package/lib/views/MenuView/MenuView.d.ts +13 -0
- package/lib/views/MenuView/MenuView.js +305 -0
- package/lib/views/NotFoundView/NotFoundView.d.ts +2 -0
- package/lib/views/NotFoundView/NotFoundView.js +12 -0
- package/lib/views/index.d.ts +11 -0
- package/lib/views/index.js +13 -0
- package/package.json +202 -0
- package/styles/tailwind.css +1 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '@nlabs/utils';
|
|
3
|
+
import { CreditCard } from '../../icons/index.js';
|
|
4
|
+
import { Button } from '../Button/Button.js';
|
|
5
|
+
import { Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyTitle } from '../Empty/Empty.js';
|
|
6
|
+
export const PaymentMethodPanel = (paymentMethodPanelProps)=>{
|
|
7
|
+
const { actionIcon = /*#__PURE__*/ _jsx(CreditCard, {
|
|
8
|
+
"aria-hidden": "true",
|
|
9
|
+
size: 18
|
|
10
|
+
}), addLabel = 'Add payment method', brand = '', className, description = 'Payment details are collected and stored by the payment provider.', emptyDescription = 'Add a payment method to enable purchases and subscriptions.', emptyTitle = 'No payment method saved', isAdding = false, isRemoving = false, last4 = '', onAdd, onRemove, removeLabel = 'Remove', replaceLabel = 'Replace payment method', title = 'Payment method', ...props } = paymentMethodPanelProps;
|
|
11
|
+
const accessibleTitle = typeof title === 'string' ? title : 'Payment method';
|
|
12
|
+
const hasPaymentMethod = Boolean(brand.trim() || last4.trim());
|
|
13
|
+
const paymentMethodLabel = [
|
|
14
|
+
brand.trim(),
|
|
15
|
+
last4.trim() ? `ending in ${last4.trim()}` : ''
|
|
16
|
+
].filter(Boolean).join(' ');
|
|
17
|
+
return /*#__PURE__*/ _jsxs("section", {
|
|
18
|
+
"aria-label": accessibleTitle,
|
|
19
|
+
className: cn('rounded-2xl bg-card p-5 text-card-foreground', className),
|
|
20
|
+
"data-slot": "payment-method-panel",
|
|
21
|
+
...props,
|
|
22
|
+
children: [
|
|
23
|
+
/*#__PURE__*/ _jsxs("header", {
|
|
24
|
+
className: "mb-6 grid gap-2",
|
|
25
|
+
children: [
|
|
26
|
+
/*#__PURE__*/ _jsx("h2", {
|
|
27
|
+
className: "m-0 text-2xl font-semibold",
|
|
28
|
+
children: title
|
|
29
|
+
}),
|
|
30
|
+
description ? /*#__PURE__*/ _jsx("p", {
|
|
31
|
+
className: "m-0 text-sm leading-relaxed text-muted-foreground",
|
|
32
|
+
children: description
|
|
33
|
+
}) : null
|
|
34
|
+
]
|
|
35
|
+
}),
|
|
36
|
+
hasPaymentMethod ? /*#__PURE__*/ _jsxs("div", {
|
|
37
|
+
"aria-live": "polite",
|
|
38
|
+
className: "grid gap-5",
|
|
39
|
+
children: [
|
|
40
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
41
|
+
className: "flex items-center gap-3",
|
|
42
|
+
children: [
|
|
43
|
+
/*#__PURE__*/ _jsx("span", {
|
|
44
|
+
className: "flex size-10 shrink-0 items-center justify-center rounded-full bg-primary/10 text-primary",
|
|
45
|
+
children: /*#__PURE__*/ _jsx(CreditCard, {
|
|
46
|
+
"aria-hidden": "true",
|
|
47
|
+
size: 20
|
|
48
|
+
})
|
|
49
|
+
}),
|
|
50
|
+
/*#__PURE__*/ _jsx("strong", {
|
|
51
|
+
className: "text-lg font-semibold capitalize",
|
|
52
|
+
children: paymentMethodLabel
|
|
53
|
+
})
|
|
54
|
+
]
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
57
|
+
className: "flex flex-wrap items-center gap-3",
|
|
58
|
+
children: [
|
|
59
|
+
/*#__PURE__*/ _jsx(Button, {
|
|
60
|
+
disabled: isAdding || isRemoving,
|
|
61
|
+
icon: actionIcon,
|
|
62
|
+
isLoading: isAdding,
|
|
63
|
+
onClick: onAdd,
|
|
64
|
+
type: "button",
|
|
65
|
+
children: replaceLabel
|
|
66
|
+
}),
|
|
67
|
+
onRemove ? /*#__PURE__*/ _jsx(Button, {
|
|
68
|
+
disabled: isAdding || isRemoving,
|
|
69
|
+
isLoading: isRemoving,
|
|
70
|
+
onClick: onRemove,
|
|
71
|
+
type: "button",
|
|
72
|
+
variant: "outline",
|
|
73
|
+
children: removeLabel
|
|
74
|
+
}) : null
|
|
75
|
+
]
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
}) : /*#__PURE__*/ _jsxs(Empty, {
|
|
79
|
+
className: "border-border/70 bg-muted/20",
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsxs(EmptyHeader, {
|
|
82
|
+
children: [
|
|
83
|
+
/*#__PURE__*/ _jsx(EmptyMedia, {
|
|
84
|
+
variant: "icon",
|
|
85
|
+
children: /*#__PURE__*/ _jsx(CreditCard, {
|
|
86
|
+
"aria-hidden": "true"
|
|
87
|
+
})
|
|
88
|
+
}),
|
|
89
|
+
/*#__PURE__*/ _jsx(EmptyTitle, {
|
|
90
|
+
children: emptyTitle
|
|
91
|
+
}),
|
|
92
|
+
/*#__PURE__*/ _jsx(EmptyDescription, {
|
|
93
|
+
children: emptyDescription
|
|
94
|
+
})
|
|
95
|
+
]
|
|
96
|
+
}),
|
|
97
|
+
/*#__PURE__*/ _jsx(EmptyContent, {
|
|
98
|
+
children: /*#__PURE__*/ _jsx(Button, {
|
|
99
|
+
disabled: isAdding,
|
|
100
|
+
icon: actionIcon,
|
|
101
|
+
isLoading: isAdding,
|
|
102
|
+
onClick: onAdd,
|
|
103
|
+
type: "button",
|
|
104
|
+
children: addLabel
|
|
105
|
+
})
|
|
106
|
+
})
|
|
107
|
+
]
|
|
108
|
+
})
|
|
109
|
+
]
|
|
110
|
+
});
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY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PEJ1dHRvblxuICAgICAgICAgICAgICAgIGRpc2FibGVkPXtpc0FkZGluZyB8fCBpc1JlbW92aW5nfVxuICAgICAgICAgICAgICAgIGlzTG9hZGluZz17aXNSZW1vdmluZ31cbiAgICAgICAgICAgICAgICBvbkNsaWNrPXtvblJlbW92ZX1cbiAgICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9uXCJcbiAgICAgICAgICAgICAgICB2YXJpYW50PVwib3V0bGluZVwiPlxuICAgICAgICAgICAgICAgIHtyZW1vdmVMYWJlbH1cbiAgICAgICAgICAgICAgPC9CdXR0b24+XG4gICAgICAgICAgICApIDogbnVsbH1cbiAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC9kaXY+XG4gICAgICApIDogKFxuICAgICAgICA8RW1wdHkgY2xhc3NOYW1lPVwiYm9yZGVyLWJvcmRlci83MCBiZy1tdXRlZC8yMFwiPlxuICAgICAgICAgIDxFbXB0eUhlYWRlcj5cbiAgICAgICAgICAgIDxFbXB0eU1lZGlhIHZhcmlhbnQ9XCJpY29uXCI+PENyZWRpdENhcmQgYXJpYS1oaWRkZW49XCJ0cnVlXCIgLz48L0VtcHR5TWVkaWE+XG4gICAgICAgICAgICA8RW1wdHlUaXRsZT57ZW1wdHlUaXRsZX08L0VtcHR5VGl0bGU+XG4gICAgICAgICAgICA8RW1wdHlEZXNjcmlwdGlvbj57ZW1wdHlEZXNjcmlwdGlvbn08L0VtcHR5RGVzY3JpcHRpb24+XG4gICAgICAgICAgPC9FbXB0eUhlYWRlcj5cbiAgICAgICAgICA8RW1wdHlDb250ZW50PlxuICAgICAgICAgICAgPEJ1dHRvblxuICAgICAgICAgICAgICBkaXNhYmxlZD17aXNBZGRpbmd9XG4gICAgICAgICAgICAgIGljb249e2FjdGlvbkljb259XG4gICAgICAgICAgICAgIGlzTG9hZGluZz17aXNBZGRpbmd9XG4gICAgICAgICAgICAgIG9uQ2xpY2s9e29uQWRkfVxuICAgICAgICAgICAgICB0eXBlPVwiYnV0dG9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kFDVDJCLE1BQUs7c0NBQ0pwQzs7Ozs7OztBQU9mLEVBQUUifQ==
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { interactWithCanvas } from '../../utils/storyInteractions.js';
|
|
2
|
+
import { PaymentMethodPanel } from './PaymentMethodPanel.js';
|
|
3
|
+
const noop = ()=>undefined;
|
|
4
|
+
const meta = {
|
|
5
|
+
argTypes: {
|
|
6
|
+
actionIcon: {
|
|
7
|
+
control: false
|
|
8
|
+
},
|
|
9
|
+
addLabel: {
|
|
10
|
+
control: 'text'
|
|
11
|
+
},
|
|
12
|
+
brand: {
|
|
13
|
+
control: 'text'
|
|
14
|
+
},
|
|
15
|
+
description: {
|
|
16
|
+
control: 'text'
|
|
17
|
+
},
|
|
18
|
+
emptyDescription: {
|
|
19
|
+
control: 'text'
|
|
20
|
+
},
|
|
21
|
+
emptyTitle: {
|
|
22
|
+
control: 'text'
|
|
23
|
+
},
|
|
24
|
+
isAdding: {
|
|
25
|
+
control: 'boolean'
|
|
26
|
+
},
|
|
27
|
+
isRemoving: {
|
|
28
|
+
control: 'boolean'
|
|
29
|
+
},
|
|
30
|
+
last4: {
|
|
31
|
+
control: 'text'
|
|
32
|
+
},
|
|
33
|
+
onAdd: {
|
|
34
|
+
control: false
|
|
35
|
+
},
|
|
36
|
+
onRemove: {
|
|
37
|
+
control: false
|
|
38
|
+
},
|
|
39
|
+
removeLabel: {
|
|
40
|
+
control: 'text'
|
|
41
|
+
},
|
|
42
|
+
replaceLabel: {
|
|
43
|
+
control: 'text'
|
|
44
|
+
},
|
|
45
|
+
title: {
|
|
46
|
+
control: 'text'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
args: {
|
|
50
|
+
className: 'w-full max-w-2xl',
|
|
51
|
+
onAdd: noop
|
|
52
|
+
},
|
|
53
|
+
component: PaymentMethodPanel,
|
|
54
|
+
parameters: {
|
|
55
|
+
layout: 'centered'
|
|
56
|
+
},
|
|
57
|
+
tags: [
|
|
58
|
+
'autodocs'
|
|
59
|
+
],
|
|
60
|
+
title: 'Application UI/Commerce/PaymentMethodPanel'
|
|
61
|
+
};
|
|
62
|
+
export default meta;
|
|
63
|
+
export const Empty = {
|
|
64
|
+
play: interactWithCanvas
|
|
65
|
+
};
|
|
66
|
+
export const Saved = {
|
|
67
|
+
args: {
|
|
68
|
+
brand: 'Visa',
|
|
69
|
+
last4: '4242',
|
|
70
|
+
onRemove: noop
|
|
71
|
+
},
|
|
72
|
+
play: interactWithCanvas
|
|
73
|
+
};
|
|
74
|
+
export const Adding = {
|
|
75
|
+
args: {
|
|
76
|
+
isAdding: true
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
export const Removing = {
|
|
80
|
+
args: {
|
|
81
|
+
brand: 'Mastercard',
|
|
82
|
+
isRemoving: true,
|
|
83
|
+
last4: '4444',
|
|
84
|
+
onRemove: noop
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9Vc2Vycy9uaXRyb2c3L0RldmVsb3BtZW50L2dvdGhhbWpzL3NyYy9jb21wb25lbnRzL1BheW1lbnRNZXRob2RQYW5lbC9QYXltZW50TWV0aG9kUGFuZWwuc3Rvcmllcy50c3giXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtpbnRlcmFjdFdpdGhDYW52YXN9IGZyb20gJy4uLy4uL3V0aWxzL3N0b3J5SW50ZXJhY3Rpb25zLmpzJztcbmltcG9ydCB7UGF5bWVudE1ldGhvZFBhbmVsfSBmcm9tICcuL1BheW1lbnRNZXRob2RQYW5lbC5qcyc7XG5cbmltcG9ydCB0eXBlIHtNZXRhLCBTdG9yeU9ian0gZnJvbSAnQG5sYWJzL2xleC9zdG9yeWJvb2snO1xuXG5jb25zdCBub29wID0gKCkgPT4gdW5kZWZpbmVkO1xuXG5jb25zdCBtZXRhOiBNZXRhPHR5cGVvZiBQYXltZW50TW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O0lBQ0FDLE1BQU07UUFBQztLQUFXO0lBQ2xCTixPQUFPO0FBQ1Q7QUFFQSxlQUFlaEIsS0FBSztBQUlwQixPQUFPLE1BQU11QixRQUFlO0lBQzFCQyxNQUFNNUI7QUFDUixFQUFFO0FBRUYsT0FBTyxNQUFNNkIsUUFBZTtJQUMxQlIsTUFBTTtRQUNKWixPQUFPO1FBQ1BNLE9BQU87UUFDUEUsVUFBVWY7SUFDWjtJQUNBMEIsTUFBTTVCO0FBQ1IsRUFBRTtBQUVGLE9BQU8sTUFBTThCLFNBQWdCO0lBQzNCVCxNQUFNO1FBQ0pSLFVBQVU7SUFDWjtBQUNGLEVBQUU7QUFFRixPQUFPLE1BQU1rQixXQUFrQjtJQUM3QlYsTUFBTTtRQUNKWixPQUFPO1FBQ1BLLFlBQVk7UUFDWkMsT0FBTztRQUNQRSxVQUFVZjtJQUNaO0FBQ0YsRUFBRSJ9
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type PricingVariant = 'grid' | 'single' | 'comparison';
|
|
3
|
+
export type PricingTone = 'default' | 'dark' | 'gradient';
|
|
4
|
+
export type PricingCardStyle = 'default' | 'contrast' | 'solid';
|
|
5
|
+
export interface PricingFrequency {
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly priceSuffix?: string;
|
|
8
|
+
readonly value: string;
|
|
9
|
+
}
|
|
10
|
+
export interface PricingHighlight {
|
|
11
|
+
readonly description: string;
|
|
12
|
+
readonly disabled?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type PricingTierValue = boolean | string;
|
|
15
|
+
export interface PricingTier {
|
|
16
|
+
readonly badge?: string;
|
|
17
|
+
readonly ctaLabel?: string;
|
|
18
|
+
readonly ctaSubtitle?: string;
|
|
19
|
+
readonly description?: ReactNode;
|
|
20
|
+
readonly featured?: boolean;
|
|
21
|
+
readonly features?: readonly string[];
|
|
22
|
+
readonly highlights?: readonly PricingHighlight[];
|
|
23
|
+
readonly href?: string;
|
|
24
|
+
readonly id: string;
|
|
25
|
+
readonly name: string;
|
|
26
|
+
readonly price: string | Record<string, string>;
|
|
27
|
+
readonly priceCaption?: ReactNode;
|
|
28
|
+
readonly priceSuffix?: string | Record<string, string>;
|
|
29
|
+
}
|
|
30
|
+
export interface PricingComparisonFeature {
|
|
31
|
+
readonly name: string;
|
|
32
|
+
readonly tiers: Record<string, PricingTierValue>;
|
|
33
|
+
}
|
|
34
|
+
export interface PricingComparisonSection {
|
|
35
|
+
readonly features: readonly PricingComparisonFeature[];
|
|
36
|
+
readonly name: string;
|
|
37
|
+
}
|
|
38
|
+
export interface PricingLogo {
|
|
39
|
+
readonly alt: string;
|
|
40
|
+
readonly className?: string;
|
|
41
|
+
readonly src: string;
|
|
42
|
+
}
|
|
43
|
+
export interface PricingExtraOffer {
|
|
44
|
+
readonly ctaHref: string;
|
|
45
|
+
readonly ctaLabel: string;
|
|
46
|
+
readonly description?: ReactNode;
|
|
47
|
+
readonly title: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
export interface PricingSingleOffer {
|
|
50
|
+
readonly ctaHref: string;
|
|
51
|
+
readonly ctaLabel: string;
|
|
52
|
+
readonly description?: ReactNode;
|
|
53
|
+
readonly featureLabel?: ReactNode;
|
|
54
|
+
readonly features?: readonly string[];
|
|
55
|
+
readonly note?: ReactNode;
|
|
56
|
+
readonly price: ReactNode;
|
|
57
|
+
readonly priceLabel?: ReactNode;
|
|
58
|
+
readonly priceSuffix?: ReactNode;
|
|
59
|
+
readonly title: ReactNode;
|
|
60
|
+
}
|
|
61
|
+
export interface PricingProps extends Omit<HTMLAttributes<HTMLElement>, 'title'> {
|
|
62
|
+
readonly cardStyle?: PricingCardStyle;
|
|
63
|
+
readonly comparisonSections?: readonly PricingComparisonSection[];
|
|
64
|
+
readonly defaultFrequency?: string;
|
|
65
|
+
readonly description?: ReactNode;
|
|
66
|
+
readonly eyebrow?: ReactNode;
|
|
67
|
+
readonly extraOffer?: PricingExtraOffer;
|
|
68
|
+
readonly frequencies?: readonly PricingFrequency[];
|
|
69
|
+
readonly logos?: readonly PricingLogo[];
|
|
70
|
+
readonly singleOffer?: PricingSingleOffer;
|
|
71
|
+
readonly tiers?: readonly PricingTier[];
|
|
72
|
+
readonly title?: ReactNode;
|
|
73
|
+
readonly tone?: PricingTone;
|
|
74
|
+
readonly variant?: PricingVariant;
|
|
75
|
+
}
|
|
76
|
+
declare const PricingComponent: ({ cardStyle, className, comparisonSections, defaultFrequency, description, eyebrow, extraOffer, frequencies, logos, singleOffer, tiers, title, tone, variant, ...props }: PricingProps) => import("react").JSX.Element;
|
|
77
|
+
export declare const Pricing: import("react").MemoExoticComponent<typeof PricingComponent>;
|
|
78
|
+
export {};
|