@yr3/ui 1.0.12 → 1.0.13
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/index.cjs +41 -31
- package/dist/index.d.cts +99 -87
- package/dist/index.d.ts +99 -87
- package/dist/index.js +41 -32
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -60,6 +60,7 @@ __export(index_exports, {
|
|
|
60
60
|
Modal: () => Modal,
|
|
61
61
|
ModalContainer: () => ModalContainer,
|
|
62
62
|
Notistack: () => Notistack,
|
|
63
|
+
NotistackContext: () => NotistackContext,
|
|
63
64
|
NotistackProvider: () => NotistackProvider,
|
|
64
65
|
Pending: () => Pending,
|
|
65
66
|
Phone: () => Phone,
|
|
@@ -2595,16 +2596,51 @@ var IconSearch = (props) => {
|
|
|
2595
2596
|
};
|
|
2596
2597
|
|
|
2597
2598
|
// src/theme/ThemeProvider.tsx
|
|
2599
|
+
var React22 = __toESM(require("react"), 1);
|
|
2600
|
+
|
|
2601
|
+
// src/theme/notistackContext.tsx
|
|
2598
2602
|
var React21 = __toESM(require("react"), 1);
|
|
2599
2603
|
var import_jsx_runtime39 = require("react/jsx-runtime");
|
|
2600
|
-
var
|
|
2604
|
+
var NotistackContext = React21.createContext(null);
|
|
2605
|
+
var NotistackProvider = ({ children }) => {
|
|
2606
|
+
const [snacks, setSnacks] = React21.useState([]);
|
|
2607
|
+
const notistack = (snack) => {
|
|
2608
|
+
const id = Date.now();
|
|
2609
|
+
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
2610
|
+
const duration = snack.duration || 3e3;
|
|
2611
|
+
const exitDuration = 300;
|
|
2612
|
+
setTimeout(() => {
|
|
2613
|
+
setSnacks(
|
|
2614
|
+
(prev) => prev.map((s) => s.id === id ? { ...s, exiting: true } : s)
|
|
2615
|
+
);
|
|
2616
|
+
}, duration);
|
|
2617
|
+
setTimeout(() => {
|
|
2618
|
+
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2619
|
+
}, duration + exitDuration);
|
|
2620
|
+
};
|
|
2621
|
+
return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(NotistackContext.Provider, { value: { notistack }, children: [
|
|
2622
|
+
children,
|
|
2623
|
+
/* @__PURE__ */ (0, import_jsx_runtime39.jsx)("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Notistack, { ...snack }, snack.id)) })
|
|
2624
|
+
] });
|
|
2625
|
+
};
|
|
2626
|
+
var useNotistack = () => {
|
|
2627
|
+
const ctx = React21.useContext(NotistackContext);
|
|
2628
|
+
if (!ctx) {
|
|
2629
|
+
throw new Error("NotistackProvider missing");
|
|
2630
|
+
}
|
|
2631
|
+
return ctx;
|
|
2632
|
+
};
|
|
2633
|
+
|
|
2634
|
+
// src/theme/ThemeProvider.tsx
|
|
2635
|
+
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2636
|
+
var ThemeContext = React22.createContext(null);
|
|
2601
2637
|
var ThemeProvider = ({ theme, children }) => {
|
|
2602
|
-
|
|
2638
|
+
React22.useEffect(() => {
|
|
2603
2639
|
applyTheme(theme);
|
|
2604
2640
|
}, [theme]);
|
|
2605
|
-
return /* @__PURE__ */ (0,
|
|
2641
|
+
return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(BackdropProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(NotistackProvider, { children }) }) });
|
|
2606
2642
|
};
|
|
2607
|
-
var useTheme = () =>
|
|
2643
|
+
var useTheme = () => React22.useContext(ThemeContext);
|
|
2608
2644
|
|
|
2609
2645
|
// src/theme/tokens.ts
|
|
2610
2646
|
var baseTokens = {
|
|
@@ -2624,33 +2660,6 @@ var baseTokens = {
|
|
|
2624
2660
|
}
|
|
2625
2661
|
};
|
|
2626
2662
|
|
|
2627
|
-
// src/theme/notistackContext.tsx
|
|
2628
|
-
var React22 = __toESM(require("react"), 1);
|
|
2629
|
-
var import_jsx_runtime40 = require("react/jsx-runtime");
|
|
2630
|
-
var NotistackContext = React22.createContext(null);
|
|
2631
|
-
var NotistackProvider = ({ children }) => {
|
|
2632
|
-
const [snacks, setSnacks] = React22.useState([]);
|
|
2633
|
-
const enqueueNotistack = (snack) => {
|
|
2634
|
-
const id = Date.now();
|
|
2635
|
-
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
2636
|
-
const duration = snack.duration || 3e3;
|
|
2637
|
-
const exitDuration = 300;
|
|
2638
|
-
setTimeout(() => {
|
|
2639
|
-
setSnacks(
|
|
2640
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, exiting: true } : s)
|
|
2641
|
-
);
|
|
2642
|
-
}, duration);
|
|
2643
|
-
setTimeout(() => {
|
|
2644
|
-
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2645
|
-
}, duration + exitDuration);
|
|
2646
|
-
};
|
|
2647
|
-
return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(NotistackContext.Provider, { value: { enqueueNotistack }, children: [
|
|
2648
|
-
children,
|
|
2649
|
-
/* @__PURE__ */ (0, import_jsx_runtime40.jsx)("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Notistack, { ...snack }, snack.id)) })
|
|
2650
|
-
] });
|
|
2651
|
-
};
|
|
2652
|
-
var useNotistack = () => React22.useContext(NotistackContext);
|
|
2653
|
-
|
|
2654
2663
|
// src/theme/useMediaQuery.tsx
|
|
2655
2664
|
var React23 = __toESM(require("react"), 1);
|
|
2656
2665
|
function useMediaQuery(query) {
|
|
@@ -2762,6 +2771,7 @@ initTheme();
|
|
|
2762
2771
|
Modal,
|
|
2763
2772
|
ModalContainer,
|
|
2764
2773
|
Notistack,
|
|
2774
|
+
NotistackContext,
|
|
2765
2775
|
NotistackProvider,
|
|
2766
2776
|
Pending,
|
|
2767
2777
|
Phone,
|
package/dist/index.d.cts
CHANGED
|
@@ -1079,8 +1079,105 @@ declare const baseTokens: {
|
|
|
1079
1079
|
};
|
|
1080
1080
|
};
|
|
1081
1081
|
|
|
1082
|
+
declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
|
|
1083
|
+
declare const bemMerge: (...args: any[]) => string;
|
|
1084
|
+
|
|
1085
|
+
type CalendarDayProps = {
|
|
1086
|
+
day: number;
|
|
1087
|
+
date: Dayjs;
|
|
1088
|
+
isToday: boolean;
|
|
1089
|
+
isPast: boolean;
|
|
1090
|
+
isFuture: boolean;
|
|
1091
|
+
isCurrentMonth: boolean;
|
|
1092
|
+
selected: any;
|
|
1093
|
+
data?: any;
|
|
1094
|
+
};
|
|
1095
|
+
type CalendarComponentProps = {
|
|
1096
|
+
calendar: (CalendarDayProps | null)[][];
|
|
1097
|
+
month: number;
|
|
1098
|
+
monthLabel: string;
|
|
1099
|
+
yearLabel: string;
|
|
1100
|
+
daysContainer: number[];
|
|
1101
|
+
days: number;
|
|
1102
|
+
weeks: number;
|
|
1103
|
+
isWeekend: boolean;
|
|
1104
|
+
date: Dayjs;
|
|
1105
|
+
selected: CalendarDayProps | null;
|
|
1106
|
+
currentDay: CalendarDayProps;
|
|
1107
|
+
props?: any;
|
|
1108
|
+
};
|
|
1109
|
+
declare function getMonthCalendar(year: number, month: number, startIndex: number, selected: CalendarDayProps, props?: any): CalendarComponentProps;
|
|
1110
|
+
|
|
1111
|
+
declare const adjustColor: (hex: string, amount: number) => string;
|
|
1112
|
+
declare const getContrast: (hex: string) => "#000000" | "#ffffff";
|
|
1113
|
+
declare const createPaletteColor: (main: string) => PaletteColor;
|
|
1114
|
+
|
|
1115
|
+
declare function isEmpty(value: unknown): boolean;
|
|
1116
|
+
declare function times<T>(n: number, iteratee: (index: number) => T): T[];
|
|
1117
|
+
|
|
1118
|
+
declare const cx: (...args: any[]) => string;
|
|
1119
|
+
|
|
1120
|
+
type VariantConfig = {
|
|
1121
|
+
base: string;
|
|
1122
|
+
variants?: Record<string, Record<string, string>>;
|
|
1123
|
+
};
|
|
1124
|
+
declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
|
|
1125
|
+
|
|
1126
|
+
type CountriesDial = {
|
|
1127
|
+
code: string;
|
|
1128
|
+
dial: string;
|
|
1129
|
+
label: string;
|
|
1130
|
+
};
|
|
1131
|
+
declare const normalizePhone: (phone: string, dial: string) => {
|
|
1132
|
+
number: string;
|
|
1133
|
+
full: string;
|
|
1134
|
+
} | null;
|
|
1135
|
+
declare const getDialPhone: (phone: string, countries: CountriesDial[]) => string | null;
|
|
1136
|
+
declare const getCountryCodePhone: (phone: string, countries: CountriesDial[]) => string | null;
|
|
1137
|
+
declare const getNumberPhone: (phone: string, dial: string) => string;
|
|
1138
|
+
|
|
1139
|
+
type NotistackAnchorProps = {
|
|
1140
|
+
vertical: 'top' | 'bottom';
|
|
1141
|
+
horizontal: 'left' | 'center' | 'right';
|
|
1142
|
+
};
|
|
1143
|
+
type NotistackProps = {
|
|
1144
|
+
message: string;
|
|
1145
|
+
duration?: number;
|
|
1146
|
+
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
1147
|
+
color?: keyof Theme['colors'];
|
|
1148
|
+
anchor?: NotistackAnchorProps;
|
|
1149
|
+
exiting?: boolean;
|
|
1150
|
+
propsComponent?: {
|
|
1151
|
+
notistack?: {
|
|
1152
|
+
ui?: UIProps;
|
|
1153
|
+
style?: React.CSSProperties;
|
|
1154
|
+
};
|
|
1155
|
+
container?: {
|
|
1156
|
+
ui?: UIProps;
|
|
1157
|
+
style?: React.CSSProperties;
|
|
1158
|
+
};
|
|
1159
|
+
progress?: {
|
|
1160
|
+
ui?: UIProps;
|
|
1161
|
+
style?: React.CSSProperties;
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
declare const Notistack: React.FC<NotistackProps>;
|
|
1166
|
+
|
|
1167
|
+
type Snack = NotistackProps & {
|
|
1168
|
+
id: number;
|
|
1169
|
+
message: string;
|
|
1170
|
+
duration?: number;
|
|
1171
|
+
variant?: 'success' | 'error' | 'info';
|
|
1172
|
+
exiting?: boolean;
|
|
1173
|
+
anchor?: NotistackAnchorProps;
|
|
1174
|
+
};
|
|
1175
|
+
type NotistackContextType = {
|
|
1176
|
+
notistack: (snack: Snack) => void;
|
|
1177
|
+
};
|
|
1178
|
+
declare const NotistackContext: React$1.Context<NotistackContextType | null>;
|
|
1082
1179
|
declare const NotistackProvider: ({ children }: any) => react_jsx_runtime.JSX.Element;
|
|
1083
|
-
declare const useNotistack: () =>
|
|
1180
|
+
declare const useNotistack: () => NotistackContextType;
|
|
1084
1181
|
|
|
1085
1182
|
declare function useMediaQuery(query: string | ((theme: any) => string)): boolean;
|
|
1086
1183
|
type Breakpoint = keyof typeof breakpoints;
|
|
@@ -1355,63 +1452,6 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
|
|
|
1355
1452
|
};
|
|
1356
1453
|
} & React$1.RefAttributes<HTMLInputElement>>;
|
|
1357
1454
|
|
|
1358
|
-
declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
|
|
1359
|
-
declare const bemMerge: (...args: any[]) => string;
|
|
1360
|
-
|
|
1361
|
-
type CalendarDayProps = {
|
|
1362
|
-
day: number;
|
|
1363
|
-
date: Dayjs;
|
|
1364
|
-
isToday: boolean;
|
|
1365
|
-
isPast: boolean;
|
|
1366
|
-
isFuture: boolean;
|
|
1367
|
-
isCurrentMonth: boolean;
|
|
1368
|
-
selected: any;
|
|
1369
|
-
data?: any;
|
|
1370
|
-
};
|
|
1371
|
-
type CalendarComponentProps = {
|
|
1372
|
-
calendar: (CalendarDayProps | null)[][];
|
|
1373
|
-
month: number;
|
|
1374
|
-
monthLabel: string;
|
|
1375
|
-
yearLabel: string;
|
|
1376
|
-
daysContainer: number[];
|
|
1377
|
-
days: number;
|
|
1378
|
-
weeks: number;
|
|
1379
|
-
isWeekend: boolean;
|
|
1380
|
-
date: Dayjs;
|
|
1381
|
-
selected: CalendarDayProps | null;
|
|
1382
|
-
currentDay: CalendarDayProps;
|
|
1383
|
-
props?: any;
|
|
1384
|
-
};
|
|
1385
|
-
declare function getMonthCalendar(year: number, month: number, startIndex: number, selected: CalendarDayProps, props?: any): CalendarComponentProps;
|
|
1386
|
-
|
|
1387
|
-
declare const adjustColor: (hex: string, amount: number) => string;
|
|
1388
|
-
declare const getContrast: (hex: string) => "#000000" | "#ffffff";
|
|
1389
|
-
declare const createPaletteColor: (main: string) => PaletteColor;
|
|
1390
|
-
|
|
1391
|
-
declare function isEmpty(value: unknown): boolean;
|
|
1392
|
-
declare function times<T>(n: number, iteratee: (index: number) => T): T[];
|
|
1393
|
-
|
|
1394
|
-
declare const cx: (...args: any[]) => string;
|
|
1395
|
-
|
|
1396
|
-
type VariantConfig = {
|
|
1397
|
-
base: string;
|
|
1398
|
-
variants?: Record<string, Record<string, string>>;
|
|
1399
|
-
};
|
|
1400
|
-
declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
|
|
1401
|
-
|
|
1402
|
-
type CountriesDial = {
|
|
1403
|
-
code: string;
|
|
1404
|
-
dial: string;
|
|
1405
|
-
label: string;
|
|
1406
|
-
};
|
|
1407
|
-
declare const normalizePhone: (phone: string, dial: string) => {
|
|
1408
|
-
number: string;
|
|
1409
|
-
full: string;
|
|
1410
|
-
} | null;
|
|
1411
|
-
declare const getDialPhone: (phone: string, countries: CountriesDial[]) => string | null;
|
|
1412
|
-
declare const getCountryCodePhone: (phone: string, countries: CountriesDial[]) => string | null;
|
|
1413
|
-
declare const getNumberPhone: (phone: string, dial: string) => string;
|
|
1414
|
-
|
|
1415
1455
|
type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
|
|
1416
1456
|
type InputAreaProps = {
|
|
1417
1457
|
value?: string;
|
|
@@ -1454,34 +1494,6 @@ type ModalProps = {
|
|
|
1454
1494
|
};
|
|
1455
1495
|
declare const Modal: React$1.FC<ModalProps>;
|
|
1456
1496
|
|
|
1457
|
-
type NotistackAnchorProps = {
|
|
1458
|
-
vertical: 'top' | 'bottom';
|
|
1459
|
-
horizontal: 'left' | 'center' | 'right';
|
|
1460
|
-
};
|
|
1461
|
-
type NotistackProps = {
|
|
1462
|
-
message: string;
|
|
1463
|
-
duration?: number;
|
|
1464
|
-
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
1465
|
-
color?: keyof Theme['colors'];
|
|
1466
|
-
anchor?: NotistackAnchorProps;
|
|
1467
|
-
exiting?: boolean;
|
|
1468
|
-
propsComponent?: {
|
|
1469
|
-
notistack?: {
|
|
1470
|
-
ui?: UIProps;
|
|
1471
|
-
style?: React.CSSProperties;
|
|
1472
|
-
};
|
|
1473
|
-
container?: {
|
|
1474
|
-
ui?: UIProps;
|
|
1475
|
-
style?: React.CSSProperties;
|
|
1476
|
-
};
|
|
1477
|
-
progress?: {
|
|
1478
|
-
ui?: UIProps;
|
|
1479
|
-
style?: React.CSSProperties;
|
|
1480
|
-
};
|
|
1481
|
-
};
|
|
1482
|
-
};
|
|
1483
|
-
declare const Notistack: React.FC<NotistackProps>;
|
|
1484
|
-
|
|
1485
1497
|
type PendingProps = {
|
|
1486
1498
|
variant?: 'rect' | 'circle' | 'text';
|
|
1487
1499
|
width?: number | string;
|
|
@@ -1706,4 +1718,4 @@ declare const breakUp: (bp: number) => string;
|
|
|
1706
1718
|
declare const breakDown: (bp: number) => string;
|
|
1707
1719
|
declare function useBreakpoint(queryInput: QueryInput): boolean;
|
|
1708
1720
|
|
|
1709
|
-
export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, type ButtonVariant, Calendar, type CalendarComponentProps, type CalendarDayProps, type CalendarProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Collapse, type CollapseProps, Container, type ContainerProps, Control, ControlContext, type ControlProps, type ControlVariants, type CountriesDial, Divider, type DividerProps, Drawer, type DrawerProps, Fade, type FadeProps, Flex, type FlexProps, Grid, type GridProps, Group, type GroupProps, type GroupsVariant, IconClose, IconDown, IconSearch, Image, ImageDropzone, type ImageProps, Input, InputArea, type InputAreaProps, type InputAreaVariant, type InputProps, Label, type LabelProps, Modal, ModalContainer, type ModalContainerProps, type ModalProps, Notistack, type NotistackAnchorProps, type NotistackProps, NotistackProvider, type Option, Pending, type PendingProps, Phone, type PhoneInputProps, type PlaceData, PlacesAutocomplete, type PropsPlaces, Radio, type RadioVariant, Select, type SelectChangeEvent, type SelectOptionsProps, type SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, Switch, type SwitchProps, Text, type TextProps, type TextVariant, type TextWeight, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakDown, breakUp, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getCountryCodePhone, getDialPhone, getMonthCalendar, getNumberPhone, initTheme, isEmpty, normalizePhone, text, times, uiStyle, useBackdrop, useBreakpoint, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, usePlaces, useTheme };
|
|
1721
|
+
export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, type ButtonVariant, Calendar, type CalendarComponentProps, type CalendarDayProps, type CalendarProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Collapse, type CollapseProps, Container, type ContainerProps, Control, ControlContext, type ControlProps, type ControlVariants, type CountriesDial, Divider, type DividerProps, Drawer, type DrawerProps, Fade, type FadeProps, Flex, type FlexProps, Grid, type GridProps, Group, type GroupProps, type GroupsVariant, IconClose, IconDown, IconSearch, Image, ImageDropzone, type ImageProps, Input, InputArea, type InputAreaProps, type InputAreaVariant, type InputProps, Label, type LabelProps, Modal, ModalContainer, type ModalContainerProps, type ModalProps, Notistack, type NotistackAnchorProps, NotistackContext, type NotistackContextType, type NotistackProps, NotistackProvider, type Option, Pending, type PendingProps, Phone, type PhoneInputProps, type PlaceData, PlacesAutocomplete, type PropsPlaces, Radio, type RadioVariant, Select, type SelectChangeEvent, type SelectOptionsProps, type SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, type Snack, Switch, type SwitchProps, Text, type TextProps, type TextVariant, type TextWeight, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakDown, breakUp, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getCountryCodePhone, getDialPhone, getMonthCalendar, getNumberPhone, initTheme, isEmpty, normalizePhone, text, times, uiStyle, useBackdrop, useBreakpoint, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, usePlaces, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -1079,8 +1079,105 @@ declare const baseTokens: {
|
|
|
1079
1079
|
};
|
|
1080
1080
|
};
|
|
1081
1081
|
|
|
1082
|
+
declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
|
|
1083
|
+
declare const bemMerge: (...args: any[]) => string;
|
|
1084
|
+
|
|
1085
|
+
type CalendarDayProps = {
|
|
1086
|
+
day: number;
|
|
1087
|
+
date: Dayjs;
|
|
1088
|
+
isToday: boolean;
|
|
1089
|
+
isPast: boolean;
|
|
1090
|
+
isFuture: boolean;
|
|
1091
|
+
isCurrentMonth: boolean;
|
|
1092
|
+
selected: any;
|
|
1093
|
+
data?: any;
|
|
1094
|
+
};
|
|
1095
|
+
type CalendarComponentProps = {
|
|
1096
|
+
calendar: (CalendarDayProps | null)[][];
|
|
1097
|
+
month: number;
|
|
1098
|
+
monthLabel: string;
|
|
1099
|
+
yearLabel: string;
|
|
1100
|
+
daysContainer: number[];
|
|
1101
|
+
days: number;
|
|
1102
|
+
weeks: number;
|
|
1103
|
+
isWeekend: boolean;
|
|
1104
|
+
date: Dayjs;
|
|
1105
|
+
selected: CalendarDayProps | null;
|
|
1106
|
+
currentDay: CalendarDayProps;
|
|
1107
|
+
props?: any;
|
|
1108
|
+
};
|
|
1109
|
+
declare function getMonthCalendar(year: number, month: number, startIndex: number, selected: CalendarDayProps, props?: any): CalendarComponentProps;
|
|
1110
|
+
|
|
1111
|
+
declare const adjustColor: (hex: string, amount: number) => string;
|
|
1112
|
+
declare const getContrast: (hex: string) => "#000000" | "#ffffff";
|
|
1113
|
+
declare const createPaletteColor: (main: string) => PaletteColor;
|
|
1114
|
+
|
|
1115
|
+
declare function isEmpty(value: unknown): boolean;
|
|
1116
|
+
declare function times<T>(n: number, iteratee: (index: number) => T): T[];
|
|
1117
|
+
|
|
1118
|
+
declare const cx: (...args: any[]) => string;
|
|
1119
|
+
|
|
1120
|
+
type VariantConfig = {
|
|
1121
|
+
base: string;
|
|
1122
|
+
variants?: Record<string, Record<string, string>>;
|
|
1123
|
+
};
|
|
1124
|
+
declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
|
|
1125
|
+
|
|
1126
|
+
type CountriesDial = {
|
|
1127
|
+
code: string;
|
|
1128
|
+
dial: string;
|
|
1129
|
+
label: string;
|
|
1130
|
+
};
|
|
1131
|
+
declare const normalizePhone: (phone: string, dial: string) => {
|
|
1132
|
+
number: string;
|
|
1133
|
+
full: string;
|
|
1134
|
+
} | null;
|
|
1135
|
+
declare const getDialPhone: (phone: string, countries: CountriesDial[]) => string | null;
|
|
1136
|
+
declare const getCountryCodePhone: (phone: string, countries: CountriesDial[]) => string | null;
|
|
1137
|
+
declare const getNumberPhone: (phone: string, dial: string) => string;
|
|
1138
|
+
|
|
1139
|
+
type NotistackAnchorProps = {
|
|
1140
|
+
vertical: 'top' | 'bottom';
|
|
1141
|
+
horizontal: 'left' | 'center' | 'right';
|
|
1142
|
+
};
|
|
1143
|
+
type NotistackProps = {
|
|
1144
|
+
message: string;
|
|
1145
|
+
duration?: number;
|
|
1146
|
+
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
1147
|
+
color?: keyof Theme['colors'];
|
|
1148
|
+
anchor?: NotistackAnchorProps;
|
|
1149
|
+
exiting?: boolean;
|
|
1150
|
+
propsComponent?: {
|
|
1151
|
+
notistack?: {
|
|
1152
|
+
ui?: UIProps;
|
|
1153
|
+
style?: React.CSSProperties;
|
|
1154
|
+
};
|
|
1155
|
+
container?: {
|
|
1156
|
+
ui?: UIProps;
|
|
1157
|
+
style?: React.CSSProperties;
|
|
1158
|
+
};
|
|
1159
|
+
progress?: {
|
|
1160
|
+
ui?: UIProps;
|
|
1161
|
+
style?: React.CSSProperties;
|
|
1162
|
+
};
|
|
1163
|
+
};
|
|
1164
|
+
};
|
|
1165
|
+
declare const Notistack: React.FC<NotistackProps>;
|
|
1166
|
+
|
|
1167
|
+
type Snack = NotistackProps & {
|
|
1168
|
+
id: number;
|
|
1169
|
+
message: string;
|
|
1170
|
+
duration?: number;
|
|
1171
|
+
variant?: 'success' | 'error' | 'info';
|
|
1172
|
+
exiting?: boolean;
|
|
1173
|
+
anchor?: NotistackAnchorProps;
|
|
1174
|
+
};
|
|
1175
|
+
type NotistackContextType = {
|
|
1176
|
+
notistack: (snack: Snack) => void;
|
|
1177
|
+
};
|
|
1178
|
+
declare const NotistackContext: React$1.Context<NotistackContextType | null>;
|
|
1082
1179
|
declare const NotistackProvider: ({ children }: any) => react_jsx_runtime.JSX.Element;
|
|
1083
|
-
declare const useNotistack: () =>
|
|
1180
|
+
declare const useNotistack: () => NotistackContextType;
|
|
1084
1181
|
|
|
1085
1182
|
declare function useMediaQuery(query: string | ((theme: any) => string)): boolean;
|
|
1086
1183
|
type Breakpoint = keyof typeof breakpoints;
|
|
@@ -1355,63 +1452,6 @@ declare const Input: React$1.ForwardRefExoticComponent<Omit<React$1.InputHTMLAtt
|
|
|
1355
1452
|
};
|
|
1356
1453
|
} & React$1.RefAttributes<HTMLInputElement>>;
|
|
1357
1454
|
|
|
1358
|
-
declare const bem: (block: string) => (element?: string, modifiers?: Record<string, any>) => string;
|
|
1359
|
-
declare const bemMerge: (...args: any[]) => string;
|
|
1360
|
-
|
|
1361
|
-
type CalendarDayProps = {
|
|
1362
|
-
day: number;
|
|
1363
|
-
date: Dayjs;
|
|
1364
|
-
isToday: boolean;
|
|
1365
|
-
isPast: boolean;
|
|
1366
|
-
isFuture: boolean;
|
|
1367
|
-
isCurrentMonth: boolean;
|
|
1368
|
-
selected: any;
|
|
1369
|
-
data?: any;
|
|
1370
|
-
};
|
|
1371
|
-
type CalendarComponentProps = {
|
|
1372
|
-
calendar: (CalendarDayProps | null)[][];
|
|
1373
|
-
month: number;
|
|
1374
|
-
monthLabel: string;
|
|
1375
|
-
yearLabel: string;
|
|
1376
|
-
daysContainer: number[];
|
|
1377
|
-
days: number;
|
|
1378
|
-
weeks: number;
|
|
1379
|
-
isWeekend: boolean;
|
|
1380
|
-
date: Dayjs;
|
|
1381
|
-
selected: CalendarDayProps | null;
|
|
1382
|
-
currentDay: CalendarDayProps;
|
|
1383
|
-
props?: any;
|
|
1384
|
-
};
|
|
1385
|
-
declare function getMonthCalendar(year: number, month: number, startIndex: number, selected: CalendarDayProps, props?: any): CalendarComponentProps;
|
|
1386
|
-
|
|
1387
|
-
declare const adjustColor: (hex: string, amount: number) => string;
|
|
1388
|
-
declare const getContrast: (hex: string) => "#000000" | "#ffffff";
|
|
1389
|
-
declare const createPaletteColor: (main: string) => PaletteColor;
|
|
1390
|
-
|
|
1391
|
-
declare function isEmpty(value: unknown): boolean;
|
|
1392
|
-
declare function times<T>(n: number, iteratee: (index: number) => T): T[];
|
|
1393
|
-
|
|
1394
|
-
declare const cx: (...args: any[]) => string;
|
|
1395
|
-
|
|
1396
|
-
type VariantConfig = {
|
|
1397
|
-
base: string;
|
|
1398
|
-
variants?: Record<string, Record<string, string>>;
|
|
1399
|
-
};
|
|
1400
|
-
declare const createVariants: (config: VariantConfig) => (props?: Record<string, any>) => string;
|
|
1401
|
-
|
|
1402
|
-
type CountriesDial = {
|
|
1403
|
-
code: string;
|
|
1404
|
-
dial: string;
|
|
1405
|
-
label: string;
|
|
1406
|
-
};
|
|
1407
|
-
declare const normalizePhone: (phone: string, dial: string) => {
|
|
1408
|
-
number: string;
|
|
1409
|
-
full: string;
|
|
1410
|
-
} | null;
|
|
1411
|
-
declare const getDialPhone: (phone: string, countries: CountriesDial[]) => string | null;
|
|
1412
|
-
declare const getCountryCodePhone: (phone: string, countries: CountriesDial[]) => string | null;
|
|
1413
|
-
declare const getNumberPhone: (phone: string, dial: string) => string;
|
|
1414
|
-
|
|
1415
1455
|
type InputAreaVariant = 'filled' | 'outlined' | 'base' | 'lined';
|
|
1416
1456
|
type InputAreaProps = {
|
|
1417
1457
|
value?: string;
|
|
@@ -1454,34 +1494,6 @@ type ModalProps = {
|
|
|
1454
1494
|
};
|
|
1455
1495
|
declare const Modal: React$1.FC<ModalProps>;
|
|
1456
1496
|
|
|
1457
|
-
type NotistackAnchorProps = {
|
|
1458
|
-
vertical: 'top' | 'bottom';
|
|
1459
|
-
horizontal: 'left' | 'center' | 'right';
|
|
1460
|
-
};
|
|
1461
|
-
type NotistackProps = {
|
|
1462
|
-
message: string;
|
|
1463
|
-
duration?: number;
|
|
1464
|
-
variant?: 'info' | 'success' | 'warning' | 'error';
|
|
1465
|
-
color?: keyof Theme['colors'];
|
|
1466
|
-
anchor?: NotistackAnchorProps;
|
|
1467
|
-
exiting?: boolean;
|
|
1468
|
-
propsComponent?: {
|
|
1469
|
-
notistack?: {
|
|
1470
|
-
ui?: UIProps;
|
|
1471
|
-
style?: React.CSSProperties;
|
|
1472
|
-
};
|
|
1473
|
-
container?: {
|
|
1474
|
-
ui?: UIProps;
|
|
1475
|
-
style?: React.CSSProperties;
|
|
1476
|
-
};
|
|
1477
|
-
progress?: {
|
|
1478
|
-
ui?: UIProps;
|
|
1479
|
-
style?: React.CSSProperties;
|
|
1480
|
-
};
|
|
1481
|
-
};
|
|
1482
|
-
};
|
|
1483
|
-
declare const Notistack: React.FC<NotistackProps>;
|
|
1484
|
-
|
|
1485
1497
|
type PendingProps = {
|
|
1486
1498
|
variant?: 'rect' | 'circle' | 'text';
|
|
1487
1499
|
width?: number | string;
|
|
@@ -1706,4 +1718,4 @@ declare const breakUp: (bp: number) => string;
|
|
|
1706
1718
|
declare const breakDown: (bp: number) => string;
|
|
1707
1719
|
declare function useBreakpoint(queryInput: QueryInput): boolean;
|
|
1708
1720
|
|
|
1709
|
-
export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, type ButtonVariant, Calendar, type CalendarComponentProps, type CalendarDayProps, type CalendarProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Collapse, type CollapseProps, Container, type ContainerProps, Control, ControlContext, type ControlProps, type ControlVariants, type CountriesDial, Divider, type DividerProps, Drawer, type DrawerProps, Fade, type FadeProps, Flex, type FlexProps, Grid, type GridProps, Group, type GroupProps, type GroupsVariant, IconClose, IconDown, IconSearch, Image, ImageDropzone, type ImageProps, Input, InputArea, type InputAreaProps, type InputAreaVariant, type InputProps, Label, type LabelProps, Modal, ModalContainer, type ModalContainerProps, type ModalProps, Notistack, type NotistackAnchorProps, type NotistackProps, NotistackProvider, type Option, Pending, type PendingProps, Phone, type PhoneInputProps, type PlaceData, PlacesAutocomplete, type PropsPlaces, Radio, type RadioVariant, Select, type SelectChangeEvent, type SelectOptionsProps, type SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, Switch, type SwitchProps, Text, type TextProps, type TextVariant, type TextWeight, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakDown, breakUp, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getCountryCodePhone, getDialPhone, getMonthCalendar, getNumberPhone, initTheme, isEmpty, normalizePhone, text, times, uiStyle, useBackdrop, useBreakpoint, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, usePlaces, useTheme };
|
|
1721
|
+
export { Avatar, type AvatarProps, Backdrop, BackdropContext, type BackdropContextType, BackdropProvider, Box, type BoxProps, Button, type ButtonProps, type ButtonVariant, Calendar, type CalendarComponentProps, type CalendarDayProps, type CalendarProps, Checkbox, type CheckboxProps, Chip, type ChipProps, Collapse, type CollapseProps, Container, type ContainerProps, Control, ControlContext, type ControlProps, type ControlVariants, type CountriesDial, Divider, type DividerProps, Drawer, type DrawerProps, Fade, type FadeProps, Flex, type FlexProps, Grid, type GridProps, Group, type GroupProps, type GroupsVariant, IconClose, IconDown, IconSearch, Image, ImageDropzone, type ImageProps, Input, InputArea, type InputAreaProps, type InputAreaVariant, type InputProps, Label, type LabelProps, Modal, ModalContainer, type ModalContainerProps, type ModalProps, Notistack, type NotistackAnchorProps, NotistackContext, type NotistackContextType, type NotistackProps, NotistackProvider, type Option, Pending, type PendingProps, Phone, type PhoneInputProps, type PlaceData, PlacesAutocomplete, type PropsPlaces, Radio, type RadioVariant, Select, type SelectChangeEvent, type SelectOptionsProps, type SelectProps, type SelectorChangeEvent, type SelectorProps, Slide, type SlideContentProps, type SlideProps, type Snack, Switch, type SwitchProps, Text, type TextProps, type TextVariant, type TextWeight, type Theme, ThemeContext, ThemeProvider, type UIProps, adjustColor, applyTheme, baseTokens, bem, bemMerge, breakDown, breakUp, breakpoints, composeStyles, createPaletteColor, createTheme, createVariants, cx, getContrast, getCountryCodePhone, getDialPhone, getMonthCalendar, getNumberPhone, initTheme, isEmpty, normalizePhone, text, times, uiStyle, useBackdrop, useBreakpoint, useBreakpointValue, useClickAway, useControl, useMediaQuery, useNotistack, usePlaces, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -2486,16 +2486,51 @@ var IconSearch = (props) => {
|
|
|
2486
2486
|
};
|
|
2487
2487
|
|
|
2488
2488
|
// src/theme/ThemeProvider.tsx
|
|
2489
|
+
import * as React22 from "react";
|
|
2490
|
+
|
|
2491
|
+
// src/theme/notistackContext.tsx
|
|
2489
2492
|
import * as React21 from "react";
|
|
2490
|
-
import { jsx as jsx39 } from "react/jsx-runtime";
|
|
2491
|
-
var
|
|
2493
|
+
import { jsx as jsx39, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2494
|
+
var NotistackContext = React21.createContext(null);
|
|
2495
|
+
var NotistackProvider = ({ children }) => {
|
|
2496
|
+
const [snacks, setSnacks] = React21.useState([]);
|
|
2497
|
+
const notistack = (snack) => {
|
|
2498
|
+
const id = Date.now();
|
|
2499
|
+
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
2500
|
+
const duration = snack.duration || 3e3;
|
|
2501
|
+
const exitDuration = 300;
|
|
2502
|
+
setTimeout(() => {
|
|
2503
|
+
setSnacks(
|
|
2504
|
+
(prev) => prev.map((s) => s.id === id ? { ...s, exiting: true } : s)
|
|
2505
|
+
);
|
|
2506
|
+
}, duration);
|
|
2507
|
+
setTimeout(() => {
|
|
2508
|
+
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2509
|
+
}, duration + exitDuration);
|
|
2510
|
+
};
|
|
2511
|
+
return /* @__PURE__ */ jsxs16(NotistackContext.Provider, { value: { notistack }, children: [
|
|
2512
|
+
children,
|
|
2513
|
+
/* @__PURE__ */ jsx39("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx39(Notistack, { ...snack }, snack.id)) })
|
|
2514
|
+
] });
|
|
2515
|
+
};
|
|
2516
|
+
var useNotistack = () => {
|
|
2517
|
+
const ctx = React21.useContext(NotistackContext);
|
|
2518
|
+
if (!ctx) {
|
|
2519
|
+
throw new Error("NotistackProvider missing");
|
|
2520
|
+
}
|
|
2521
|
+
return ctx;
|
|
2522
|
+
};
|
|
2523
|
+
|
|
2524
|
+
// src/theme/ThemeProvider.tsx
|
|
2525
|
+
import { jsx as jsx40 } from "react/jsx-runtime";
|
|
2526
|
+
var ThemeContext = React22.createContext(null);
|
|
2492
2527
|
var ThemeProvider = ({ theme, children }) => {
|
|
2493
|
-
|
|
2528
|
+
React22.useEffect(() => {
|
|
2494
2529
|
applyTheme(theme);
|
|
2495
2530
|
}, [theme]);
|
|
2496
|
-
return /* @__PURE__ */
|
|
2531
|
+
return /* @__PURE__ */ jsx40(ThemeContext.Provider, { value: theme, children: /* @__PURE__ */ jsx40(BackdropProvider, { children: /* @__PURE__ */ jsx40(NotistackProvider, { children }) }) });
|
|
2497
2532
|
};
|
|
2498
|
-
var useTheme = () =>
|
|
2533
|
+
var useTheme = () => React22.useContext(ThemeContext);
|
|
2499
2534
|
|
|
2500
2535
|
// src/theme/tokens.ts
|
|
2501
2536
|
var baseTokens = {
|
|
@@ -2515,33 +2550,6 @@ var baseTokens = {
|
|
|
2515
2550
|
}
|
|
2516
2551
|
};
|
|
2517
2552
|
|
|
2518
|
-
// src/theme/notistackContext.tsx
|
|
2519
|
-
import * as React22 from "react";
|
|
2520
|
-
import { jsx as jsx40, jsxs as jsxs16 } from "react/jsx-runtime";
|
|
2521
|
-
var NotistackContext = React22.createContext(null);
|
|
2522
|
-
var NotistackProvider = ({ children }) => {
|
|
2523
|
-
const [snacks, setSnacks] = React22.useState([]);
|
|
2524
|
-
const enqueueNotistack = (snack) => {
|
|
2525
|
-
const id = Date.now();
|
|
2526
|
-
setSnacks((prev) => [...prev, { ...snack, id, exiting: false }]);
|
|
2527
|
-
const duration = snack.duration || 3e3;
|
|
2528
|
-
const exitDuration = 300;
|
|
2529
|
-
setTimeout(() => {
|
|
2530
|
-
setSnacks(
|
|
2531
|
-
(prev) => prev.map((s) => s.id === id ? { ...s, exiting: true } : s)
|
|
2532
|
-
);
|
|
2533
|
-
}, duration);
|
|
2534
|
-
setTimeout(() => {
|
|
2535
|
-
setSnacks((prev) => prev.filter((s) => s.id !== id));
|
|
2536
|
-
}, duration + exitDuration);
|
|
2537
|
-
};
|
|
2538
|
-
return /* @__PURE__ */ jsxs16(NotistackContext.Provider, { value: { enqueueNotistack }, children: [
|
|
2539
|
-
children,
|
|
2540
|
-
/* @__PURE__ */ jsx40("div", { className: "yr3NotistackContainer", children: snacks.map((snack) => /* @__PURE__ */ jsx40(Notistack, { ...snack }, snack.id)) })
|
|
2541
|
-
] });
|
|
2542
|
-
};
|
|
2543
|
-
var useNotistack = () => React22.useContext(NotistackContext);
|
|
2544
|
-
|
|
2545
2553
|
// src/theme/useMediaQuery.tsx
|
|
2546
2554
|
import * as React23 from "react";
|
|
2547
2555
|
function useMediaQuery(query) {
|
|
@@ -2652,6 +2660,7 @@ export {
|
|
|
2652
2660
|
Modal,
|
|
2653
2661
|
ModalContainer,
|
|
2654
2662
|
Notistack,
|
|
2663
|
+
NotistackContext,
|
|
2655
2664
|
NotistackProvider,
|
|
2656
2665
|
Pending,
|
|
2657
2666
|
Phone,
|