@rufous/ui 0.3.18 → 0.3.19

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/main.cjs CHANGED
@@ -168,6 +168,12 @@ __export(main_exports, {
168
168
  ViewIcon: () => viewIcon_default,
169
169
  WorkItemIcon: () => workItemIcon_default,
170
170
  Zoom: () => Zoom,
171
+ getAllCountries: () => getAllCountries2,
172
+ getCitiesOfCountry: () => getCitiesOfCountry,
173
+ getCitiesOfState: () => getCitiesOfState,
174
+ getCountryByCode: () => getCountryByCode,
175
+ getStateByCode: () => getStateByCode,
176
+ getStatesOfCountry: () => getStatesOfCountry,
171
177
  transformLegacyTodos: () => transformLegacyTodos,
172
178
  useRufousTheme: () => useRufousTheme
173
179
  });
@@ -13616,6 +13622,57 @@ var RufousTextContent = ({ content, className, style, sx }) => {
13616
13622
  }
13617
13623
  );
13618
13624
  };
13625
+
13626
+ // lib/utils/locationData.ts
13627
+ var import_country_state_city3 = require("country-state-city");
13628
+ var _stateNameCache = /* @__PURE__ */ new Map();
13629
+ function getStateNameMap(countryCode) {
13630
+ if (!_stateNameCache.has(countryCode)) {
13631
+ const map = /* @__PURE__ */ new Map();
13632
+ import_country_state_city3.State.getStatesOfCountry(countryCode).forEach((s2) => map.set(s2.isoCode, s2.name));
13633
+ _stateNameCache.set(countryCode, map);
13634
+ }
13635
+ return _stateNameCache.get(countryCode);
13636
+ }
13637
+ function getAllCountries2() {
13638
+ return import_country_state_city3.Country.getAllCountries();
13639
+ }
13640
+ function getCountryByCode(isoCode) {
13641
+ return import_country_state_city3.Country.getCountryByCode(isoCode) ?? void 0;
13642
+ }
13643
+ function getStatesOfCountry(countryCode) {
13644
+ const countryName = import_country_state_city3.Country.getCountryByCode(countryCode)?.name ?? "";
13645
+ return import_country_state_city3.State.getStatesOfCountry(countryCode).map((state) => ({
13646
+ ...state,
13647
+ countryName
13648
+ }));
13649
+ }
13650
+ function getStateByCode(stateCode, countryCode) {
13651
+ const state = import_country_state_city3.State.getStateByCodeAndCountry(stateCode, countryCode);
13652
+ if (!state) return void 0;
13653
+ const countryName = import_country_state_city3.Country.getCountryByCode(countryCode)?.name ?? "";
13654
+ return { ...state, countryName };
13655
+ }
13656
+ function getCitiesOfState(countryCode, stateCode) {
13657
+ const countryName = import_country_state_city3.Country.getCountryByCode(countryCode)?.name ?? "";
13658
+ const stateName = import_country_state_city3.State.getStateByCodeAndCountry(stateCode, countryCode)?.name ?? "";
13659
+ return import_country_state_city3.City.getCitiesOfState(countryCode, stateCode).map((city) => ({
13660
+ ...city,
13661
+ cityCode: city.name.slice(0, 3),
13662
+ countryName,
13663
+ stateName
13664
+ }));
13665
+ }
13666
+ function getCitiesOfCountry(countryCode) {
13667
+ const countryName = import_country_state_city3.Country.getCountryByCode(countryCode)?.name ?? "";
13668
+ const stateNameMap = getStateNameMap(countryCode);
13669
+ return (import_country_state_city3.City.getCitiesOfCountry(countryCode) ?? []).map((city) => ({
13670
+ ...city,
13671
+ cityCode: city.name.slice(0, 3),
13672
+ countryName,
13673
+ stateName: stateNameMap.get(city.stateCode) ?? ""
13674
+ }));
13675
+ }
13619
13676
  // Annotate the CommonJS export names for ESM import in node:
