@wallarm-org/design-system 0.82.0 → 0.84.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Code/Code.d.ts +1 -1
- package/dist/components/DropdownMenu/DropdownMenuLabel.js +3 -2
- package/dist/components/DropdownMenu/classes.d.ts +1 -0
- package/dist/components/DropdownMenu/classes.js +3 -0
- package/dist/components/FilterInput/FilterInputField/FilterInputConnectorChip/FilterInputConnectorChip.js +1 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/FieldMenuSections.js +94 -72
- package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/FilterInputFieldMenu.js +1 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputOperatorMenu.js +1 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/FlatValueMenu.js +2 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenu.js +62 -36
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenuItem.d.ts +12 -4
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenuItem.js +49 -15
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/ValueMenuItem.js +2 -2
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/useNestedValueMenuState.d.ts +4 -0
- package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/useNestedValueMenuState.js +34 -12
- package/dist/components/FilterInput/lib/buildValueMenuSections.d.ts +19 -3
- package/dist/components/FilterInput/lib/buildValueMenuSections.js +71 -6
- package/dist/components/Heading/Heading.d.ts +1 -1
- package/dist/components/Link/classes.d.ts +1 -1
- package/dist/components/Text/Text.d.ts +1 -1
- package/dist/components/ToggleButton/ToggleButton.d.ts +1 -1
- package/dist/icons/Android.d.ts +3 -0
- package/dist/icons/Android.js +15 -0
- package/dist/icons/AndroidNeutral.d.ts +3 -0
- package/dist/icons/AndroidNeutral.js +15 -0
- package/dist/icons/Apple.d.ts +3 -0
- package/dist/icons/Apple.js +15 -0
- package/dist/icons/AppleMusic.d.ts +3 -0
- package/dist/icons/AppleMusic.js +51 -0
- package/dist/icons/AppleMusicNeutral.d.ts +3 -0
- package/dist/icons/AppleMusicNeutral.js +17 -0
- package/dist/icons/AppleNeutral.d.ts +3 -0
- package/dist/icons/AppleNeutral.js +15 -0
- package/dist/icons/ApplePodcasts.d.ts +3 -0
- package/dist/icons/ApplePodcasts.js +70 -0
- package/dist/icons/ApplePodcastsNeutral.d.ts +3 -0
- package/dist/icons/ApplePodcastsNeutral.js +17 -0
- package/dist/icons/Artstation.d.ts +3 -0
- package/dist/icons/Artstation.js +25 -0
- package/dist/icons/ArtstationNeutral.d.ts +3 -0
- package/dist/icons/ArtstationNeutral.js +25 -0
- package/dist/icons/Aws.d.ts +3 -0
- package/dist/icons/Aws.js +37 -0
- package/dist/icons/Baidu.d.ts +3 -0
- package/dist/icons/Baidu.js +26 -0
- package/dist/icons/BaiduNeutral.d.ts +3 -0
- package/dist/icons/BaiduNeutral.js +39 -0
- package/dist/icons/Behance.d.ts +3 -0
- package/dist/icons/Behance.js +29 -0
- package/dist/icons/BehanceNeutral.d.ts +3 -0
- package/dist/icons/BehanceNeutral.js +29 -0
- package/dist/icons/Boosty.d.ts +3 -0
- package/dist/icons/Boosty.js +48 -0
- package/dist/icons/BoostyNeutral.d.ts +3 -0
- package/dist/icons/BoostyNeutral.js +15 -0
- package/dist/icons/Braze.d.ts +3 -0
- package/dist/icons/Braze.js +15 -0
- package/dist/icons/Brevo.d.ts +3 -0
- package/dist/icons/Brevo.js +15 -0
- package/dist/icons/Devianart.d.ts +3 -0
- package/dist/icons/Devianart.js +15 -0
- package/dist/icons/DevianartNeutral.d.ts +3 -0
- package/dist/icons/DevianartNeutral.js +15 -0
- package/dist/icons/Discord.d.ts +3 -0
- package/dist/icons/Discord.js +15 -0
- package/dist/icons/DiscordNeutral.d.ts +3 -0
- package/dist/icons/DiscordNeutral.js +15 -0
- package/dist/icons/Dprofile.d.ts +3 -0
- package/dist/icons/Dprofile.js +17 -0
- package/dist/icons/DprofileNeutral.d.ts +3 -0
- package/dist/icons/DprofileNeutral.js +17 -0
- package/dist/icons/Dribbble.d.ts +3 -0
- package/dist/icons/Dribbble.js +30 -0
- package/dist/icons/Dzen.d.ts +3 -0
- package/dist/icons/Dzen.js +28 -0
- package/dist/icons/DzenNeutral.d.ts +3 -0
- package/dist/icons/DzenNeutral.js +29 -0
- package/dist/icons/Facebook.d.ts +3 -0
- package/dist/icons/Facebook.js +26 -0
- package/dist/icons/FacebookNeutral.d.ts +3 -0
- package/dist/icons/FacebookNeutral.js +15 -0
- package/dist/icons/Figma.d.ts +3 -0
- package/dist/icons/Figma.js +47 -0
- package/dist/icons/FigmaNeutral.d.ts +3 -0
- package/dist/icons/FigmaNeutral.js +17 -0
- package/dist/icons/Github.d.ts +3 -0
- package/dist/icons/Github.js +17 -0
- package/dist/icons/GithubNeutral.d.ts +3 -0
- package/dist/icons/GithubNeutral.js +17 -0
- package/dist/icons/Gmail.d.ts +3 -0
- package/dist/icons/Gmail.js +47 -0
- package/dist/icons/GmailNeutral.d.ts +3 -0
- package/dist/icons/GmailNeutral.js +15 -0
- package/dist/icons/Google.d.ts +3 -0
- package/dist/icons/Google.js +40 -0
- package/dist/icons/GoogleMeet.d.ts +3 -0
- package/dist/icons/GoogleMeet.js +54 -0
- package/dist/icons/GoogleMeetNeutral.d.ts +3 -0
- package/dist/icons/GoogleMeetNeutral.js +17 -0
- package/dist/icons/GoogleNeutral.d.ts +3 -0
- package/dist/icons/GoogleNeutral.js +15 -0
- package/dist/icons/GooglePlay.d.ts +3 -0
- package/dist/icons/GooglePlay.js +40 -0
- package/dist/icons/GooglePlayNeutral.d.ts +3 -0
- package/dist/icons/GooglePlayNeutral.js +29 -0
- package/dist/icons/GooglePodcast.d.ts +3 -0
- package/dist/icons/GooglePodcast.js +61 -0
- package/dist/icons/GooglePodcastNeutral.d.ts +3 -0
- package/dist/icons/GooglePodcastNeutral.js +49 -0
- package/dist/icons/Imo.d.ts +3 -0
- package/dist/icons/Imo.js +15 -0
- package/dist/icons/ImoNeutral.d.ts +3 -0
- package/dist/icons/ImoNeutral.js +15 -0
- package/dist/icons/Infobip.d.ts +3 -0
- package/dist/icons/Infobip.js +41 -0
- package/dist/icons/InstagramNeutral.d.ts +3 -0
- package/dist/icons/InstagramNeutral.js +29 -0
- package/dist/icons/Kickstarter.d.ts +3 -0
- package/dist/icons/Kickstarter.js +17 -0
- package/dist/icons/KickstarterNeutral.d.ts +3 -0
- package/dist/icons/KickstarterNeutral.js +17 -0
- package/dist/icons/Line.d.ts +3 -0
- package/dist/icons/Line.js +30 -0
- package/dist/icons/LineNeutral.d.ts +3 -0
- package/dist/icons/LineNeutral.js +17 -0
- package/dist/icons/Linkedin.d.ts +3 -0
- package/dist/icons/Linkedin.js +15 -0
- package/dist/icons/LinkedinNeutral.d.ts +3 -0
- package/dist/icons/LinkedinNeutral.js +15 -0
- package/dist/icons/Mailersend.d.ts +3 -0
- package/dist/icons/Mailersend.js +37 -0
- package/dist/icons/Mailgun.d.ts +3 -0
- package/dist/icons/Mailgun.js +15 -0
- package/dist/icons/Mailjet.d.ts +3 -0
- package/dist/icons/Mailjet.js +15 -0
- package/dist/icons/Mailtrap.d.ts +3 -0
- package/dist/icons/Mailtrap.js +15 -0
- package/dist/icons/Mandrill.d.ts +3 -0
- package/dist/icons/Mandrill.js +15 -0
- package/dist/icons/Maqsam.d.ts +3 -0
- package/dist/icons/Maqsam.js +40 -0
- package/dist/icons/Mattermost.d.ts +3 -0
- package/dist/icons/Mattermost.js +15 -0
- package/dist/icons/Medium.d.ts +3 -0
- package/dist/icons/Medium.js +25 -0
- package/dist/icons/MediumNeutral.d.ts +3 -0
- package/dist/icons/MediumNeutral.js +25 -0
- package/dist/icons/Messenger.d.ts +3 -0
- package/dist/icons/Messenger.js +55 -0
- package/dist/icons/MessengerNeutral.d.ts +3 -0
- package/dist/icons/MessengerNeutral.js +17 -0
- package/dist/icons/MicrosoftTeams.d.ts +3 -0
- package/dist/icons/MicrosoftTeams.js +102 -0
- package/dist/icons/MicrosoftTeamsNeutral.d.ts +3 -0
- package/dist/icons/MicrosoftTeamsNeutral.js +31 -0
- package/dist/icons/Netcore.d.ts +3 -0
- package/dist/icons/Netcore.js +15 -0
- package/dist/icons/Notion.d.ts +3 -0
- package/dist/icons/Notion.js +37 -0
- package/dist/icons/NotionNeutral.d.ts +3 -0
- package/dist/icons/NotionNeutral.js +15 -0
- package/dist/icons/Ok.d.ts +3 -0
- package/dist/icons/Ok.js +34 -0
- package/dist/icons/OkNeutral.d.ts +3 -0
- package/dist/icons/OkNeutral.js +23 -0
- package/dist/icons/OkOnlySign.d.ts +3 -0
- package/dist/icons/OkOnlySign.js +23 -0
- package/dist/icons/OkOnlySignNeutral.d.ts +3 -0
- package/dist/icons/OkOnlySignNeutral.js +23 -0
- package/dist/icons/Onlyfans.d.ts +3 -0
- package/dist/icons/Onlyfans.js +21 -0
- package/dist/icons/Outlook365.d.ts +3 -0
- package/dist/icons/Outlook365.js +414 -0
- package/dist/icons/Patreon.d.ts +3 -0
- package/dist/icons/Patreon.js +15 -0
- package/dist/icons/PatreonNeutral.d.ts +3 -0
- package/dist/icons/PatreonNeutral.js +15 -0
- package/dist/icons/Paypal.d.ts +3 -0
- package/dist/icons/Paypal.js +30 -0
- package/dist/icons/PaypalNeutral.d.ts +3 -0
- package/dist/icons/PaypalNeutral.js +15 -0
- package/dist/icons/Pinterest.d.ts +3 -0
- package/dist/icons/Pinterest.js +26 -0
- package/dist/icons/PinterestNeutral.d.ts +3 -0
- package/dist/icons/PinterestNeutral.js +15 -0
- package/dist/icons/Plunk.d.ts +3 -0
- package/dist/icons/Plunk.js +17 -0
- package/dist/icons/Postmark.d.ts +3 -0
- package/dist/icons/Postmark.js +30 -0
- package/dist/icons/ProductHunt.d.ts +3 -0
- package/dist/icons/ProductHunt.js +26 -0
- package/dist/icons/ProductHuntNeutral.d.ts +3 -0
- package/dist/icons/ProductHuntNeutral.js +23 -0
- package/dist/icons/Quora.d.ts +3 -0
- package/dist/icons/Quora.js +15 -0
- package/dist/icons/QuoraNeutral.d.ts +3 -0
- package/dist/icons/QuoraNeutral.js +15 -0
- package/dist/icons/Reddit.d.ts +3 -0
- package/dist/icons/Reddit.js +26 -0
- package/dist/icons/RedditNeutral.d.ts +3 -0
- package/dist/icons/RedditNeutral.js +31 -0
- package/dist/icons/Resend.d.ts +3 -0
- package/dist/icons/Resend.js +15 -0
- package/dist/icons/Sendgrid.d.ts +3 -0
- package/dist/icons/Sendgrid.js +37 -0
- package/dist/icons/Ses.d.ts +3 -0
- package/dist/icons/Ses.js +21 -0
- package/dist/icons/Signal.d.ts +3 -0
- package/dist/icons/Signal.js +15 -0
- package/dist/icons/SignalNeutral.d.ts +3 -0
- package/dist/icons/SignalNeutral.js +15 -0
- package/dist/icons/SinaWeibo.d.ts +3 -0
- package/dist/icons/SinaWeibo.js +47 -0
- package/dist/icons/SinaWeiboNeutral.d.ts +3 -0
- package/dist/icons/SinaWeiboNeutral.js +33 -0
- package/dist/icons/Skype.d.ts +3 -0
- package/dist/icons/Skype.js +15 -0
- package/dist/icons/SkypeNeutral.d.ts +3 -0
- package/dist/icons/SkypeNeutral.js +15 -0
- package/dist/icons/Slack.d.ts +3 -0
- package/dist/icons/Slack.js +40 -0
- package/dist/icons/SlackNeutral.d.ts +3 -0
- package/dist/icons/SlackNeutral.js +45 -0
- package/dist/icons/Smtp.d.ts +3 -0
- package/dist/icons/Smtp.js +15 -0
- package/dist/icons/Snapchat.d.ts +3 -0
- package/dist/icons/Snapchat.js +26 -0
- package/dist/icons/SnapchatNeutral.d.ts +3 -0
- package/dist/icons/SnapchatNeutral.js +15 -0
- package/dist/icons/Soundcloud.d.ts +3 -0
- package/dist/icons/Soundcloud.js +36 -0
- package/dist/icons/SoundcloudNeutral.d.ts +3 -0
- package/dist/icons/SoundcloudNeutral.js +15 -0
- package/dist/icons/Sparkpost.d.ts +3 -0
- package/dist/icons/Sparkpost.js +15 -0
- package/dist/icons/Spotify.d.ts +3 -0
- package/dist/icons/Spotify.js +15 -0
- package/dist/icons/SpotifyNeutral.d.ts +3 -0
- package/dist/icons/SpotifyNeutral.js +15 -0
- package/dist/icons/StackOverflow.d.ts +3 -0
- package/dist/icons/StackOverflow.js +26 -0
- package/dist/icons/StackOverflowNeutral.d.ts +3 -0
- package/dist/icons/StackOverflowNeutral.js +37 -0
- package/dist/icons/Teams.d.ts +3 -0
- package/dist/icons/Teams.js +100 -0
- package/dist/icons/Telegram.d.ts +3 -0
- package/dist/icons/Telegram.js +49 -0
- package/dist/icons/TelegramNeutral.d.ts +3 -0
- package/dist/icons/TelegramNeutral.js +17 -0
- package/dist/icons/TelegramOnlySign.d.ts +3 -0
- package/dist/icons/TelegramOnlySign.js +38 -0
- package/dist/icons/TelegramOnlySignNeutral.d.ts +3 -0
- package/dist/icons/TelegramOnlySignNeutral.js +17 -0
- package/dist/icons/Threads.d.ts +3 -0
- package/dist/icons/Threads.js +15 -0
- package/dist/icons/ThreadsNeutral.d.ts +3 -0
- package/dist/icons/ThreadsNeutral.js +15 -0
- package/dist/icons/Tiktok.d.ts +3 -0
- package/dist/icons/Tiktok.js +33 -0
- package/dist/icons/TiktokNeutral.d.ts +3 -0
- package/dist/icons/TiktokNeutral.js +15 -0
- package/dist/icons/Tinder.d.ts +3 -0
- package/dist/icons/Tinder.js +38 -0
- package/dist/icons/TinderNeutral.d.ts +3 -0
- package/dist/icons/TinderNeutral.js +17 -0
- package/dist/icons/Tumblr.d.ts +3 -0
- package/dist/icons/Tumblr.js +15 -0
- package/dist/icons/TumblrNeutral.d.ts +3 -0
- package/dist/icons/TumblrNeutral.js +15 -0
- package/dist/icons/Twitch.d.ts +3 -0
- package/dist/icons/Twitch.js +40 -0
- package/dist/icons/TwitchNeutral.d.ts +3 -0
- package/dist/icons/TwitchNeutral.js +27 -0
- package/dist/icons/Viber.d.ts +3 -0
- package/dist/icons/Viber.js +54 -0
- package/dist/icons/ViberNeutral.d.ts +3 -0
- package/dist/icons/ViberNeutral.js +35 -0
- package/dist/icons/Vimeo.d.ts +3 -0
- package/dist/icons/Vimeo.js +15 -0
- package/dist/icons/VimeoNeutral.d.ts +3 -0
- package/dist/icons/VimeoNeutral.js +15 -0
- package/dist/icons/Vk.d.ts +3 -0
- package/dist/icons/Vk.js +26 -0
- package/dist/icons/VkMusic.d.ts +3 -0
- package/dist/icons/VkMusic.js +65 -0
- package/dist/icons/VkMusicNeutral.d.ts +3 -0
- package/dist/icons/VkMusicNeutral.js +23 -0
- package/dist/icons/VkNeutral.d.ts +3 -0
- package/dist/icons/VkNeutral.js +17 -0
- package/dist/icons/VkOnlySign.d.ts +3 -0
- package/dist/icons/VkOnlySign.js +15 -0
- package/dist/icons/VkOnlySignNeutral.d.ts +3 -0
- package/dist/icons/VkOnlySignNeutral.js +15 -0
- package/dist/icons/Webhook.d.ts +3 -0
- package/dist/icons/Webhook.js +15 -0
- package/dist/icons/Wechat.d.ts +3 -0
- package/dist/icons/Wechat.js +21 -0
- package/dist/icons/WechatNeutral.d.ts +3 -0
- package/dist/icons/WechatNeutral.js +21 -0
- package/dist/icons/Whatsapp.d.ts +3 -0
- package/dist/icons/Whatsapp.js +15 -0
- package/dist/icons/WhatsappBadge.d.ts +3 -0
- package/dist/icons/WhatsappBadge.js +63 -0
- package/dist/icons/WhatsappNeutral.d.ts +3 -0
- package/dist/icons/WhatsappNeutral.js +15 -0
- package/dist/icons/XExTwitter.d.ts +3 -0
- package/dist/icons/XExTwitter.js +15 -0
- package/dist/icons/XExTwitterNeutral.d.ts +3 -0
- package/dist/icons/XExTwitterNeutral.js +15 -0
- package/dist/icons/Xing.d.ts +3 -0
- package/dist/icons/Xing.js +26 -0
- package/dist/icons/XingNeutral.d.ts +3 -0
- package/dist/icons/XingNeutral.js +21 -0
- package/dist/icons/YandexMusic.d.ts +3 -0
- package/dist/icons/YandexMusic.js +26 -0
- package/dist/icons/YandexMusicNeutral.d.ts +3 -0
- package/dist/icons/YandexMusicNeutral.js +21 -0
- package/dist/icons/Yelp.d.ts +3 -0
- package/dist/icons/Yelp.js +15 -0
- package/dist/icons/YelpNeutral.d.ts +3 -0
- package/dist/icons/YelpNeutral.js +15 -0
- package/dist/icons/Youtube.d.ts +3 -0
- package/dist/icons/Youtube.js +26 -0
- package/dist/icons/YoutubeMusic.d.ts +3 -0
- package/dist/icons/YoutubeMusic.js +33 -0
- package/dist/icons/YoutubeMusicNeutral.d.ts +3 -0
- package/dist/icons/YoutubeMusicNeutral.js +25 -0
- package/dist/icons/YoutubeNeutral.d.ts +3 -0
- package/dist/icons/YoutubeNeutral.js +17 -0
- package/dist/icons/YoutubeShorts.d.ts +3 -0
- package/dist/icons/YoutubeShorts.js +30 -0
- package/dist/icons/YoutubeShortsNeutral.d.ts +3 -0
- package/dist/icons/YoutubeShortsNeutral.js +17 -0
- package/dist/icons/Zoom.d.ts +3 -0
- package/dist/icons/Zoom.js +26 -0
- package/dist/icons/ZoomNeutral.d.ts +3 -0
- package/dist/icons/ZoomNeutral.js +17 -0
- package/dist/icons/Zulip.d.ts +3 -0
- package/dist/icons/Zulip.js +36 -0
- package/dist/icons/index.d.ts +159 -2
- package/dist/icons/index.js +159 -2
- package/dist/icons/module/const.js +163 -0
- package/dist/metadata/components.json +8 -2
- package/package.json +1 -1
- package/dist/icons/ProviderIcon/ProviderIcon.d.ts +0 -7
- package/dist/icons/ProviderIcon/ProviderIcon.js +0 -11
- package/dist/icons/ProviderIcon/index.d.ts +0 -2
- package/dist/icons/ProviderIcon/index.js +0 -1
- package/dist/icons/ProviderIcon/paths/index.d.ts +0 -3
- package/dist/icons/ProviderIcon/paths/index.js +0 -896
- package/dist/icons/ProviderIcon/types.d.ts +0 -1
- package/dist/icons/ProviderIcon/types.js +0 -0
- package/dist/icons/SocialIcon/SocialIcon.d.ts +0 -8
- package/dist/icons/SocialIcon/SocialIcon.js +0 -15
- package/dist/icons/SocialIcon/index.d.ts +0 -2
- package/dist/icons/SocialIcon/index.js +0 -1
- package/dist/icons/SocialIcon/paths/index.d.ts +0 -3
- package/dist/icons/SocialIcon/paths/index.js +0 -2542
- package/dist/icons/SocialIcon/types.d.ts +0 -2
- package/dist/icons/SocialIcon/types.js +0 -0
|
@@ -4,7 +4,7 @@ import type { TestableProps } from '../../utils/testId';
|
|
|
4
4
|
import { type ButtonBaseProps } from '../ButtonBase';
|
|
5
5
|
declare const buttonVariants: (props?: ({
|
|
6
6
|
variant?: "primary" | "secondary" | "outline" | "ghost" | null | undefined;
|
|
7
|
-
color?: "
|
|
7
|
+
color?: "destructive" | "brand" | "neutral" | "neutral-alt" | null | undefined;
|
|
8
8
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
9
9
|
type ButtonVariantProps = VariantProps<typeof buttonVariants>;
|
|
10
10
|
export type ButtonProps<C extends ElementType = 'button'> = ButtonBaseProps<C> & ButtonVariantProps & TestableProps;
|
|
@@ -3,7 +3,7 @@ import { type VariantProps } from 'class-variance-authority';
|
|
|
3
3
|
import type { TestableProps } from '../../utils/testId';
|
|
4
4
|
declare const codeVariants: (props?: ({
|
|
5
5
|
size?: "s" | "xs" | "m" | "l" | null | undefined;
|
|
6
|
-
weight?: "bold" | "
|
|
6
|
+
weight?: "bold" | "light" | "regular" | "medium" | null | undefined;
|
|
7
7
|
color?: "primary" | "secondary" | "destructive" | "primary-alt" | null | undefined;
|
|
8
8
|
italic?: boolean | null | undefined;
|
|
9
9
|
truncate?: boolean | null | undefined;
|
|
@@ -2,12 +2,13 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { cn } from "../../utils/cn.js";
|
|
3
3
|
import { useTestId } from "../../utils/testId.js";
|
|
4
4
|
import { dropdownMenuLabelVariants } from "./classes.js";
|
|
5
|
-
const DropdownMenuLabel = ({ className, inset, ...props })=>{
|
|
5
|
+
const DropdownMenuLabel = ({ className, inset, sticky, ...props })=>{
|
|
6
6
|
const testId = useTestId('label');
|
|
7
7
|
return /*#__PURE__*/ jsx("div", {
|
|
8
8
|
"data-testid": testId,
|
|
9
9
|
className: cn(dropdownMenuLabelVariants({
|
|
10
|
-
inset
|
|
10
|
+
inset,
|
|
11
|
+
sticky
|
|
11
12
|
}), className),
|
|
12
13
|
...props
|
|
13
14
|
});
|
|
@@ -6,4 +6,5 @@ export declare const dropdownMenuItemVariants: (props?: ({
|
|
|
6
6
|
export declare const dropdownMenuItemIndicatorClassName: string;
|
|
7
7
|
export declare const dropdownMenuLabelVariants: (props?: ({
|
|
8
8
|
inset?: boolean | null | undefined;
|
|
9
|
+
sticky?: boolean | null | undefined;
|
|
9
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/FieldMenuSections.js
CHANGED
|
@@ -5,40 +5,46 @@ import { CircleSlash } from "../../../../icons/CircleSlash.js";
|
|
|
5
5
|
import { DropdownMenuGroup, DropdownMenuItem, DropdownMenuItemIcon, DropdownMenuItemText, DropdownMenuLabel, DropdownMenuSeparator } from "../../../DropdownMenu/index.js";
|
|
6
6
|
const RecentSection = ({ conditions, fields, onSelect, registerItem })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
7
7
|
children: [
|
|
8
|
-
/*#__PURE__*/
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
8
|
+
/*#__PURE__*/ jsxs("div", {
|
|
9
|
+
className: "flex flex-col gap-1",
|
|
10
|
+
children: [
|
|
11
|
+
/*#__PURE__*/ jsx(DropdownMenuLabel, {
|
|
12
|
+
sticky: true,
|
|
13
|
+
children: "Recent"
|
|
14
|
+
}),
|
|
15
|
+
/*#__PURE__*/ jsx(DropdownMenuGroup, {
|
|
16
|
+
children: conditions.map((condition, index)=>{
|
|
17
|
+
const fieldMeta = fields.find((f)=>f.name === condition.field);
|
|
18
|
+
const attribute = fieldMeta?.label || condition.field;
|
|
19
|
+
const operator = String(condition.operator);
|
|
20
|
+
const value = String(condition.value);
|
|
21
|
+
return /*#__PURE__*/ jsx(DropdownMenuItem, {
|
|
22
|
+
value: `recent-${index}`,
|
|
23
|
+
ref: registerItem(`recent-${index}`),
|
|
24
|
+
onSelect: ()=>{
|
|
25
|
+
if (fieldMeta) onSelect(fieldMeta);
|
|
26
|
+
},
|
|
27
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
28
|
+
className: "flex gap-2 items-center text-sm",
|
|
29
|
+
children: [
|
|
30
|
+
/*#__PURE__*/ jsx("span", {
|
|
31
|
+
className: "text-text-primary",
|
|
32
|
+
children: attribute
|
|
33
|
+
}),
|
|
34
|
+
/*#__PURE__*/ jsx("span", {
|
|
35
|
+
className: "text-text-secondary",
|
|
36
|
+
children: operator
|
|
37
|
+
}),
|
|
38
|
+
/*#__PURE__*/ jsx("span", {
|
|
39
|
+
className: "font-medium text-text-info",
|
|
40
|
+
children: value
|
|
41
|
+
})
|
|
42
|
+
]
|
|
37
43
|
})
|
|
38
|
-
|
|
44
|
+
}, `recent-${index}`);
|
|
39
45
|
})
|
|
40
|
-
}
|
|
41
|
-
|
|
46
|
+
})
|
|
47
|
+
]
|
|
42
48
|
}),
|
|
43
49
|
/*#__PURE__*/ jsx(DropdownMenuSeparator, {})
|
|
44
50
|
]
|
|
@@ -46,32 +52,38 @@ const RecentSection = ({ conditions, fields, onSelect, registerItem })=>/*#__PUR
|
|
|
46
52
|
RecentSection.displayName = 'RecentSection';
|
|
47
53
|
const SuggestionsSection = ({ fields, onSelect, registerItem })=>/*#__PURE__*/ jsxs(Fragment, {
|
|
48
54
|
children: [
|
|
49
|
-
/*#__PURE__*/
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
children:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
55
|
+
/*#__PURE__*/ jsxs("div", {
|
|
56
|
+
className: "flex flex-col gap-1",
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ jsx(DropdownMenuLabel, {
|
|
59
|
+
sticky: true,
|
|
60
|
+
children: "Suggestions"
|
|
61
|
+
}),
|
|
62
|
+
/*#__PURE__*/ jsx(DropdownMenuGroup, {
|
|
63
|
+
children: fields.map((field, index)=>/*#__PURE__*/ jsx(DropdownMenuItem, {
|
|
64
|
+
value: `suggested-${index}`,
|
|
65
|
+
ref: registerItem(`suggested-${index}`),
|
|
66
|
+
onSelect: ()=>onSelect(field),
|
|
67
|
+
children: /*#__PURE__*/ jsxs("span", {
|
|
68
|
+
className: "flex gap-2 items-center text-sm",
|
|
69
|
+
children: [
|
|
70
|
+
/*#__PURE__*/ jsx("span", {
|
|
71
|
+
className: "text-text-primary",
|
|
72
|
+
children: field.label
|
|
73
|
+
}),
|
|
74
|
+
/*#__PURE__*/ jsx("span", {
|
|
75
|
+
className: "text-text-secondary",
|
|
76
|
+
children: "operator"
|
|
77
|
+
}),
|
|
78
|
+
/*#__PURE__*/ jsx("span", {
|
|
79
|
+
className: "font-medium text-text-info",
|
|
80
|
+
children: "Value"
|
|
81
|
+
})
|
|
82
|
+
]
|
|
71
83
|
})
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
84
|
+
}, `suggested-${index}`))
|
|
85
|
+
})
|
|
86
|
+
]
|
|
75
87
|
}),
|
|
76
88
|
/*#__PURE__*/ jsx(DropdownMenuSeparator, {})
|
|
77
89
|
]
|
|
@@ -110,24 +122,34 @@ const OperatorsSection = ({ onSelectAnd, onSelectOr, registerItem })=>/*#__PURE_
|
|
|
110
122
|
});
|
|
111
123
|
OperatorsSection.displayName = 'OperatorsSection';
|
|
112
124
|
const FieldSections = ({ sections, onSelect, registerItem })=>/*#__PURE__*/ jsx(Fragment, {
|
|
113
|
-
children: sections.map((section, index)
|
|
125
|
+
children: sections.map((section, index)=>{
|
|
126
|
+
const group = /*#__PURE__*/ jsx(DropdownMenuGroup, {
|
|
127
|
+
children: section.fields.map((field)=>/*#__PURE__*/ jsx(DropdownMenuItem, {
|
|
128
|
+
value: `field-${field.name}`,
|
|
129
|
+
ref: registerItem(`field-${field.name}`),
|
|
130
|
+
onSelect: ()=>onSelect(field),
|
|
131
|
+
className: "scroll-mt-32",
|
|
132
|
+
children: /*#__PURE__*/ jsx(DropdownMenuItemText, {
|
|
133
|
+
children: field.label
|
|
134
|
+
})
|
|
135
|
+
}, field.name))
|
|
136
|
+
});
|
|
137
|
+
return /*#__PURE__*/ jsxs(external_react_Fragment, {
|
|
114
138
|
children: [
|
|
115
139
|
index > 0 && /*#__PURE__*/ jsx(DropdownMenuSeparator, {}),
|
|
116
|
-
section.label
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
})
|
|
127
|
-
}, field.name))
|
|
128
|
-
})
|
|
140
|
+
section.label ? /*#__PURE__*/ jsxs("div", {
|
|
141
|
+
className: "flex flex-col gap-1",
|
|
142
|
+
children: [
|
|
143
|
+
/*#__PURE__*/ jsx(DropdownMenuLabel, {
|
|
144
|
+
sticky: true,
|
|
145
|
+
children: section.label
|
|
146
|
+
}),
|
|
147
|
+
group
|
|
148
|
+
]
|
|
149
|
+
}) : group
|
|
129
150
|
]
|
|
130
|
-
}, `${section.label ?? 'ungrouped'}-${index}`)
|
|
151
|
+
}, `${section.label ?? 'ungrouped'}-${index}`);
|
|
152
|
+
})
|
|
131
153
|
});
|
|
132
154
|
FieldSections.displayName = 'FieldSections';
|
|
133
155
|
export { FieldSections, OperatorsSection, RecentSection, SuggestionsSection };
|
package/dist/components/FilterInput/FilterInputMenu/FilterInputFieldMenu/FilterInputFieldMenu.js
CHANGED
|
@@ -84,6 +84,7 @@ const FilterInputFieldMenu = ({ fields, filterText = '', onSelect, open = false,
|
|
|
84
84
|
registerItem: registerItem
|
|
85
85
|
}),
|
|
86
86
|
/*#__PURE__*/ jsxs(DropdownMenuFooter, {
|
|
87
|
+
className: "justify-start",
|
|
87
88
|
children: [
|
|
88
89
|
/*#__PURE__*/ jsxs("span", {
|
|
89
90
|
className: "flex items-center gap-4",
|
|
@@ -83,6 +83,7 @@ const FilterInputOperatorMenu = ({ fieldType, operators, onSelect, open = false,
|
|
|
83
83
|
]
|
|
84
84
|
}, `group-${groupIdx}`)) : /*#__PURE__*/ jsx(MenuEmptyState, {}),
|
|
85
85
|
/*#__PURE__*/ jsx(DropdownMenuFooter, {
|
|
86
|
+
className: "justify-start",
|
|
86
87
|
children: /*#__PURE__*/ jsxs("span", {
|
|
87
88
|
className: "flex items-center gap-4",
|
|
88
89
|
children: [
|
|
@@ -55,6 +55,7 @@ const FlatValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChange,
|
|
|
55
55
|
"data-filter-input-menu": "true",
|
|
56
56
|
children: [
|
|
57
57
|
displayValues.length > 0 ? /*#__PURE__*/ jsx(DropdownMenuGroup, {
|
|
58
|
+
className: "flex flex-col gap-1",
|
|
58
59
|
children: displayValues.map((option)=>/*#__PURE__*/ jsx(ValueMenuItem, {
|
|
59
60
|
option: option,
|
|
60
61
|
isChecked: selectedValues.some((v)=>String(v) === String(option.value)),
|
|
@@ -69,6 +70,7 @@ const FlatValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChange,
|
|
|
69
70
|
}, String(option.value)))
|
|
70
71
|
}) : /*#__PURE__*/ jsx(MenuEmptyState, {}),
|
|
71
72
|
/*#__PURE__*/ jsx(DropdownMenuFooter, {
|
|
73
|
+
className: "justify-start",
|
|
72
74
|
children: /*#__PURE__*/ jsx(ValueMenuFooterHints, {
|
|
73
75
|
multiSelect: multiSelect
|
|
74
76
|
})
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Fragment as external_react_Fragment, useMemo, useRef } from "react";
|
|
3
3
|
import { cn } from "../../../../utils/cn.js";
|
|
4
|
-
import { DropdownMenu, DropdownMenuContent, DropdownMenuFooter, DropdownMenuGroup,
|
|
5
|
-
import { Text } from "../../../Text/index.js";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuFooter, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuSeparator } from "../../../DropdownMenu/index.js";
|
|
6
5
|
import { buildValueMenuSections } from "../../lib/buildValueMenuSections.js";
|
|
7
6
|
import { MenuEmptyState } from "../MenuEmptyState.js";
|
|
8
7
|
import { NestedValueMenuItem } from "./NestedValueMenuItem.js";
|
|
@@ -11,9 +10,10 @@ import { ValueMenuFooterHints } from "./ValueMenuFooterHints.js";
|
|
|
11
10
|
const NestedValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChange, onEscape, multiSelect = false, initialValues = [], width = 'standard', positioning, onBuildingValueChange, onItemToggle, inputRef, filterText = '', menuRef, blurCommitRef, className })=>{
|
|
12
11
|
const submenuRef = useRef(null);
|
|
13
12
|
const rowElsRef = useRef(new Map());
|
|
14
|
-
const sections = useMemo(()=>buildValueMenuSections(values, filterText), [
|
|
13
|
+
const sections = useMemo(()=>buildValueMenuSections(values, filterText, multiSelect), [
|
|
15
14
|
values,
|
|
16
|
-
filterText
|
|
15
|
+
filterText,
|
|
16
|
+
multiSelect
|
|
17
17
|
]);
|
|
18
18
|
const state = useNestedValueMenuState({
|
|
19
19
|
sections,
|
|
@@ -43,13 +43,21 @@ const NestedValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChang
|
|
|
43
43
|
};
|
|
44
44
|
const submenuPositioning = useMemo(()=>({
|
|
45
45
|
placement: 'right-start',
|
|
46
|
-
gutter:
|
|
46
|
+
gutter: 4,
|
|
47
47
|
getAnchorRect: ()=>state.openParentId && rowElsRef.current.get(state.openParentId)?.getBoundingClientRect() || null
|
|
48
48
|
}), [
|
|
49
49
|
state.openParentId
|
|
50
50
|
]);
|
|
51
51
|
const openParentRow = state.openParentRow;
|
|
52
|
-
const
|
|
52
|
+
const submenuSelectAllRow = openParentRow && multiSelect ? {
|
|
53
|
+
id: SELECT_ALL_ID,
|
|
54
|
+
option: {
|
|
55
|
+
label: `All ${openParentRow.option.label}`,
|
|
56
|
+
children: openParentRow.option.children ?? []
|
|
57
|
+
},
|
|
58
|
+
isGroup: true,
|
|
59
|
+
isSelectAll: true
|
|
60
|
+
} : null;
|
|
53
61
|
const hasRows = sections.some((section)=>section.rows.length > 0);
|
|
54
62
|
return /*#__PURE__*/ jsxs(Fragment, {
|
|
55
63
|
children: [
|
|
@@ -65,31 +73,48 @@ const NestedValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChang
|
|
|
65
73
|
className: cn(widthClass, 'max-h-[430px]', className),
|
|
66
74
|
style: widthStyle,
|
|
67
75
|
"data-filter-input-menu": "true",
|
|
76
|
+
onMouseMove: state.handleMainMouseMove,
|
|
68
77
|
children: [
|
|
69
|
-
hasRows ? sections.map((section, index)
|
|
78
|
+
hasRows ? sections.map((section, index)=>{
|
|
79
|
+
const rows = /*#__PURE__*/ jsx(DropdownMenuGroup, {
|
|
80
|
+
className: "flex flex-col gap-1",
|
|
81
|
+
children: section.rows.map((row)=>{
|
|
82
|
+
const isParent = row.isGroup && !row.isSelectAll;
|
|
83
|
+
return /*#__PURE__*/ jsx(NestedValueMenuItem, {
|
|
84
|
+
id: row.id,
|
|
85
|
+
option: row.option,
|
|
86
|
+
isGroup: isParent,
|
|
87
|
+
checkedState: state.getRowCheckState(row),
|
|
88
|
+
isPending: state.topPendingIds.has(row.id),
|
|
89
|
+
multiSelect: multiSelect,
|
|
90
|
+
onSelect: ()=>state.selectRow(row, false),
|
|
91
|
+
onMouseEnter: isParent ? ()=>state.openParent(row.id) : void 0,
|
|
92
|
+
onMouseLeave: isParent ? ()=>state.scheduleClose() : void 0,
|
|
93
|
+
registerRef: setRowRef(row.id),
|
|
94
|
+
expanded: state.openParentId === row.id,
|
|
95
|
+
selectAll: row.isSelectAll,
|
|
96
|
+
highlight: filterText
|
|
97
|
+
}, row.id);
|
|
98
|
+
})
|
|
99
|
+
});
|
|
100
|
+
return /*#__PURE__*/ jsxs(external_react_Fragment, {
|
|
70
101
|
children: [
|
|
71
102
|
index > 0 && /*#__PURE__*/ jsx(DropdownMenuSeparator, {}),
|
|
72
|
-
section.label
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
multiSelect: multiSelect,
|
|
83
|
-
onSelect: ()=>state.selectRow(row, false),
|
|
84
|
-
onMouseEnter: row.isGroup ? ()=>state.openParent(row.id) : void 0,
|
|
85
|
-
onMouseLeave: row.isGroup ? ()=>state.scheduleClose() : void 0,
|
|
86
|
-
registerRef: setRowRef(row.id),
|
|
87
|
-
expanded: state.openParentId === row.id
|
|
88
|
-
}, row.id))
|
|
89
|
-
})
|
|
103
|
+
section.label ? /*#__PURE__*/ jsxs("div", {
|
|
104
|
+
className: "flex flex-col gap-1",
|
|
105
|
+
children: [
|
|
106
|
+
/*#__PURE__*/ jsx(DropdownMenuLabel, {
|
|
107
|
+
sticky: true,
|
|
108
|
+
children: section.label
|
|
109
|
+
}),
|
|
110
|
+
rows
|
|
111
|
+
]
|
|
112
|
+
}) : rows
|
|
90
113
|
]
|
|
91
|
-
}, section.label ?? `section-${index}`)
|
|
114
|
+
}, section.label ?? `section-${index}`);
|
|
115
|
+
}) : /*#__PURE__*/ jsx(MenuEmptyState, {}),
|
|
92
116
|
/*#__PURE__*/ jsx(DropdownMenuFooter, {
|
|
117
|
+
className: "justify-start",
|
|
93
118
|
children: /*#__PURE__*/ jsx(ValueMenuFooterHints, {
|
|
94
119
|
multiSelect: multiSelect
|
|
95
120
|
})
|
|
@@ -111,19 +136,20 @@ const NestedValueMenu = ({ values, onSelect, onCommit, open = false, onOpenChang
|
|
|
111
136
|
onMouseEnter: state.cancelClose,
|
|
112
137
|
onMouseLeave: state.scheduleClose,
|
|
113
138
|
children: /*#__PURE__*/ jsxs(DropdownMenuGroup, {
|
|
139
|
+
className: "flex flex-col gap-1",
|
|
114
140
|
children: [
|
|
115
|
-
/*#__PURE__*/ jsx(
|
|
116
|
-
|
|
117
|
-
|
|
141
|
+
submenuSelectAllRow && /*#__PURE__*/ jsx(NestedValueMenuItem, {
|
|
142
|
+
id: SELECT_ALL_ID,
|
|
143
|
+
option: submenuSelectAllRow.option,
|
|
144
|
+
isGroup: false,
|
|
145
|
+
checkedState: state.getRowCheckState(submenuSelectAllRow),
|
|
146
|
+
isPending: state.submenuPendingIds.has(SELECT_ALL_ID),
|
|
147
|
+
multiSelect: multiSelect,
|
|
118
148
|
onSelect: ()=>state.toggleGroup(openParentRow.option),
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
size: "sm",
|
|
122
|
-
color: "secondary",
|
|
123
|
-
children: allChecked ? 'Unselect all' : 'Select all'
|
|
124
|
-
})
|
|
149
|
+
registerRef: state.registerSubmenuItem(SELECT_ALL_ID),
|
|
150
|
+
selectAll: true
|
|
125
151
|
}),
|
|
126
|
-
/*#__PURE__*/ jsx(DropdownMenuSeparator, {}),
|
|
152
|
+
submenuSelectAllRow && /*#__PURE__*/ jsx(DropdownMenuSeparator, {}),
|
|
127
153
|
state.submenuRows.map((row)=>/*#__PURE__*/ jsx(NestedValueMenuItem, {
|
|
128
154
|
id: row.id,
|
|
129
155
|
option: row.option,
|
package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenuItem.d.ts
CHANGED
|
@@ -15,12 +15,20 @@ interface NestedValueMenuItemProps {
|
|
|
15
15
|
registerRef?: (el: HTMLElement | null) => void;
|
|
16
16
|
/** For group rows: whether its submenu is currently open. */
|
|
17
17
|
expanded?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* True for the synthetic "All {group}" bulk-select row: its label renders in a
|
|
20
|
+
* medium weight to read as a section-level control rather than a plain option.
|
|
21
|
+
*/
|
|
22
|
+
selectAll?: boolean;
|
|
23
|
+
/** Active search query — its matched substring is emphasized in flat search. */
|
|
24
|
+
highlight?: string;
|
|
18
25
|
}
|
|
19
26
|
/**
|
|
20
|
-
* A single row in the nested value menu — a committable leaf
|
|
21
|
-
*
|
|
22
|
-
* submenu
|
|
23
|
-
*
|
|
27
|
+
* A single row in the nested value menu — a committable leaf, a group (parent
|
|
28
|
+
* category), or the "All {group}" bulk-select row. Parent categories show a
|
|
29
|
+
* right-side chevron and open a submenu on hover; a checked row is highlighted
|
|
30
|
+
* with a persistent background. Selection is driven by the (tri-state, for
|
|
31
|
+
* groups) checkbox.
|
|
24
32
|
*/
|
|
25
33
|
export declare const NestedValueMenuItem: FC<NestedValueMenuItemProps>;
|
|
26
34
|
export {};
|
package/dist/components/FilterInput/FilterInputMenu/FilterInputValueMenu/NestedValueMenuItem.js
CHANGED
|
@@ -1,15 +1,48 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChevronRight } from "../../../../icons/ChevronRight.js";
|
|
3
|
+
import { cn } from "../../../../utils/cn.js";
|
|
2
4
|
import { Badge } from "../../../Badge/index.js";
|
|
3
5
|
import { Checkmark } from "../../../Checkmark/index.js";
|
|
4
6
|
import { DropdownMenuItem } from "../../../DropdownMenu/index.js";
|
|
5
7
|
import { Text } from "../../../Text/index.js";
|
|
6
|
-
const
|
|
8
|
+
const highlightMatch = (text, query)=>{
|
|
9
|
+
const q = query?.trim().toLowerCase();
|
|
10
|
+
if (!q) return text;
|
|
11
|
+
const lower = text.toLowerCase();
|
|
12
|
+
const parts = [];
|
|
13
|
+
let cursor = 0;
|
|
14
|
+
let key = 0;
|
|
15
|
+
while(cursor < text.length){
|
|
16
|
+
const at = lower.indexOf(q, cursor);
|
|
17
|
+
if (-1 === at) {
|
|
18
|
+
parts.push(/*#__PURE__*/ jsx("span", {
|
|
19
|
+
children: text.slice(cursor)
|
|
20
|
+
}, key++));
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
if (at > cursor) parts.push(/*#__PURE__*/ jsx("span", {
|
|
24
|
+
children: text.slice(cursor, at)
|
|
25
|
+
}, key++));
|
|
26
|
+
parts.push(/*#__PURE__*/ jsx("mark", {
|
|
27
|
+
className: "bg-transparent font-medium text-text-brand",
|
|
28
|
+
children: text.slice(at, at + q.length)
|
|
29
|
+
}, key++));
|
|
30
|
+
cursor = at + q.length;
|
|
31
|
+
}
|
|
32
|
+
return parts;
|
|
33
|
+
};
|
|
34
|
+
const NestedValueMenuItem = ({ id, option, isGroup, checkedState, isPending, multiSelect, onSelect, onMouseEnter, onMouseLeave, registerRef, expanded, selectAll, highlight })=>{
|
|
35
|
+
const isChecked = true === checkedState;
|
|
36
|
+
const checkmark = multiSelect || !isGroup && checkedState ? /*#__PURE__*/ jsx(Checkmark, {
|
|
37
|
+
checkedState: multiSelect ? checkedState : true
|
|
38
|
+
}) : null;
|
|
39
|
+
return /*#__PURE__*/ jsxs(DropdownMenuItem, {
|
|
7
40
|
value: id,
|
|
8
41
|
ref: registerRef,
|
|
9
42
|
onSelect: onSelect,
|
|
10
43
|
onMouseEnter: onMouseEnter,
|
|
11
44
|
onMouseLeave: onMouseLeave,
|
|
12
|
-
className:
|
|
45
|
+
className: cn('scroll-mt-32', isChecked && 'bg-states-primary-active', isPending && 'bg-states-primary-hover'),
|
|
13
46
|
"aria-checked": multiSelect ? 'indeterminate' === checkedState ? 'mixed' : !!checkedState : void 0,
|
|
14
47
|
...isGroup && {
|
|
15
48
|
'aria-haspopup': 'menu',
|
|
@@ -26,29 +59,30 @@ const NestedValueMenuItem = ({ id, option, isGroup, checkedState, isPending, mul
|
|
|
26
59
|
children: [
|
|
27
60
|
/*#__PURE__*/ jsx(Text, {
|
|
28
61
|
size: "sm",
|
|
62
|
+
weight: selectAll ? 'medium' : 'regular',
|
|
29
63
|
truncate: true,
|
|
30
|
-
children: option.label
|
|
64
|
+
children: highlightMatch(option.label, highlight)
|
|
31
65
|
}),
|
|
32
66
|
option.description && /*#__PURE__*/ jsx(Text, {
|
|
33
67
|
size: "xs",
|
|
34
68
|
color: "secondary",
|
|
35
69
|
truncate: true,
|
|
36
|
-
children: option.description
|
|
70
|
+
children: highlightMatch(option.description, highlight)
|
|
37
71
|
})
|
|
38
72
|
]
|
|
39
73
|
}),
|
|
40
|
-
|
|
41
|
-
className: "flex shrink-0 items-
|
|
42
|
-
children:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}) : null
|
|
74
|
+
/*#__PURE__*/ jsxs("div", {
|
|
75
|
+
className: "flex shrink-0 items-center justify-end gap-8 ml-auto",
|
|
76
|
+
children: [
|
|
77
|
+
isGroup && /*#__PURE__*/ jsx("span", {
|
|
78
|
+
className: "flex text-text-secondary",
|
|
79
|
+
children: /*#__PURE__*/ jsx(ChevronRight, {})
|
|
80
|
+
}),
|
|
81
|
+
checkmark
|
|
82
|
+
]
|
|
83
|
+
})
|
|
51
84
|
]
|
|
52
85
|
});
|
|
86
|
+
};
|
|
53
87
|
NestedValueMenuItem.displayName = 'NestedValueMenuItem';
|
|
54
88
|
export { NestedValueMenuItem };
|
|
@@ -32,12 +32,12 @@ const ValueMenuItem = ({ option, isChecked, isPending, multiSelect, onSelect, re
|
|
|
32
32
|
]
|
|
33
33
|
}),
|
|
34
34
|
multiSelect ? /*#__PURE__*/ jsx("div", {
|
|
35
|
-
className: "flex shrink-0 items-start justify-end
|
|
35
|
+
className: "flex shrink-0 items-start justify-end ml-auto",
|
|
36
36
|
children: /*#__PURE__*/ jsx(Checkmark, {
|
|
37
37
|
checkedState: isChecked
|
|
38
38
|
})
|
|
39
39
|
}) : isChecked ? /*#__PURE__*/ jsx("div", {
|
|
40
|
-
className: "flex shrink-0 items-start justify-end
|
|
40
|
+
className: "flex shrink-0 items-start justify-end ml-auto",
|
|
41
41
|
children: /*#__PURE__*/ jsx(Checkmark, {
|
|
42
42
|
checkedState: true
|
|
43
43
|
})
|
|
@@ -41,6 +41,10 @@ export declare const useNestedValueMenuState: ({ sections, allValues, open, mult
|
|
|
41
41
|
closeParent: () => void;
|
|
42
42
|
cancelClose: () => void;
|
|
43
43
|
scheduleClose: () => void;
|
|
44
|
+
handleMainMouseMove: (event: {
|
|
45
|
+
clientX: number;
|
|
46
|
+
clientY: number;
|
|
47
|
+
}) => void;
|
|
44
48
|
openParentRow: ValueMenuRow | undefined;
|
|
45
49
|
submenuRows: ValueMenuRow[];
|
|
46
50
|
selectRow: (row: ValueMenuRow, fromSubmenu: boolean) => void;
|