13620
13677
  0 && (module.exports = {
13621
13678
  APP_THEMES,
@@ -13757,6 +13814,12 @@ var RufousTextContent = ({ content, className, style, sx }) => {
13757
13814
  ViewIcon,
13758
13815
  WorkItemIcon,
13759
13816
  Zoom,
13817
+ getAllCountries,
13818
+ getCitiesOfCountry,
13819
+ getCitiesOfState,
13820
+ getCountryByCode,
13821
+ getStateByCode,
13822
+ getStatesOfCountry,
13760
13823
  transformLegacyTodos,
13761
13824
  useRufousTheme
13762
13825
  });
package/dist/main.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode, CSSProperties, InputHTMLAttributes, TextareaHTMLAttributes, ReactElement, ComponentType } from 'react';
3
+ import { ICity, ICountry, IState } from 'country-state-city';
3
4
 
4
5
  declare const APP_THEMES: {
5
6
  default: {
@@ -2058,4 +2059,48 @@ interface MentionItemData {
2058
2059
  shortName?: string;
2059
2060
  }
2060
2061
 
2061
- export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, type NumberVariant, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, SmartSelect, type SmartSelectProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, type TreeNode, TreeSelect, type TreeSelectMultiValue, type TreeSelectProps, type TreeSelectValue, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, type UserOption, UserSelectionField, type UserSelectionFieldProps, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, transformLegacyTodos, useRufousTheme };
2062
+ /** Country same shape as the library; re-exported with a typed name for convenience. */
2063
+ type EnhancedCountry = ICountry;
2064
+ /** State enriched with the full name of its parent country. */
2065
+ interface EnhancedState extends IState {
2066
+ countryName: string;
2067
+ }
2068
+ /** City enriched with a short city code and the full state + country names. */
2069
+ interface EnhancedCity extends ICity {
2070
+ /** First three characters of the city name (e.g. "Des" for "Des Moines"). */
2071
+ cityCode: string;
2072
+ /** Full name of the parent country (e.g. "United States"). */
2073
+ countryName: string;
2074
+ /** Full name of the parent state (e.g. "Iowa"). */
2075
+ stateName: string;
2076
+ }
2077
+ /** Returns all countries (same data as the library, typed as EnhancedCountry). */
2078
+ declare function getAllCountries(): EnhancedCountry[];
2079
+ /** Returns a single country by its ISO 2-letter code, or undefined if not found. */
2080
+ declare function getCountryByCode(isoCode: string): EnhancedCountry | undefined;
2081
+ /**
2082
+ * Returns all states for a country, each enriched with `countryName`.
2083
+ * @param countryCode ISO 2-letter country code, e.g. "US"
2084
+ */
2085
+ declare function getStatesOfCountry(countryCode: string): EnhancedState[];
2086
+ /**
2087
+ * Returns a single state by its code + parent country, enriched with `countryName`.
2088
+ * @param stateCode ISO state code, e.g. "IA"
2089
+ * @param countryCode ISO 2-letter country code, e.g. "US"
2090
+ */
2091
+ declare function getStateByCode(stateCode: string, countryCode: string): EnhancedState | undefined;
2092
+ /**
2093
+ * Returns all cities for a given state, each enriched with `cityCode`, `countryName`,
2094
+ * and `stateName`.
2095
+ * @param countryCode ISO 2-letter country code, e.g. "US"
2096
+ * @param stateCode ISO state code, e.g. "IA"
2097
+ */
2098
+ declare function getCitiesOfState(countryCode: string, stateCode: string): EnhancedCity[];
2099
+ /**
2100
+ * Returns all cities for a given country, each enriched with `cityCode`, `countryName`,
2101
+ * and `stateName`.
2102
+ * @param countryCode ISO 2-letter country code, e.g. "US"
2103
+ */
2104
+ declare function getCitiesOfCountry(countryCode: string): EnhancedCity[];
2105
+
2106
+ export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, type EnhancedCity, type EnhancedCountry, type EnhancedState, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, type NumberVariant, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, SmartSelect, type SmartSelectProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, type TreeNode, TreeSelect, type TreeSelectMultiValue, type TreeSelectProps, type TreeSelectValue, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, type UserOption, UserSelectionField, type UserSelectionFieldProps, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, getAllCountries, getCitiesOfCountry, getCitiesOfState, getCountryByCode, getStateByCode, getStatesOfCountry, transformLegacyTodos, useRufousTheme };
package/dist/main.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import React__default, { ReactNode, CSSProperties, InputHTMLAttributes, TextareaHTMLAttributes, ReactElement, ComponentType } from 'react';
3
+ import { ICity, ICountry, IState } from 'country-state-city';
3
4
 
4
5
  declare const APP_THEMES: {
5
6
  default: {
@@ -2058,4 +2059,48 @@ interface MentionItemData {
2058
2059
  shortName?: string;
2059
2060
  }
2060
2061
 
2061
- export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, type NumberVariant, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, SmartSelect, type SmartSelectProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, type TreeNode, TreeSelect, type TreeSelectMultiValue, type TreeSelectProps, type TreeSelectValue, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, type UserOption, UserSelectionField, type UserSelectionFieldProps, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, transformLegacyTodos, useRufousTheme };
2062
+ /** Country same shape as the library; re-exported with a typed name for convenience. */
2063
+ type EnhancedCountry = ICountry;
2064
+ /** State enriched with the full name of its parent country. */
2065
+ interface EnhancedState extends IState {
2066
+ countryName: string;
2067
+ }
2068
+ /** City enriched with a short city code and the full state + country names. */
2069
+ interface EnhancedCity extends ICity {
2070
+ /** First three characters of the city name (e.g. "Des" for "Des Moines"). */
2071
+ cityCode: string;
2072
+ /** Full name of the parent country (e.g. "United States"). */
2073
+ countryName: string;
2074
+ /** Full name of the parent state (e.g. "Iowa"). */
2075
+ stateName: string;
2076
+ }
2077
+ /** Returns all countries (same data as the library, typed as EnhancedCountry). */
2078
+ declare function getAllCountries(): EnhancedCountry[];
2079
+ /** Returns a single country by its ISO 2-letter code, or undefined if not found. */
2080
+ declare function getCountryByCode(isoCode: string): EnhancedCountry | undefined;
2081
+ /**
2082
+ * Returns all states for a country, each enriched with `countryName`.
2083
+ * @param countryCode ISO 2-letter country code, e.g. "US"
2084
+ */
2085
+ declare function getStatesOfCountry(countryCode: string): EnhancedState[];
2086
+ /**
2087
+ * Returns a single state by its code + parent country, enriched with `countryName`.
2088
+ * @param stateCode ISO state code, e.g. "IA"
2089
+ * @param countryCode ISO 2-letter country code, e.g. "US"
2090
+ */
2091
+ declare function getStateByCode(stateCode: string, countryCode: string): EnhancedState | undefined;
2092
+ /**
2093
+ * Returns all cities for a given state, each enriched with `cityCode`, `countryName`,
2094
+ * and `stateName`.
2095
+ * @param countryCode ISO 2-letter country code, e.g. "US"
2096
+ * @param stateCode ISO state code, e.g. "IA"
2097
+ */
2098
+ declare function getCitiesOfState(countryCode: string, stateCode: string): EnhancedCity[];
2099
+ /**
2100
+ * Returns all cities for a given country, each enriched with `cityCode`, `countryName`,
2101
+ * and `stateName`.
2102
+ * @param countryCode ISO 2-letter country code, e.g. "US"
2103
+ */
2104
+ declare function getCitiesOfCountry(countryCode: string): EnhancedCity[];
2105
+
2106
+ export { APP_THEMES, Accordion, AccordionDetails, type AccordionDetailsProps, type AccordionProps, AccordionSummary, type AccordionSummaryProps, type Action, ActivateUserIcon, AddButton, AddressLookup, ArchivedIcon, AssignGroupIcon, Autocomplete, type AutocompleteProps, Avatar, AvatarGroup, type AvatarGroupProps, type AvatarProps, BaseDialog, Box, type BoxProps, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonProps, CameraIcon, CancelButton, Card, CardActions, type CardActionsProps, CardContent, type CardContentProps, CardHeader, type CardHeaderProps, CardMedia, type CardMediaProps, type CardProps, Checkbox, type CheckboxProps, Chip, type ChipProps, CircularProgress, CircularProgressIcon, type CircularProgressIconProps, CloseIcon, Collapse, type CollapseProps, type Column, CopyIcon, DataGrid, type DataGridProps, DateField, type DateFieldProps, type DateFormatString, DateRangeField, type DateRangeFieldProps, type DateRangeValue, DifficultyAllIcon, DifficultyEasyIcon, DifficultyHardIcon, DifficultyMediumIcon, Divider, type DividerProps, DollarIcon, DownloadIcon, DownloadPdfIcon, Drawer, type DrawerProps, EditChatIcon, EditIcon, EngagementIcon, type EnhancedCity, type EnhancedCountry, type EnhancedState, Fade, type FadeProps, FunctionIcon, Grid, type GridProps, Grow, type GrowProps, HelpOutlinedIcon, HierarchyIcon, IconButton, type IconButtonProps, ImageField, type ImageFieldProps, InactiveGroupIcon, IndustryIcon, InvoiceIcon, Link, type LinkProps, List, ListItem, ListItemButton, type ListItemButtonProps, ListItemIcon, type ListItemIconProps, type ListItemProps, ListItemText, type ListItemTextProps, type ListProps, ListSubheader, type ListSubheaderProps, LocationPinIcon, LogsIcon, Menu, MenuDivider, MenuItem, type MenuItemProps, MenuList, type MenuListProps, type MenuProps, MinExperienceIcon, NineDotMenuIcon, NotificationIcon, type NumberVariant, Paper, type PaperProps, PhoneField, type PhoneFieldProps, Popover, type PopoverProps, Popper, type PopperProps, ProjectIcon, QualificationsIcon, QuestionStatusAllIcon, QuestionStatusPrivateIcon, QuestionStatusPublicIcon, QuestionTypeAllIcon, QuestionTypeCodingIcon, QuestionTypeDescriptiveIcon, QuestionTypeMultipleIcon, QuestionTypeSingleIcon, Radio, RadioGroup, type RadioGroupProps, type RadioProps, Rating, type RatingProps, RefreshIcon, ResendInviteIcon, RolesIcon, RufousAiIcon, RufousBirdIcon, RufousLauncherIcon, RufousLogoLoader, type RufousLogoLoaderProps, RufousTextContent, type RufousTextContentProps, RufousTextEditor, type MentionItemData as RufousTextEditorMentionItem, type RufousTextEditorProps, RufousThemeProvider, Select, type SelectProps, SidebarIcon, Skeleton, type SkeletonProps, Slide, type SlideProps, Slider, type SliderProps, SmartSelect, type SmartSelectProps, Snackbar, type SnackbarProps, SoftSkillsIcon, type SortDirection, Stack, type StackProps, StandardButton, Step, StepButton, type StepButtonProps, StepContent, type StepContentProps, StepLabel, type StepLabelProps, type StepProps, Stepper, type StepperProps, SubmitButton, SubscribeIcon, SuspendUserIcon, Switch, type SwitchProps, type SxProp, Tab, TabPanel, type TabPanelProps, type TabProps, Tabs, type TabsProps, TechnicalSkillsIcon, TextField, type TextFieldProps, TickIcon, TimerIcon, ToggleButton, ToggleButtonGroup, type ToggleButtonGroupProps, type ToggleButtonProps, Tooltip, type TooltipProps, TrashIcon, type TreeNode, TreeSelect, type TreeSelectMultiValue, type TreeSelectProps, type TreeSelectValue, Typography, type TypographyProps, UnArchivedIcon, UnsubscribeIcon, UploadIcon, UserAssignIcon, type UserOption, UserSelectionField, type UserSelectionFieldProps, ViewIcon, WorkItemIcon, Zoom, type ZoomProps, getAllCountries, getCitiesOfCountry, getCitiesOfState, getCountryByCode, getStateByCode, getStatesOfCountry, transformLegacyTodos, useRufousTheme };
package/dist/main.js CHANGED
@@ -13555,6 +13555,57 @@ var RufousTextContent = ({ content, className, style, sx }) => {
13555
13555
  }
13556
13556
  );
13557
13557
  };
13558
+
13559
+ // lib/utils/locationData.ts
13560
+ import { Country as Country3, State as State2, City as City2 } from "country-state-city";
13561
+ var _stateNameCache = /* @__PURE__ */ new Map();
13562
+ function getStateNameMap(countryCode) {
13563
+ if (!_stateNameCache.has(countryCode)) {
13564
+ const map = /* @__PURE__ */ new Map();
13565
+ State2.getStatesOfCountry(countryCode).forEach((s2) => map.set(s2.isoCode, s2.name));
13566
+ _stateNameCache.set(countryCode, map);
13567
+ }
13568
+ return _stateNameCache.get(countryCode);
13569
+ }
13570
+ function getAllCountries2() {
13571
+ return Country3.getAllCountries();
13572
+ }
13573
+ function getCountryByCode(isoCode) {
13574
+ return Country3.getCountryByCode(isoCode) ?? void 0;
13575
+ }
13576
+ function getStatesOfCountry(countryCode) {
13577
+ const countryName = Country3.getCountryByCode(countryCode)?.name ?? "";
13578
+ return State2.getStatesOfCountry(countryCode).map((state) => ({
13579
+ ...state,
13580
+ countryName
13581
+ }));
13582
+ }
13583
+ function getStateByCode(stateCode, countryCode) {
13584
+ const state = State2.getStateByCodeAndCountry(stateCode, countryCode);
13585
+ if (!state) return void 0;
13586
+ const countryName = Country3.getCountryByCode(countryCode)?.name ?? "";
13587
+ return { ...state, countryName };
13588
+ }
13589
+ function getCitiesOfState(countryCode, stateCode) {
13590
+ const countryName = Country3.getCountryByCode(countryCode)?.name ?? "";
13591
+ const stateName = State2.getStateByCodeAndCountry(stateCode, countryCode)?.name ?? "";
13592
+ return City2.getCitiesOfState(countryCode, stateCode).map((city) => ({
13593
+ ...city,
13594
+ cityCode: city.name.slice(0, 3),
13595
+ countryName,
13596
+ stateName
13597
+ }));
13598
+ }
13599
+ function getCitiesOfCountry(countryCode) {
13600
+ const countryName = Country3.getCountryByCode(countryCode)?.name ?? "";
13601
+ const stateNameMap = getStateNameMap(countryCode);
13602
+ return (City2.getCitiesOfCountry(countryCode) ?? []).map((city) => ({
13603
+ ...city,
13604
+ cityCode: city.name.slice(0, 3),
13605
+ countryName,
13606
+ stateName: stateNameMap.get(city.stateCode) ?? ""
13607
+ }));
13608
+ }
13558
13609
  export {
13559
13610
  APP_THEMES,
13560
13611
  Accordion,
@@ -13695,6 +13746,12 @@ export {
13695
13746
  viewIcon_default as ViewIcon,
13696
13747
  workItemIcon_default as WorkItemIcon,
13697
13748
  Zoom,
13749
+ getAllCountries2 as getAllCountries,
13750
+ getCitiesOfCountry,
13751
+ getCitiesOfState,
13752
+ getCountryByCode,
13753
+ getStateByCode,
13754
+ getStatesOfCountry,
13698
13755
  transformLegacyTodos,
13699
13756
  useRufousTheme
13700
13757
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@rufous/ui",
3
3
  "private": false,
4
- "version": "0.3.18",
4
+ "version": "0.3.19",
5
5
  "type": "module",
6
6
  "description": "Experimental: A lightweight React UI component library (Beta)",
7
7
  "style": "./dist/main.css",