@efficiency-point/design-system 0.0.4

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.
Files changed (71) hide show
  1. package/README.md +334 -0
  2. package/dist/components/DSBadge/DSBadge.d.ts +13 -0
  3. package/dist/components/DSBadge/DSBadge.d.ts.map +1 -0
  4. package/dist/components/DSButton/DSButton.d.ts +12 -0
  5. package/dist/components/DSButton/DSButton.d.ts.map +1 -0
  6. package/dist/components/DSCheckbox/DSCheckbox.d.ts +20 -0
  7. package/dist/components/DSCheckbox/DSCheckbox.d.ts.map +1 -0
  8. package/dist/components/DSDataTable/DSDataTable.d.ts +48 -0
  9. package/dist/components/DSDataTable/DSDataTable.d.ts.map +1 -0
  10. package/dist/components/DSDateRange/DSDateRange.d.ts +28 -0
  11. package/dist/components/DSDateRange/DSDateRange.d.ts.map +1 -0
  12. package/dist/components/DSDateTimePicker/DSDateTimePicker.d.ts +21 -0
  13. package/dist/components/DSDateTimePicker/DSDateTimePicker.d.ts.map +1 -0
  14. package/dist/components/DSDropDown/DSDropDown.d.ts +25 -0
  15. package/dist/components/DSDropDown/DSDropDown.d.ts.map +1 -0
  16. package/dist/components/DSDropDownMultiple/DSDropDownMultiple.d.ts +19 -0
  17. package/dist/components/DSDropDownMultiple/DSDropDownMultiple.d.ts.map +1 -0
  18. package/dist/components/DSFilters/DSFilters.d.ts +54 -0
  19. package/dist/components/DSFilters/DSFilters.d.ts.map +1 -0
  20. package/dist/components/DSIcon/DSIcon.d.ts +8 -0
  21. package/dist/components/DSIcon/DSIcon.d.ts.map +1 -0
  22. package/dist/components/DSInfoBlock/DSInfoBlock.d.ts +12 -0
  23. package/dist/components/DSInfoBlock/DSInfoBlock.d.ts.map +1 -0
  24. package/dist/components/DSInput/DSInput.d.ts +28 -0
  25. package/dist/components/DSInput/DSInput.d.ts.map +1 -0
  26. package/dist/components/DSLoader/DSLoader.d.ts +9 -0
  27. package/dist/components/DSLoader/DSLoader.d.ts.map +1 -0
  28. package/dist/components/DSModal/DSModal.d.ts +7 -0
  29. package/dist/components/DSModal/DSModal.d.ts.map +1 -0
  30. package/dist/components/DSModal/ModalSystemProvider.d.ts +9 -0
  31. package/dist/components/DSModal/ModalSystemProvider.d.ts.map +1 -0
  32. package/dist/components/DSModal/builtins.d.ts +34 -0
  33. package/dist/components/DSModal/builtins.d.ts.map +1 -0
  34. package/dist/components/DSModal/modal.store.d.ts +15 -0
  35. package/dist/components/DSModal/modal.store.d.ts.map +1 -0
  36. package/dist/components/DSModal/modal.types.d.ts +30 -0
  37. package/dist/components/DSModal/modal.types.d.ts.map +1 -0
  38. package/dist/components/DSModal/useModals.d.ts +12 -0
  39. package/dist/components/DSModal/useModals.d.ts.map +1 -0
  40. package/dist/components/DSPageLoader/DSPageLoader.d.ts +6 -0
  41. package/dist/components/DSPageLoader/DSPageLoader.d.ts.map +1 -0
  42. package/dist/components/DSRadioButton/DSRadioButton.d.ts +13 -0
  43. package/dist/components/DSRadioButton/DSRadioButton.d.ts.map +1 -0
  44. package/dist/components/DSSkeleton/DSSkeleton.d.ts +12 -0
  45. package/dist/components/DSSkeleton/DSSkeleton.d.ts.map +1 -0
  46. package/dist/components/DSSort/DSSort.d.ts +23 -0
  47. package/dist/components/DSSort/DSSort.d.ts.map +1 -0
  48. package/dist/components/DSTimePeriodPicker/DSTimePeriodPicker.d.ts +23 -0
  49. package/dist/components/DSTimePeriodPicker/DSTimePeriodPicker.d.ts.map +1 -0
  50. package/dist/components/DSToast/DSToast.d.ts +7 -0
  51. package/dist/components/DSToast/DSToast.d.ts.map +1 -0
  52. package/dist/components/DSToast/DSToastProvider.d.ts +5 -0
  53. package/dist/components/DSToast/DSToastProvider.d.ts.map +1 -0
  54. package/dist/components/DSToast/toast.store.d.ts +10 -0
  55. package/dist/components/DSToast/toast.store.d.ts.map +1 -0
  56. package/dist/components/DSToast/toast.types.d.ts +18 -0
  57. package/dist/components/DSToast/toast.types.d.ts.map +1 -0
  58. package/dist/components/DSToast/useToast.d.ts +12 -0
  59. package/dist/components/DSToast/useToast.d.ts.map +1 -0
  60. package/dist/components/DSTooltip/DSTooltip.d.ts +13 -0
  61. package/dist/components/DSTooltip/DSTooltip.d.ts.map +1 -0
  62. package/dist/components/DSVideoPlayerFrame/DSVideoPlayerFrame.d.ts +25 -0
  63. package/dist/components/DSVideoPlayerFrame/DSVideoPlayerFrame.d.ts.map +1 -0
  64. package/dist/components/Field/DSField.d.ts +18 -0
  65. package/dist/components/Field/DSField.d.ts.map +1 -0
  66. package/dist/index.cjs +1 -0
  67. package/dist/index.d.ts +33 -0
  68. package/dist/index.d.ts.map +1 -0
  69. package/dist/index.es.js +1411 -0
  70. package/dist/style.css +2 -0
  71. package/package.json +88 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSInfoBlock.d.ts","sourceRoot":"","sources":["../../../src/components/DSInfoBlock/DSInfoBlock.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,SAAS,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC,WAAW,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC,CAAC;IACnE,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,WAAW,GAAI,2FAQzB,gBAAgB,gCAuClB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { FocusEventHandler, HTMLInputTypeAttribute } from 'react';
2
+ export type DSInputValue = string | number;
3
+ export type DSInputProps = {
4
+ value: DSInputValue;
5
+ onChange?: (value: DSInputValue, event: React.ChangeEvent<HTMLInputElement>) => void;
6
+ type?: HTMLInputTypeAttribute;
7
+ placeholder?: string;
8
+ disabled?: boolean;
9
+ readOnly?: boolean;
10
+ stringWhileDisabled?: boolean;
11
+ label?: string;
12
+ error?: string;
13
+ hint?: string;
14
+ className?: string;
15
+ name?: string;
16
+ id?: string;
17
+ clearable?: boolean;
18
+ required?: boolean;
19
+ autoComplete?: string;
20
+ maxLength?: number;
21
+ min?: number;
22
+ max?: number;
23
+ step?: number;
24
+ onBlur?: FocusEventHandler<HTMLInputElement>;
25
+ onFocus?: FocusEventHandler<HTMLInputElement>;
26
+ };
27
+ export declare const DSInput: ({ value, onChange, type, placeholder, disabled, readOnly, stringWhileDisabled, label, error, hint, className, name, id, clearable, required, ...inputProps }: DSInputProps) => import("react").JSX.Element;
28
+ //# sourceMappingURL=DSInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSInput.d.ts","sourceRoot":"","sources":["../../../src/components/DSInput/DSInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,iBAAiB,EAAE,KAAK,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAI3F,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,MAAM,CAAC;AAE3C,MAAM,MAAM,YAAY,GAAG;IACvB,KAAK,EAAE,YAAY,CAAC;IACpB,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IACrF,IAAI,CAAC,EAAE,sBAAsB,CAAC;IAC9B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,iBAAiB,CAAC,gBAAgB,CAAC,CAAC;CACjD,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,8JAiBrB,YAAY,gCAiFd,CAAC"}
@@ -0,0 +1,9 @@
1
+ export type DSLoaderVariant = 'primary' | 'secondary' | 'light' | 'danger';
2
+ export type DSLoaderProps = {
3
+ variant?: DSLoaderVariant;
4
+ label?: string;
5
+ className?: string;
6
+ decorative?: boolean;
7
+ };
8
+ export declare const DSLoader: ({ variant, label, className, decorative, }: DSLoaderProps) => import("react").JSX.Element;
9
+ //# sourceMappingURL=DSLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSLoader.d.ts","sourceRoot":"","sources":["../../../src/components/DSLoader/DSLoader.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF,eAAO,MAAM,QAAQ,GAAI,4CAKtB,aAAa,gCAOf,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { DSModalFrameProps, ModalRegistry } from './modal.types';
2
+ export declare const DSModalFrame: ({ children, title, description, modalId, closeLabel, className, role, }: DSModalFrameProps) => import("react").JSX.Element;
3
+ export type DSModalProps = {
4
+ registry: ModalRegistry;
5
+ };
6
+ export declare const DSModal: ({ registry }: DSModalProps) => import('react').ReactPortal | null;
7
+ //# sourceMappingURL=DSModal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSModal.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/DSModal.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAKtE,eAAO,MAAM,YAAY,GAAI,yEAQ1B,iBAAiB,gCAkEnB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACvB,QAAQ,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,cAAc,YAAY,uCA8CjD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { ModalRegistry } from './modal.types';
3
+ export type ModalSystemProviderProps<R extends ModalRegistry = ModalRegistry> = {
4
+ registry: R;
5
+ children: ReactNode;
6
+ lockBodyScroll?: boolean;
7
+ };
8
+ export declare const ModalSystemProvider: <R extends ModalRegistry>({ registry, children, lockBodyScroll, }: ModalSystemProviderProps<R>) => import("react").JSX.Element;
9
+ //# sourceMappingURL=ModalSystemProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ModalSystemProvider.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/ModalSystemProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGnD,MAAM,MAAM,wBAAwB,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI;IAC5E,QAAQ,EAAE,CAAC,CAAC;IACZ,QAAQ,EAAE,SAAS,CAAC;IACpB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,aAAa,EAAE,yCAI1D,wBAAwB,CAAC,CAAC,CAAC,gCAe7B,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { ModalControls } from './modal.types';
2
+ export type ConfirmModalTone = 'default' | 'danger';
3
+ export type ConfirmModalPayload = {
4
+ title?: string;
5
+ message?: string;
6
+ confirmLabel?: string;
7
+ cancelLabel?: string;
8
+ tone?: ConfirmModalTone;
9
+ requestId: string;
10
+ };
11
+ export type ConfirmModalOptions = Omit<ConfirmModalPayload, 'requestId'>;
12
+ export declare const ConfirmModal: ({ modalId, close, title, message, confirmLabel, cancelLabel, tone, requestId, }: ConfirmModalPayload & ModalControls) => import("react").JSX.Element;
13
+ export type ErrorModalPayload = {
14
+ title?: string;
15
+ message: string;
16
+ closeLabel?: string;
17
+ };
18
+ export declare const ErrorModal: ({ modalId, close, title, message, closeLabel, }: ErrorModalPayload & ModalControls) => import("react").JSX.Element;
19
+ export declare const builtInModalRegistry: {
20
+ ConfirmModal: ({ modalId, close, title, message, confirmLabel, cancelLabel, tone, requestId, }: ConfirmModalPayload & ModalControls) => import("react").JSX.Element;
21
+ ErrorModal: ({ modalId, close, title, message, closeLabel, }: ErrorModalPayload & ModalControls) => import("react").JSX.Element;
22
+ };
23
+ export type UseConfirmModalResult = (options?: ConfirmModalOptions) => Promise<boolean>;
24
+ export declare const useConfirmModal: () => UseConfirmModalResult;
25
+ export type UseErrorModalResult = {
26
+ showError: (error: unknown, title?: string) => string;
27
+ };
28
+ export declare const getErrorMessage: (error: unknown) => string;
29
+ export declare const useErrorModal: () => UseErrorModalResult;
30
+ export type LegacyConfirmModalState = ConfirmModalOptions;
31
+ export declare const useConfirmModalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ConfirmModalOptions>>;
32
+ export type LegacyErrorModalState = Partial<ErrorModalPayload>;
33
+ export declare const useErrorModalStore: import('zustand').UseBoundStore<import('zustand').StoreApi<Partial<ErrorModalPayload>>>;
34
+ //# sourceMappingURL=builtins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtins.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/builtins.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAuB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAIxE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,CAAC;AACpD,MAAM,MAAM,mBAAmB,GAAG;IAC9B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;CACrB,CAAC;AACF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,CAAC;AAMzE,eAAO,MAAM,YAAY,GAAI,iFAS1B,mBAAmB,GAAG,aAAa,gCA2BrC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,iDAMxB,iBAAiB,GAAG,aAAa,gCAWnC,CAAC;AAEF,eAAO,MAAM,oBAAoB;oGAtD9B,mBAAmB,GAAG,aAAa;kEAyCnC,iBAAiB,GAAG,aAAa;CAgBlC,CAAC;AAEH,MAAM,MAAM,qBAAqB,GAAG,CAAC,OAAO,CAAC,EAAE,mBAAmB,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAExF,eAAO,MAAM,eAAe,QAAO,qBAQlC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAC9B,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;CACzD,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,OAAO,OAAO,KAAG,MAKhD,CAAC;AAEF,eAAO,MAAM,aAAa,QAAO,mBAGhC,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,mBAAmB,CAAC;AAC1D,eAAO,MAAM,oBAAoB,kFAA8C,CAAC;AAChF,MAAM,MAAM,qBAAqB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAC/D,eAAO,MAAM,kBAAkB,yFAA4C,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { ModalEntry, ModalId, ModalPayload } from './modal.types';
2
+ export type OpenModalOptions = {
3
+ closeOnEscape?: boolean;
4
+ closeOnBackdrop?: boolean;
5
+ };
6
+ export type ModalStoreState = {
7
+ modals: ModalEntry[];
8
+ openModal: (name: string, payload?: ModalPayload, options?: OpenModalOptions) => ModalId;
9
+ closeModal: (id: ModalId) => void;
10
+ closeTopModal: () => void;
11
+ closeAllModals: () => void;
12
+ };
13
+ export declare const useModalsStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ModalStoreState>>;
14
+ export declare const resetModalStore: () => void;
15
+ //# sourceMappingURL=modal.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.store.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/modal.store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,gBAAgB,GAAG;IAC3B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC1B,MAAM,EAAE,UAAU,EAAE,CAAC;IACrB,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,OAAO,CAAC;IACzF,UAAU,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,IAAI,CAAC;IAClC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAIF,eAAO,MAAM,cAAc,8EAmBxB,CAAC;AAEJ,eAAO,MAAM,eAAe,YAAgD,CAAC"}
@@ -0,0 +1,30 @@
1
+ import { ComponentType, ReactNode } from 'react';
2
+ export type ModalId = string;
3
+ export type ModalPayload = Record<string, unknown>;
4
+ export type ModalControls = {
5
+ modalId: ModalId;
6
+ close: () => void;
7
+ closeAll: () => void;
8
+ };
9
+ export type ModalRenderer<P extends ModalPayload = ModalPayload> = ComponentType<P & ModalControls>;
10
+ export type ModalRegistry = Record<string, ModalRenderer<any>>;
11
+ export type ModalName<R extends ModalRegistry = ModalRegistry> = Extract<keyof R, string>;
12
+ export type ModalPayloadFor<R extends ModalRegistry, K extends ModalName<R>> = Omit<React.ComponentProps<R[K]>, keyof ModalControls>;
13
+ export type ModalEntry = {
14
+ id: ModalId;
15
+ name: string;
16
+ payload: ModalPayload;
17
+ closeOnEscape: boolean;
18
+ closeOnBackdrop: boolean;
19
+ };
20
+ export type DSModalFrameProps = {
21
+ children: ReactNode;
22
+ title?: ReactNode;
23
+ description?: ReactNode;
24
+ modalId: ModalId;
25
+ closeLabel?: string;
26
+ className?: string;
27
+ role?: 'dialog' | 'alertdialog';
28
+ };
29
+ export declare const defineModalRegistry: <R extends ModalRegistry>(registry: R) => R;
30
+ //# sourceMappingURL=modal.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"modal.types.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/modal.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtD,MAAM,MAAM,OAAO,GAAG,MAAM,CAAC;AAC7B,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,aAAa,CAAC,CAAC,SAAS,YAAY,GAAG,YAAY,IAAI,aAAa,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC;AAGpG,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,MAAM,SAAS,CAAC,CAAC,SAAS,aAAa,GAAG,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;AAC1F,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,aAAa,EAAE,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,MAAM,aAAa,CAAC,CAAC;AAErI,MAAM,MAAM,UAAU,GAAG;IACrB,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,YAAY,CAAC;IACtB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC5B,QAAQ,EAAE,SAAS,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,aAAa,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAAI,CAAC,SAAS,aAAa,EAAE,UAAU,CAAC,MAAa,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ModalName, ModalPayloadFor, ModalRegistry } from './modal.types';
2
+ import { OpenModalOptions } from './modal.store';
3
+ export type UseModalsResult<R extends ModalRegistry> = {
4
+ openModal: <K extends ModalName<R>>(name: K, payload?: ModalPayloadFor<R, K>, options?: OpenModalOptions) => string;
5
+ closeModal: (id: string) => void;
6
+ closeTopModal: () => void;
7
+ closeAllModals: () => void;
8
+ isOpen: (name: ModalName<R>) => boolean;
9
+ count: number;
10
+ };
11
+ export declare const useModals: <R extends ModalRegistry = ModalRegistry>() => UseModalsResult<R>;
12
+ //# sourceMappingURL=useModals.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useModals.d.ts","sourceRoot":"","sources":["../../../src/components/DSModal/useModals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC/E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAGtD,MAAM,MAAM,eAAe,CAAC,CAAC,SAAS,aAAa,IAAI;IACnD,SAAS,EAAE,CAAC,CAAC,SAAS,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,CAAC,EAAE,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,gBAAgB,KAAK,MAAM,CAAC;IACpH,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAC;IAC3B,MAAM,EAAE,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,CAAC,SAAS,aAAa,GAAG,aAAa,OAAK,eAAe,CAAC,CAAC,CActF,CAAC"}
@@ -0,0 +1,6 @@
1
+ export type DSPageLoaderProps = {
2
+ label?: string;
3
+ className?: string;
4
+ };
5
+ export declare const DSPageLoader: ({ label, className }: DSPageLoaderProps) => import("react").JSX.Element;
6
+ //# sourceMappingURL=DSPageLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSPageLoader.d.ts","sourceRoot":"","sources":["../../../src/components/DSPageLoader/DSPageLoader.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,iBAAiB,GAAG;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,sBAAiD,iBAAiB,gCAS9F,CAAC"}
@@ -0,0 +1,13 @@
1
+ export type DSRadioButtonProps = {
2
+ checked: boolean;
3
+ onChange?: (checked: boolean, event: React.ChangeEvent<HTMLInputElement>) => void;
4
+ label?: string;
5
+ disabled?: boolean;
6
+ readOnly?: boolean;
7
+ className?: string;
8
+ name?: string;
9
+ id?: string;
10
+ value?: string;
11
+ };
12
+ export declare const DSRadioButton: ({ checked, onChange, label, disabled, readOnly, className, name, id, value, }: DSRadioButtonProps) => import("react").JSX.Element;
13
+ //# sourceMappingURL=DSRadioButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSRadioButton.d.ts","sourceRoot":"","sources":["../../../src/components/DSRadioButton/DSRadioButton.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAC;IAClF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,+EAU3B,kBAAkB,gCA+BpB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { CSSProperties } from 'react';
2
+ export type DSSkeletonVariant = 'text' | 'rectangular' | 'circular';
3
+ export type DSSkeletonProps = {
4
+ variant?: DSSkeletonVariant;
5
+ width?: CSSProperties['width'];
6
+ height?: CSSProperties['height'];
7
+ lines?: number;
8
+ animated?: boolean;
9
+ className?: string;
10
+ };
11
+ export declare const DSSkeleton: ({ variant, width, height, lines, animated, className, }: DSSkeletonProps) => import("react").JSX.Element;
12
+ //# sourceMappingURL=DSSkeleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSSkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/DSSkeleton/DSSkeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAG3C,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,aAAa,GAAG,UAAU,CAAC;AAEpE,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,KAAK,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,yDAOxB,eAAe,gCAgBjB,CAAC"}
@@ -0,0 +1,23 @@
1
+ export type DSSortDirection = 'asc' | 'desc';
2
+ export type DSSortOption = {
3
+ id: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ ascLabel?: string;
7
+ descLabel?: string;
8
+ };
9
+ export type DSSortValue = {
10
+ id: string;
11
+ direction: DSSortDirection;
12
+ };
13
+ export type DSSortProps = {
14
+ options: DSSortOption[];
15
+ value: DSSortValue | null;
16
+ onChange?: (value: DSSortValue) => void;
17
+ label?: string;
18
+ placeholder?: string;
19
+ disabled?: boolean;
20
+ className?: string;
21
+ };
22
+ export declare const DSSort: ({ options, value, onChange, label, placeholder, disabled, className, }: DSSortProps) => import("react").JSX.Element;
23
+ //# sourceMappingURL=DSSort.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSSort.d.ts","sourceRoot":"","sources":["../../../src/components/DSSort/DSSort.tsx"],"names":[],"mappings":"AAEA,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,MAAM,CAAC;AAE7C,MAAM,MAAM,YAAY,GAAG;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,eAAe,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,WAAW,GAAG;IACtB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,EAAE,WAAW,GAAG,IAAI,CAAC;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC;IACxC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAIF,eAAO,MAAM,MAAM,GAAI,wEAQpB,WAAW,gCA+Bb,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { DropDownOption } from '../DSDropDown/DSDropDown';
2
+ export type DSTimePeriodType = 'day' | 'week' | 'month';
3
+ export type DSTimePeriodTypeCode = 1 | 2 | 3;
4
+ export type DSTimePeriodPickerValue = {
5
+ periodType: DSTimePeriodTypeCode;
6
+ startDate: Date | null;
7
+ endDate: Date | null;
8
+ };
9
+ export type DSTimePeriodPickerProps = {
10
+ value: DSTimePeriodPickerValue;
11
+ onChange?: (value: DSTimePeriodPickerValue) => void;
12
+ label?: string;
13
+ hint?: string;
14
+ error?: string;
15
+ disabled?: boolean;
16
+ min?: Date;
17
+ max?: Date;
18
+ className?: string;
19
+ periodTypeOptions?: DropDownOption[];
20
+ };
21
+ export declare const DS_PERIOD_TYPE_CODES: Record<DSTimePeriodType, DSTimePeriodTypeCode>;
22
+ export declare const DSTimePeriodPicker: ({ value, onChange, label, hint, error, disabled, min, max, className, periodTypeOptions, }: DSTimePeriodPickerProps) => import("react").JSX.Element;
23
+ //# sourceMappingURL=DSTimePeriodPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSTimePeriodPicker.d.ts","sourceRoot":"","sources":["../../../src/components/DSTimePeriodPicker/DSTimePeriodPicker.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAI3E,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;AACxD,MAAM,MAAM,oBAAoB,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE7C,MAAM,MAAM,uBAAuB,GAAG;IAClC,UAAU,EAAE,oBAAoB,CAAC;IACjC,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;IACvB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG;IAClC,KAAK,EAAE,uBAAuB,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,uBAAuB,KAAK,IAAI,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,GAAG,CAAC,EAAE,IAAI,CAAC;IACX,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,cAAc,EAAE,CAAC;CACxC,CAAC;AAQF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,gBAAgB,EAAE,oBAAoB,CAI/E,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,4FAWhC,uBAAuB,gCAkCzB,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { ToastItem } from './toast.types';
2
+ export type DSToastProps = {
3
+ toast: ToastItem;
4
+ onClose: (id: string) => void;
5
+ };
6
+ export declare const DSToast: ({ toast, onClose }: DSToastProps) => import("react").JSX.Element;
7
+ //# sourceMappingURL=DSToast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSToast.d.ts","sourceRoot":"","sources":["../../../src/components/DSToast/DSToast.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,MAAM,YAAY,GAAG;IACvB,KAAK,EAAE,SAAS,CAAC;IACjB,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,eAAO,MAAM,OAAO,GAAI,oBAAoB,YAAY,gCAwDvD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type DSToastProviderProps = {
2
+ position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
3
+ };
4
+ export declare const DSToastProvider: ({ position }: DSToastProviderProps) => import("react").JSX.Element;
5
+ //# sourceMappingURL=DSToastProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSToastProvider.d.ts","sourceRoot":"","sources":["../../../src/components/DSToast/DSToastProvider.tsx"],"names":[],"mappings":"AAIA,MAAM,MAAM,oBAAoB,GAAG;IAC/B,QAAQ,CAAC,EAAE,WAAW,GAAG,UAAU,GAAG,cAAc,GAAG,aAAa,CAAC;CACxE,CAAC;AAEF,eAAO,MAAM,eAAe,GAAI,cAA4B,oBAAoB,gCAe/E,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { ShowToastPayload, ToastItem } from './toast.types';
2
+ export type ToastStoreState = {
3
+ toasts: ToastItem[];
4
+ showToast: (payload: ShowToastPayload) => string;
5
+ removeToast: (id: string) => void;
6
+ clearToasts: () => void;
7
+ };
8
+ export declare const useToastStore: import('zustand').UseBoundStore<import('zustand').StoreApi<ToastStoreState>>;
9
+ export declare const resetToastStore: () => void;
10
+ //# sourceMappingURL=toast.store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.store.d.ts","sourceRoot":"","sources":["../../../src/components/DSToast/toast.store.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAEjE,MAAM,MAAM,eAAe,GAAG;IAC1B,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,MAAM,CAAC;IACjD,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAIF,eAAO,MAAM,aAAa,8EAkBvB,CAAC;AAEJ,eAAO,MAAM,eAAe,YAA+C,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { ReactNode } from 'react';
2
+ export type ToastVariant = 'info' | 'success' | 'warning' | 'error';
3
+ export type ToastAction = {
4
+ label: ReactNode;
5
+ onClick: () => void;
6
+ dismissOnClick?: boolean;
7
+ };
8
+ export type ToastItem = {
9
+ id: string;
10
+ title?: ReactNode;
11
+ message: ReactNode;
12
+ variant: ToastVariant;
13
+ duration: number;
14
+ closable: boolean;
15
+ action?: ToastAction;
16
+ };
17
+ export type ShowToastPayload = Partial<Omit<ToastItem, 'id' | 'message'>> & Pick<ToastItem, 'message'>;
18
+ //# sourceMappingURL=toast.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toast.types.d.ts","sourceRoot":"","sources":["../../../src/components/DSToast/toast.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;AACpE,MAAM,MAAM,WAAW,GAAG;IAAE,KAAK,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAAC,cAAc,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAC9F,MAAM,MAAM,SAAS,GAAG;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,OAAO,EAAE,SAAS,CAAC;IACnB,OAAO,EAAE,YAAY,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,WAAW,CAAC;CACxB,CAAC;AACF,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,GAAG,SAAS,CAAC,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { ShowToastPayload } from './toast.types';
2
+ export type UseToastResult = {
3
+ showToast: (payload: ShowToastPayload) => string;
4
+ infoToast: (payload: Omit<ShowToastPayload, 'variant'>) => string;
5
+ successToast: (payload: Omit<ShowToastPayload, 'variant'>) => string;
6
+ warningToast: (payload: Omit<ShowToastPayload, 'variant'>) => string;
7
+ errorToast: (payload: Omit<ShowToastPayload, 'variant'>) => string;
8
+ removeToast: (id: string) => void;
9
+ clearToasts: () => void;
10
+ };
11
+ export declare const useToast: () => UseToastResult;
12
+ //# sourceMappingURL=useToast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToast.d.ts","sourceRoot":"","sources":["../../../src/components/DSToast/useToast.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAgB,MAAM,eAAe,CAAC;AAEpE,MAAM,MAAM,cAAc,GAAG;IACzB,SAAS,EAAE,CAAC,OAAO,EAAE,gBAAgB,KAAK,MAAM,CAAC;IACjD,SAAS,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAK,MAAM,CAAC;IAClE,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAK,MAAM,CAAC;IACrE,YAAY,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAK,MAAM,CAAC;IACrE,UAAU,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,KAAK,MAAM,CAAC;IACnE,WAAW,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,WAAW,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,cAc3B,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { ReactElement, ReactNode } from 'react';
2
+ export type DSTooltipPlacement = 'top' | 'right' | 'bottom' | 'left';
3
+ export type DSTooltipProps = {
4
+ content: ReactNode;
5
+ children: ReactElement<Record<string, unknown>>;
6
+ placement?: DSTooltipPlacement;
7
+ delay?: number;
8
+ disabled?: boolean;
9
+ maxWidth?: number | string;
10
+ className?: string;
11
+ };
12
+ export declare const DSTooltip: ({ content, children, placement, delay, disabled, maxWidth, className, }: DSTooltipProps) => import("react").JSX.Element;
13
+ //# sourceMappingURL=DSTooltip.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSTooltip.d.ts","sourceRoot":"","sources":["../../../src/components/DSTooltip/DSTooltip.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAoE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5H,MAAM,MAAM,kBAAkB,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;AAErE,MAAM,MAAM,cAAc,GAAG;IACzB,OAAO,EAAE,SAAS,CAAC;IACnB,QAAQ,EAAE,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,SAAS,GAAI,yEAQvB,cAAc,gCAqDhB,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { CSSProperties, VideoHTMLAttributes } from 'react';
2
+ export type DSVideoSource = {
3
+ src: string;
4
+ type?: string;
5
+ };
6
+ export type DSVideoTrack = {
7
+ src: string;
8
+ kind: 'captions' | 'subtitles' | 'descriptions' | 'chapters' | 'metadata';
9
+ srcLang: string;
10
+ label: string;
11
+ default?: boolean;
12
+ };
13
+ export type DSVideoPlayerFrameProps = Omit<VideoHTMLAttributes<HTMLVideoElement>, 'src' | 'children'> & {
14
+ sources: DSVideoSource[];
15
+ tracks?: DSVideoTrack[];
16
+ title: string;
17
+ aspectRatio?: CSSProperties['aspectRatio'];
18
+ objectFit?: CSSProperties['objectFit'];
19
+ loading?: boolean;
20
+ error?: string;
21
+ fallback?: React.ReactNode;
22
+ className?: string;
23
+ };
24
+ export declare const DSVideoPlayerFrame: ({ sources, tracks, title, aspectRatio, objectFit, loading, error, fallback, className, controls, playsInline, ...videoProps }: DSVideoPlayerFrameProps) => import("react").JSX.Element;
25
+ //# sourceMappingURL=DSVideoPlayerFrame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSVideoPlayerFrame.d.ts","sourceRoot":"","sources":["../../../src/components/DSVideoPlayerFrame/DSVideoPlayerFrame.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAY,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,OAAO,CAAC;AAI/E,MAAM,MAAM,aAAa,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,UAAU,GAAG,WAAW,GAAG,cAAc,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1E,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,mBAAmB,CAAC,gBAAgB,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC,GAAG;IACpG,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,YAAY,EAAE,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,CAAC;IAC3C,SAAS,CAAC,EAAE,aAAa,CAAC,WAAW,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAAI,+HAahC,uBAAuB,gCAkCzB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { LabelHTMLAttributes, ReactNode } from 'react';
2
+ export type DSFieldLabelProps = LabelHTMLAttributes<HTMLLabelElement> & {
3
+ children: ReactNode;
4
+ required?: boolean;
5
+ optionalText?: ReactNode;
6
+ disabled?: boolean;
7
+ };
8
+ export declare const DSFieldLabel: ({ children, required, optionalText, disabled, className, ...props }: DSFieldLabelProps) => import("react").JSX.Element;
9
+ export type DSFieldMessageVariant = 'hint' | 'error' | 'success';
10
+ export type DSFieldMessageProps = {
11
+ children: ReactNode;
12
+ variant?: DSFieldMessageVariant;
13
+ id?: string;
14
+ live?: boolean;
15
+ className?: string;
16
+ };
17
+ export declare const DSFieldMessage: ({ children, variant, id, live, className, }: DSFieldMessageProps) => import("react").JSX.Element;
18
+ //# sourceMappingURL=DSField.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DSField.d.ts","sourceRoot":"","sources":["../../../src/components/Field/DSField.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAG5D,MAAM,MAAM,iBAAiB,GAAG,mBAAmB,CAAC,gBAAgB,CAAC,GAAG;IACpE,QAAQ,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,YAAY,GAAI,qEAO1B,iBAAiB,gCAanB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAAG;IAC9B,QAAQ,EAAE,SAAS,CAAC;IACpB,OAAO,CAAC,EAAE,qBAAqB,CAAC;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,6CAM5B,mBAAmB,gCASrB,CAAC"}
package/dist/index.cjs ADDED
@@ -0,0 +1 @@
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("react/jsx-runtime"),t=require("react"),n=require("@tanstack/react-table"),r=require("react-dom"),i=require("zustand");var a={badge:`_badge_l4qbw_1`,sm:`_sm_l4qbw_2`,md:`_md_l4qbw_3`,neutral:`_neutral_l4qbw_4`,info:`_info_l4qbw_5`,success:`_success_l4qbw_6`,warning:`_warning_l4qbw_7`,error:`_error_l4qbw_8`,dot:`_dot_l4qbw_9`,icon:`_icon_l4qbw_10`,label:`_label_l4qbw_11`},o=({children:t,variant:n=`neutral`,size:r=`md`,dot:i=!1,icon:o,className:s=``})=>(0,e.jsxs)(`span`,{className:`${a.badge} ${a[n]} ${a[r]} ${s}`,children:[i&&(0,e.jsx)(`span`,{className:a.dot,"aria-hidden":`true`}),o&&(0,e.jsx)(`span`,{className:a.icon,"aria-hidden":`true`,children:o}),(0,e.jsx)(`span`,{className:a.label,children:t})]}),s={loader:`_loader_pslm9_1`,"ds-spin":`_ds-spin_pslm9_1`,primary:`_primary_pslm9_11`,secondary:`_secondary_pslm9_12`,light:`_light_pslm9_13`,danger:`_danger_pslm9_14`},c=({variant:t=`primary`,label:n=`Загрузка`,className:r=``,decorative:i=!1})=>(0,e.jsx)(`span`,{className:`${s.loader} ${s[t]} ${r}`,role:i?void 0:`status`,"aria-label":i?void 0:n,"aria-hidden":i||void 0}),l={button:`_button_3nz3z_1`,sm:`_sm_3nz3z_16`,md:`_md_3nz3z_17`,lg:`_lg_3nz3z_18`,primary:`_primary_3nz3z_19`,secondary:`_secondary_3nz3z_20`,outline:`_outline_3nz3z_21`,ghost:`_ghost_3nz3z_22`,empty:`_empty_3nz3z_22`,destructive:`_destructive_3nz3z_23`,destructiveOutline:`_destructiveOutline_3nz3z_24`},u=(0,t.forwardRef)(({children:t,variant:n=`primary`,size:r=`md`,isLoading:i=!1,loadingLabel:a=`Загрузка`,disabled:o,type:s=`button`,className:u=``,...d},f)=>(0,e.jsx)(`button`,{ref:f,type:s,className:`${l.button} ${l[n]} ${l[r]} ${u}`,disabled:o||i,"aria-busy":i||void 0,...d,children:i?(0,e.jsx)(c,{variant:`light`,label:a}):t}));u.displayName=`DSButton`;var d={label:`_label_5v0ym_1`,required:`_required_5v0ym_12`,error:`_error_5v0ym_13`,optional:`_optional_5v0ym_17`,hint:`_hint_5v0ym_18`,disabled:`_disabled_5v0ym_24`,message:`_message_5v0ym_28`,success:`_success_5v0ym_36`},f=({children:t,required:n=!1,optionalText:r,disabled:i=!1,className:a=``,...o})=>(0,e.jsxs)(`label`,{className:`${d.label} ${i?d.disabled:``} ${a}`,...o,children:[(0,e.jsx)(`span`,{children:t}),n&&(0,e.jsx)(`span`,{className:d.required,"aria-hidden":`true`,children:`*`}),r&&(0,e.jsx)(`span`,{className:d.optional,children:r})]}),p=({children:t,variant:n=`hint`,id:r,live:i=!1,className:a=``})=>(0,e.jsx)(`span`,{id:r,className:`${d.message} ${d[n]} ${a}`,role:i&&n===`error`?`alert`:void 0,"aria-live":i&&n!==`error`?`polite`:void 0,children:t}),m={wrapper:`_wrapper_1l5cg_1`,label:`_label_1l5cg_2`,input:`_input_1l5cg_3`,control:`_control_1l5cg_4`,disabled:`_disabled_1l5cg_7`,controlError:`_controlError_1l5cg_9`},h=({checked:n,onChange:r,label:i,hint:a,error:o,disabled:s=!1,readOnly:c=!1,className:l=``,name:u,id:d,indeterminate:f=!1,...h})=>{let g=(0,t.useId)(),_=d??`ds-checkbox-${u??g}`,v=(0,t.useRef)(null),y=a?`${_}-hint`:void 0,b=o?`${_}-error`:void 0;return(0,t.useEffect)(()=>{v.current&&(v.current.indeterminate=f&&!n)},[n,f]),(0,e.jsxs)(`div`,{className:`${m.wrapper} ${l}`,children:[(0,e.jsxs)(`label`,{className:`${m.label} ${s?m.disabled:``}`,htmlFor:_,children:[(0,e.jsx)(`input`,{ref:v,id:_,name:u,type:`checkbox`,checked:n,disabled:s,"aria-readonly":c||void 0,"aria-invalid":!!o,"aria-describedby":[y,b].filter(Boolean).join(` `)||void 0,className:m.input,onChange:e=>{c||r?.(e.target.checked,e)},...h}),(0,e.jsx)(`span`,{className:`${m.control} ${o?m.controlError:``}`,"aria-hidden":`true`,children:f&&!n?`−`:n?`✓`:``}),i&&(0,e.jsx)(`span`,{children:i})]}),a&&!o&&(0,e.jsx)(p,{id:y,children:a}),o&&(0,e.jsx)(p,{id:b,variant:`error`,children:o})]})},g={wrapper:`_wrapper_1kr9x_1`,input:`_input_1kr9x_2`,error:`_error_1kr9x_5`},_=e=>String(e).padStart(2,`0`),v=(e,t)=>{if(!e)return``;let n=`${e.getFullYear()}-${_(e.getMonth()+1)}-${_(e.getDate())}`,r=`${_(e.getHours())}:${_(e.getMinutes())}`;return t===`date`?n:t===`time`?r:`${n}T${r}`},y=(e,t)=>{if(!e)return null;if(t===`time`){let[t,n]=e.split(`:`).map(Number),r=new Date;return r.setHours(t??0,n??0,0,0),r}let n=new Date(t===`date`?`${e}T00:00`:e);return Number.isNaN(n.getTime())?null:n},b=({value:n,onChange:r,mode:i=`date`,label:a,hint:o,error:s,disabled:c=!1,readOnly:l=!1,required:u=!1,min:d,max:m,id:h,name:_,className:b=``})=>{let x=(0,t.useId)(),S=h??`ds-date-time-${_??x}`,C=o?`${S}-hint`:void 0,w=s?`${S}-error`:void 0,T=i===`datetime`?`datetime-local`:i;return(0,e.jsxs)(`div`,{className:`${g.wrapper} ${b}`,children:[a&&(0,e.jsx)(f,{htmlFor:S,required:u,disabled:c,children:a}),(0,e.jsx)(`input`,{id:S,name:_,type:T,value:v(n,i),min:v(d??null,i)||void 0,max:v(m??null,i)||void 0,disabled:c,readOnly:l,required:u,"aria-invalid":!!s,"aria-describedby":[C,w].filter(Boolean).join(` `)||void 0,className:`${g.input} ${s?g.error:``}`,onChange:e=>r?.(y(e.target.value,i)),onKeyDown:e=>{e.key===`Escape`&&e.currentTarget.blur()}}),o&&!s&&(0,e.jsx)(p,{id:C,children:o}),s&&(0,e.jsx)(p,{id:w,variant:`error`,children:s})]})},x={root:`_root_9h2e2_1`,legend:`_legend_9h2e2_2`,range:`_range_9h2e2_3`},S=e=>!!(e.from&&e.to&&e.from.getTime()<=e.to.getTime()),C=({value:t,onChange:n,onDraftChange:r,mode:i=`date`,fromLabel:a=`От`,toLabel:o=`До`,hint:s,error:c,min:l,max:u,disabled:d=!1,readOnly:f=!1,required:m=!1,className:h=``})=>{let g=c??(t.from&&t.to&&t.from>t.to?`Дата «От» не может быть позже даты «До»`:void 0),_=e=>{r?.(e),S(e)&&n?.(e)};return(0,e.jsxs)(`fieldset`,{className:`${x.root} ${h}`,disabled:d,children:[(0,e.jsxs)(`div`,{className:x.range,children:[(0,e.jsx)(b,{value:t.from,mode:i===`datetime`?`datetime`:i,label:a,min:l,max:t.to??u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,from:e})}),(0,e.jsx)(b,{value:t.to,mode:i===`datetime`?`datetime`:i,label:o,min:t.from??l,max:u,disabled:d,readOnly:f,required:m,error:g,onChange:e=>_({...t,to:e})})]}),s&&!g&&(0,e.jsx)(p,{children:s})]})},w={group:`_group_1st6r_1`,skeleton:`_skeleton_1st6r_2`,text:`_text_1st6r_3`,rectangular:`_rectangular_1st6r_4`,circular:`_circular_1st6r_5`,animated:`_animated_1st6r_6`,"ds-skeleton":`_ds-skeleton_1st6r_1`},T=({variant:t=`text`,width:n=`100%`,height:r,lines:i=1,animated:a=!0,className:o=``})=>(0,e.jsx)(`span`,{className:`${w.group} ${o}`,"aria-hidden":`true`,children:Array.from({length:Math.max(1,i)},(o,s)=>(0,e.jsx)(`span`,{className:`${w.skeleton} ${w[t]} ${a?w.animated:``}`,style:{width:s===i-1&&i>1?`70%`:n,height:r}},s))}),E={wrapper:`_wrapper_dkn63_1`,label:`_label_dkn63_17`,container:`_container_dkn63_29`,trigger:`_trigger_dkn63_37`,disabledText:`_disabledText_dkn63_39`,value:`_value_dkn63_109`,placeholder:`_placeholder_dkn63_111`,chevron:`_chevron_dkn63_137`,chevronOpen:`_chevronOpen_dkn63_163`,menu:`_menu_dkn63_171`,option:`_option_dkn63_207`,selected:`_selected_dkn63_245`,message:`_message_dkn63_265`,error:`_error_dkn63_267`,errorState:`_errorState_dkn63_293`},D=(e,t,n)=>{for(let r=0;r<e.length;r+=1){let i=(t+r*n+e.length)%e.length;if(!e[i]?.disabled)return i}return-1},O=({options:n,value:r,onChange:i,placeholder:a=`Выберите опцию`,disabled:o=!1,stringWhileDisabled:s=!1,label:c,error:l,hint:u,className:d=``,name:f,id:p,needMark:m=!0,maxMenuHeight:h})=>{let g=(0,t.useId)(),_=p??`ds-dropdown-${f??g}`,[v,y]=(0,t.useState)(!1),b=(0,t.useRef)(null),x=(0,t.useRef)(null),S=(0,t.useRef)([]),C=(0,t.useMemo)(()=>n.find(e=>e.value===r),[n,r]),w=u?`${_}-hint`:void 0,T=l?`${_}-error`:void 0,O=[w,T].filter(Boolean).join(` `)||void 0,k=o&&s;(0,t.useEffect)(()=>{let e=e=>{b.current?.contains(e.target)||y(!1)},t=e=>{e.key===`Escape`&&v&&(y(!1),x.current?.focus())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[v]);let A=(e,t)=>{let r=D(n,e,t);S.current[r]?.focus(),S.current[r]?.scrollIntoView({block:`nearest`})},j=e=>{e.disabled||(i?.(e.value,e),y(!1),x.current?.focus())};return(0,e.jsxs)(`div`,{ref:b,className:[E.wrapper,l?E.errorState:``,d].filter(Boolean).join(` `),children:[c&&(0,e.jsx)(`label`,{htmlFor:k?void 0:_,className:E.label,children:c}),(0,e.jsx)(`div`,{className:E.container,children:k?(0,e.jsx)(`div`,{id:_,className:E.disabledText,"aria-describedby":O,children:C?.label??a}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(`button`,{ref:x,id:_,type:`button`,name:f,className:E.trigger,disabled:o,"aria-haspopup":`listbox`,"aria-expanded":v,"aria-controls":`${_}-listbox`,"aria-describedby":O,"aria-invalid":!!l,onClick:()=>y(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),y(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>A(e.key===`ArrowDown`?0:n.length-1,t))}},children:[(0,e.jsx)(`span`,{className:C?E.value:E.placeholder,children:C?.label??a}),(0,e.jsx)(`span`,{className:`${E.chevron} ${v?E.chevronOpen:``}`,"aria-hidden":`true`,children:(0,e.jsx)(`svg`,{viewBox:`0 0 20 20`,fill:`none`,children:(0,e.jsx)(`path`,{d:`M5 7.5L10 12.5L15 7.5`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`})})})]}),v&&(0,e.jsx)(`ul`,{id:`${_}-listbox`,className:E.menu,role:`listbox`,"aria-label":c,style:{maxHeight:h},children:n.map((t,i)=>{let a=t.value===r;return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{S.current[i]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:`${E.option} ${a?E.selected:``}`,onClick:()=>j(t),onKeyDown:e=>{if((e.key===`ArrowDown`||e.key===`ArrowUp`)&&(e.preventDefault(),A(i+(e.key===`ArrowDown`?1:-1),e.key===`ArrowDown`?1:-1)),e.key===`Tab`&&y(!1),e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;A(e.key===`Home`?0:n.length-1,t)}},children:[(0,e.jsx)(`span`,{children:t.label}),a&&m&&(0,e.jsx)(`span`,{"aria-hidden":`true`,children:`✓`})]})},t.value)})})]})}),u&&!l&&(0,e.jsx)(`span`,{id:w,className:E.message,children:u}),l&&(0,e.jsx)(`span`,{id:T,className:E.error,children:l})]})},k=e=>`${e.id}:${e.direction}`,A=({options:t,value:n,onChange:r,label:i=`Сортировка`,placeholder:a=`Выберите сортировку`,disabled:o=!1,className:s})=>{let c=t.flatMap(e=>[{value:k({id:e.id,direction:`asc`}),label:e.ascLabel??`${e.label} · по возрастанию`,disabled:e.disabled},{value:k({id:e.id,direction:`desc`}),label:e.descLabel??`${e.label} · по убыванию`,disabled:e.disabled}]);return(0,e.jsx)(O,{options:c,value:n?k(n):``,label:i,placeholder:a,disabled:o,className:s,onChange:e=>{let t=e.lastIndexOf(`:`);r?.({id:e.slice(0,t),direction:e.slice(t+1)})}})},j={root:`_root_i4d62_1`,tableWrap:`_tableWrap_i4d62_2`,table:`_table_i4d62_2`,sticky:`_sticky_i4d62_8`,sortButton:`_sortButton_i4d62_9`,state:`_state_i4d62_11`,cards:`_cards_i4d62_12`,mobileSort:`_mobileSort_i4d62_12`,card:`_card_i4d62_12`,spanTwo:`_spanTwo_i4d62_19`,default:`_default_i4d62_21`,tableOnMobile:`_tableOnMobile_i4d62_21`,wide:`_wide_i4d62_23`},ee=(0,n.tableFeatures)({rowSortingFeature:n.rowSortingFeature,sortedRowModel:(0,n.createSortedRowModel)()}),M=(e,t)=>{let n=new Set;for(let t of e){if(!t.id.trim())return`Идентификатор колонки не может быть пустым`;if(n.has(t.id))return`Идентификатор колонки «${t.id}» повторяется`;n.add(t.id)}for(let n=0;n<t.length;n+=1)for(let r of e)if(typeof r.accessor==`string`&&!(r.accessor in t[n]))return`В строке ${n+1} отсутствует колонка «${r.id}»`;return null},N=({columns:r,data:i,tableOnMobile:a=!1,breakpoint:o=`default`,sorting:s,onSortingChange:c,renderMobileCard:l,getRowId:u,caption:d,ariaLabel:f,loading:p=!1,error:m,emptyState:h=`Нет данных`,stickyHeader:g=!1,maxHeight:_,className:v=``})=>{let[y,b]=(0,t.useState)([]),x=s??y,S=(0,t.useMemo)(()=>M(r,i),[r,i]),C=(0,t.useMemo)(()=>(0,n.createColumnHelper)(),[]),w=(0,t.useMemo)(()=>C.columns(r.map(e=>{let t=e.accessor;return C.accessor(typeof t==`function`?t:e=>e[t],{id:e.id,header:()=>e.header,cell:t=>e.cell?.(t.row.original,t.getValue())??String(t.getValue()??``),enableSorting:!0,sortDescFirst:e.sortDescFirst})})),[r,C]),E=(0,n.useTable)({features:ee,columns:w,data:i,state:{sorting:x},onSortingChange:e=>{let t=typeof e==`function`?e(x):e;s===void 0&&b(t),c?.(t)},getRowId:u}),D=E.getRowModel().rows,O=r.map(e=>({id:e.id,label:typeof e.header==`string`?e.header:e.id})),k=[j.root,o===`wide`?j.wide:j.default,a?j.tableOnMobile:``,v].filter(Boolean).join(` `),N=S??m;return(0,e.jsxs)(`section`,{className:k,"aria-busy":p,children:[!a&&!p&&!N&&D.length>0&&(0,e.jsx)(A,{className:j.mobileSort,options:O,value:x[0]?{id:x[0].id,direction:x[0].desc?`desc`:`asc`}:null,onChange:e=>E.setSorting([{id:e.id,desc:e.direction===`desc`}])}),(0,e.jsx)(`div`,{className:j.tableWrap,style:{maxHeight:_},children:(0,e.jsxs)(`table`,{className:j.table,"aria-label":f,children:[d&&(0,e.jsx)(`caption`,{children:d}),(0,e.jsx)(`thead`,{className:g?j.sticky:``,children:E.getHeaderGroups().map(t=>(0,e.jsx)(`tr`,{children:t.headers.map(t=>{let n=t.column.getIsSorted();return(0,e.jsx)(`th`,{scope:`col`,"aria-sort":n===`asc`?`ascending`:n===`desc`?`descending`:`none`,children:(0,e.jsxs)(`button`,{type:`button`,className:j.sortButton,onClick:t.column.getToggleSortingHandler(),children:[(0,e.jsx)(E.FlexRender,{header:t}),(0,e.jsx)(`span`,{"aria-hidden":`true`,children:n===`asc`?`↑`:n===`desc`?`↓`:`↕`})]})},t.id)})},t.id))}),(0,e.jsx)(`tbody`,{children:p?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{colSpan:r.length,children:(0,e.jsx)(T,{lines:3})})}):N?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:j.state,colSpan:r.length,children:N})}):D.length===0?(0,e.jsx)(`tr`,{children:(0,e.jsx)(`td`,{className:j.state,colSpan:r.length,children:h})}):D.map(t=>(0,e.jsx)(`tr`,{children:t.getAllCells().map(t=>(0,e.jsx)(`td`,{children:(0,e.jsx)(E.FlexRender,{cell:t})},t.id))},t.id))})]})}),!a&&(0,e.jsx)(`div`,{className:j.cards,role:`list`,"aria-label":f??d,children:p?(0,e.jsx)(T,{lines:4}):N?(0,e.jsx)(`div`,{className:j.state,children:N}):D.length===0?(0,e.jsx)(`div`,{className:j.state,children:h}):D.map(t=>{if(l)return(0,e.jsx)(`div`,{role:`listitem`,children:l({row:t.original,columns:r})},t.id);let n=r.filter(e=>!e.mobile?.hideOnMobile).sort((e,t)=>(e.mobile?.mobileOrder??0)-(t.mobile?.mobileOrder??0)),i=n.find(e=>e.mobile?.primary)??n.find(e=>e.mobile?.mobileVariant!==`actions`),a=e=>typeof e.accessor==`function`?e.accessor(t.original):t.original[e.accessor],o=e=>e.mobile?.renderMobile?.(t.original,a(e))??e.cell?.(t.original,a(e))??String(a(e)??``);return(0,e.jsxs)(`article`,{role:`listitem`,className:j.card,children:[(0,e.jsx)(`h3`,{children:i?o(i):`Строка ${t.index+1}`}),(0,e.jsx)(`dl`,{children:n.filter(e=>e!==i&&e.mobile?.mobileVariant!==`actions`).map(t=>(0,e.jsxs)(`div`,{className:t.mobile?.mobileSpan===2?j.spanTwo:``,children:[(0,e.jsx)(`dt`,{children:t.mobile?.mobileLabel??t.header}),(0,e.jsx)(`dd`,{children:o(t)})]},t.id))}),n.filter(e=>e.mobile?.mobileVariant===`actions`).map(t=>(0,e.jsx)(`footer`,{children:o(t)},t.id))]},t.id)})})]})},P=({options:n,value:r,onChange:i,placeholder:a=`Выберите опции`,disabled:o=!1,label:s,error:c,hint:l,className:u=``,name:d,id:f,closeOnSelect:p=!1,maxMenuHeight:m})=>{let h=(0,t.useId)(),g=f??`ds-dropdown-multiple-${d??h}`,[_,v]=(0,t.useState)(!1),y=(0,t.useRef)(null),b=(0,t.useRef)(null),x=(0,t.useRef)([]),S=(0,t.useMemo)(()=>n.filter(e=>r.includes(e.value)),[n,r]),C=S.map(e=>e.label).join(`, `),w=l?`${g}-hint`:void 0,T=c?`${g}-error`:void 0;(0,t.useEffect)(()=>{let e=e=>{y.current?.contains(e.target)||v(!1)},t=e=>{e.key===`Escape`&&_&&(v(!1),b.current?.focus())};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[_]);let O=e=>{if(e.disabled)return;let t=r.includes(e.value)?r.filter(t=>t!==e.value):[...r,e.value];i?.(t,n.filter(e=>t.includes(e.value))),p&&(v(!1),b.current?.focus())},k=(e,t)=>{let r=D(n,e,t);x.current[r]?.focus(),x.current[r]?.scrollIntoView({block:`nearest`})};return(0,e.jsxs)(`div`,{ref:y,className:[E.wrapper,c?E.errorState:``,u].filter(Boolean).join(` `),children:[s&&(0,e.jsx)(`label`,{htmlFor:g,className:E.label,children:s}),(0,e.jsxs)(`div`,{className:E.container,children:[(0,e.jsxs)(`button`,{ref:b,id:g,type:`button`,name:d,className:E.trigger,disabled:o,"aria-haspopup":`listbox`,"aria-expanded":_,"aria-controls":`${g}-listbox`,"aria-describedby":[w,T].filter(Boolean).join(` `)||void 0,"aria-invalid":!!c,onClick:()=>v(e=>!e),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault(),v(!0);let t=e.key===`ArrowDown`?1:-1;requestAnimationFrame(()=>k(e.key===`ArrowDown`?0:n.length-1,t))}},children:[(0,e.jsx)(`span`,{className:S.length?E.value:E.placeholder,children:C||a}),(0,e.jsx)(`span`,{className:`${E.chevron} ${_?E.chevronOpen:``}`,"aria-hidden":`true`,children:`⌄`})]}),_&&(0,e.jsx)(`ul`,{id:`${g}-listbox`,className:E.menu,role:`listbox`,"aria-label":s,"aria-multiselectable":`true`,style:{maxHeight:m},children:n.map((t,i)=>{let a=r.includes(t.value);return(0,e.jsx)(`li`,{role:`presentation`,children:(0,e.jsxs)(`button`,{ref:e=>{x.current[i]=e},type:`button`,role:`option`,"aria-selected":a,disabled:t.disabled,className:`${E.option} ${a?E.selected:``}`,onClick:()=>O(t),onKeyDown:e=>{if(e.key===`ArrowDown`||e.key===`ArrowUp`){e.preventDefault();let t=e.key===`ArrowDown`?1:-1;k(i+t,t)}if(e.key===`Home`||e.key===`End`){e.preventDefault();let t=e.key===`Home`?1:-1;k(e.key===`Home`?0:n.length-1,t)}e.key===`Tab`&&v(!1)},children:[(0,e.jsx)(`span`,{children:t.label}),(0,e.jsx)(`span`,{"aria-hidden":`true`,children:a?`✓`:``})]})},t.value)})})]}),l&&!c&&(0,e.jsx)(`span`,{id:w,className:E.message,children:l}),c&&(0,e.jsx)(`span`,{id:T,className:E.error,children:c})]})},te={approve:`M4 12l5 5L20 6`,reject:`M5 5l14 14M19 5L5 19`,edit:`M4 20h4L19 9l-4-4L4 16v4z`,cross:`M5 5l14 14M19 5L5 19`,chevron:`M6 9l6 6 6-6`,basket:`M4 7h16l-1 13H5L4 7zm3 0V4h10v3`,info:`M12 10v7m0-10v.01`,warning:`M12 4L3 20h18L12 4zm0 5v5m0 3v.01`},ne=({name:t,title:n,width:r=24,height:i=24,...a})=>(0,e.jsxs)(`svg`,{viewBox:`0 0 24 24`,width:r,height:i,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`,strokeLinejoin:`round`,role:n?`img`:void 0,"aria-hidden":!n||void 0,focusable:`false`,...a,children:[n&&(0,e.jsx)(`title`,{children:n}),(0,e.jsx)(`path`,{d:te[t]})]}),F={root:`_root_1897l_1`,header:`_header_1897l_11`,title:`_title_1897l_21`,dismiss:`_dismiss_1897l_28`,content:`_content_1897l_57`},re=({title:n,children:r,dismissible:i=!1,onDismiss:a,dismissLabel:o=`Закрыть информационный блок`,headingAs:s=`h3`,className:c=``})=>{let l=`ds-info-block-${(0,t.useId)()}`;return(0,e.jsxs)(`section`,{className:`${F.root} ${c}`,"aria-labelledby":l,children:[(0,e.jsxs)(`header`,{className:F.header,children:[(0,e.jsx)(s,{id:l,className:F.title,children:n}),i&&(0,e.jsx)(`button`,{type:`button`,className:F.dismiss,onClick:a,"aria-label":o,children:(0,e.jsx)(`svg`,{viewBox:`0 0 20 20`,"aria-hidden":`true`,children:(0,e.jsx)(`path`,{d:`M5 5L15 15M15 5L5 15`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.8`,strokeLinecap:`round`})})})]}),(0,e.jsx)(`div`,{className:F.content,children:r})]})},I={wrapper:`_wrapper_1bpdz_1`,control:`_control_1bpdz_3`,input:`_input_1bpdz_5`,disabledText:`_disabledText_1bpdz_5`,inputError:`_inputError_1bpdz_11`,clear:`_clear_1bpdz_13`},L=({value:n,onChange:r,type:i=`text`,placeholder:a=``,disabled:o=!1,readOnly:s=!1,stringWhileDisabled:c=!1,label:l,error:u,hint:d,className:m=``,name:h,id:g,clearable:_=!0,required:v=!1,...y})=>{let b=(0,t.useId)(),x=g??`ds-input-${h??b}`,S=(0,t.useRef)(null),C=d?`${x}-hint`:void 0,w=u?`${x}-error`:void 0,T=String(n??``),E=[C,w].filter(Boolean).join(` `)||void 0;return(0,e.jsxs)(`div`,{className:`${I.wrapper} ${m}`,children:[l&&(0,e.jsx)(f,{htmlFor:x,required:v,disabled:o,children:l}),o&&c?(0,e.jsx)(`div`,{id:x,className:I.disabledText,"aria-describedby":E,children:T||a}):(0,e.jsxs)(`div`,{className:I.control,children:[(0,e.jsx)(`input`,{ref:S,id:x,name:h,type:i,value:T,placeholder:a,disabled:o,readOnly:s,required:v,"aria-invalid":!!u,"aria-describedby":E,className:`${I.input} ${u?I.inputError:``}`,onChange:e=>{i===`number`&&e.target.value!==``?r?.(Number(e.target.value),e):r?.(e.target.value,e)},...y}),_&&T&&!o&&!s&&(0,e.jsx)(`button`,{type:`button`,className:I.clear,"aria-label":`Очистить поле`,onClick:()=>{let e=S.current;e&&((Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,`value`)?.set)?.call(e,``),e.dispatchEvent(new Event(`input`,{bubbles:!0})),e.focus())},children:`×`})]}),d&&!u&&(0,e.jsx)(p,{id:C,children:d}),u&&(0,e.jsx)(p,{id:w,variant:`error`,children:u})]})},R={wrapper:`_wrapper_8srjz_1`,input:`_input_8srjz_11`,switch:`_switch_8srjz_18`,thumb:`_thumb_8srjz_34`,label:`_label_8srjz_56`,disabled:`_disabled_8srjz_62`},z=({checked:n,onChange:r,label:i,disabled:a=!1,readOnly:o=!1,className:s=``,name:c,id:l,value:u})=>{let d=(0,t.useId)(),f=l??`ds-radio-button-${c??d}`;return(0,e.jsxs)(`label`,{htmlFor:f,className:`${R.wrapper} ${a?R.disabled:``} ${s}`,children:[(0,e.jsx)(`input`,{id:f,className:R.input,type:`checkbox`,role:`switch`,name:c,value:u,checked:n,disabled:a,"aria-readonly":o||void 0,onChange:e=>{o||r?.(e.target.checked,e)}}),(0,e.jsx)(`span`,{className:R.switch,"aria-hidden":`true`,children:(0,e.jsx)(`span`,{className:R.thumb})}),i&&(0,e.jsx)(`span`,{className:R.label,children:i})]})},B={root:`_root_kepgo_1`,grid:`_grid_kepgo_3`,actions:`_actions_kepgo_5`},ie=({filters:t,values:n,onChange:r,onApply:i,onReset:a,applyMode:o=`instant`,loading:s=!1,disabled:c=!1,className:l=``})=>{let d=(e,t)=>{let a={...n,[e]:t};r?.(a,e),o===`instant`&&i?.(a)};return(0,e.jsxs)(`section`,{className:`${B.root} ${l}`,"aria-label":`Фильтры`,"aria-busy":s,children:[(0,e.jsx)(`div`,{className:B.grid,children:t.filter(e=>!e.hidden).map(t=>{let r=c||s||t.disabled,i=n[t.id];if(t.type===`input`)return(0,e.jsx)(L,{label:t.label,hint:t.hint,placeholder:t.placeholder,type:t.inputType,value:i??``,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`dropdown`)return(0,e.jsx)(O,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:String(i??``),disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`multiple`)return(0,e.jsx)(P,{label:t.label,hint:t.hint,placeholder:t.placeholder,options:t.options,value:Array.isArray(i)?i:[],disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`checkbox`)return(0,e.jsx)(h,{label:t.label,hint:t.hint,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);if(t.type===`radio`)return(0,e.jsx)(z,{label:t.label,checked:!!i,disabled:r,onChange:e=>d(t.id,e)},t.id);let a=i&&typeof i==`object`&&!Array.isArray(i)?i:{from:null,to:null};return(0,e.jsx)(C,{hint:t.hint,mode:t.mode,min:t.min,max:t.max,value:a,disabled:r,onDraftChange:e=>d(t.id,e)},t.id)})}),(a||o===`manual`)&&(0,e.jsxs)(`div`,{className:B.actions,children:[a&&(0,e.jsx)(u,{variant:`destructiveOutline`,disabled:c||s,onClick:a,children:`Сбросить`}),o===`manual`&&(0,e.jsx)(u,{isLoading:s,disabled:c,onClick:()=>i?.(n),children:`Применить`})]})]})},ae=0,V=(0,i.create)(e=>({modals:[],openModal:(t,n={},r={})=>{ae+=1;let i=`ds-modal-${ae}`;return e(e=>({modals:[...e.modals,{id:i,name:t,payload:n,closeOnEscape:r.closeOnEscape??!0,closeOnBackdrop:r.closeOnBackdrop??!0}]})),i},closeModal:t=>e(e=>({modals:e.modals.filter(e=>e.id!==t)})),closeTopModal:()=>e(e=>({modals:e.modals.slice(0,-1)})),closeAllModals:()=>e({modals:[]})})),oe=()=>V.setState({modals:[]}),H={layer:`_layer_bl99k_1`,backdrop:`_backdrop_bl99k_2`,panel:`_panel_bl99k_3`,header:`_header_bl99k_5`,title:`_title_bl99k_6`,description:`_description_bl99k_7`,content:`_content_bl99k_8`},U=`button:not(:disabled), [href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])`,W=({children:n,title:r,description:i,modalId:a,closeLabel:o=`Закрыть модальное окно`,className:s=``,role:c=`dialog`})=>{let l=(0,t.useId)(),d=(0,t.useId)(),f=(0,t.useRef)(null),p=V(e=>e.closeModal);return(0,t.useEffect)(()=>{let e=document.activeElement,t=f.current;return(t?.querySelector(U)??t)?.focus(),()=>e?.focus()},[]),(0,e.jsxs)(`div`,{ref:f,className:`${H.panel} ${s}`,role:c,"aria-modal":`true`,"aria-labelledby":r?l:void 0,"aria-describedby":i?d:void 0,tabIndex:-1,onKeyDown:e=>{if(e.key!==`Tab`)return;let t=Array.from(f.current?.querySelectorAll(U)??[]);if(!t.length){e.preventDefault();return}let n=t[0],r=t[t.length-1];e.shiftKey&&document.activeElement===n?(e.preventDefault(),r?.focus()):!e.shiftKey&&document.activeElement===r&&(e.preventDefault(),n?.focus())},children:[(r||o)&&(0,e.jsxs)(`header`,{className:H.header,children:[r&&(0,e.jsx)(`h2`,{id:l,className:H.title,children:r}),(0,e.jsx)(u,{variant:`ghost`,size:`sm`,"aria-label":o,onClick:()=>p(a),children:`×`})]}),i&&(0,e.jsx)(`p`,{id:d,className:H.description,children:i}),(0,e.jsx)(`div`,{className:H.content,children:n})]})},G=({registry:n})=>{let i=V(e=>e.modals),a=V(e=>e.closeModal),o=V(e=>e.closeAllModals);return(0,t.useEffect)(()=>{let e=e=>{if(e.key!==`Escape`)return;let t=V.getState().modals.at(-1);t?.closeOnEscape&&a(t.id)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[a]),!i.length||typeof document>`u`?null:(0,r.createPortal)((0,e.jsx)(`div`,{className:H.layer,"aria-label":`Модальные окна`,children:i.map((t,r)=>{let s=n[t.name];return s?(0,e.jsx)(`div`,{className:H.backdrop,"aria-hidden":r!==i.length-1||void 0,onMouseDown:e=>{e.target===e.currentTarget&&t.closeOnBackdrop&&a(t.id)},children:(0,e.jsx)(s,{...t.payload,modalId:t.id,close:()=>a(t.id),closeAll:o})},t.id):null})}),document.body)},se=({registry:n,children:r,lockBodyScroll:i=!0})=>{let a=V(e=>e.modals.length);return(0,t.useEffect)(()=>{if(!i||a===0)return;let e=document.body.style.overflow;return document.body.style.overflow=`hidden`,()=>{document.body.style.overflow=e}},[i,a]),(0,e.jsxs)(e.Fragment,{children:[r,(0,e.jsx)(G,{registry:n})]})},K=e=>e,q={message:`_message_187g8_1`,actions:`_actions_187g8_2`},J=new Map,ce=0,le=({modalId:t,close:n,title:r=`Подтверждение`,message:i=`Продолжить действие?`,confirmLabel:a=`Подтвердить`,cancelLabel:o=`Отмена`,tone:s=`default`,requestId:c})=>{let l=e=>{J.get(c)?.(e),J.delete(c),n()};return(0,e.jsxs)(W,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:q.message,children:i}),(0,e.jsxs)(`div`,{className:q.actions,children:[(0,e.jsx)(u,{variant:`outline`,onClick:()=>l(!1),children:o}),(0,e.jsx)(u,{variant:s===`danger`?`destructive`:`primary`,onClick:()=>l(!0),children:a})]})]})},ue=({modalId:t,close:n,title:r=`Ошибка`,message:i,closeLabel:a=`Закрыть`})=>(0,e.jsxs)(W,{modalId:t,title:r,role:`alertdialog`,children:[(0,e.jsx)(`p`,{className:q.message,children:i}),(0,e.jsx)(`div`,{className:q.actions,children:(0,e.jsx)(u,{onClick:n,children:a})})]}),de=K({ConfirmModal:le,ErrorModal:ue}),fe=()=>{let e=V(e=>e.openModal);return(t={})=>new Promise(n=>{ce+=1;let r=`confirm-${ce}`;J.set(r,n),e(`ConfirmModal`,{...t,requestId:r},{closeOnEscape:!1})})},pe=e=>e instanceof Error?e.message:typeof e==`string`?e:e&&typeof e==`object`&&`message`in e&&typeof e.message==`string`?e.message:`Произошла неизвестная ошибка`,me=()=>{let e=V(e=>e.openModal);return{showError:(t,n)=>e(`ErrorModal`,{title:n,message:pe(t)})}},he=(0,i.create)(()=>({})),ge=(0,i.create)(()=>({})),_e=()=>{let e=V(e=>e.modals),t=V(e=>e.openModal);return{openModal:(e,n={},r)=>t(e,n,r),closeModal:V(e=>e.closeModal),closeTopModal:V(e=>e.closeTopModal),closeAllModals:V(e=>e.closeAllModals),isOpen:t=>e.some(e=>e.name===t),count:e.length}},ve={root:`_root_1j70j_1`},ye=({label:t=`Загрузка страницы`,className:n=``})=>(0,e.jsxs)(`div`,{className:`${ve.root} ${n}`,role:`status`,"aria-label":t,children:[(0,e.jsx)(c,{decorative:!0}),(0,e.jsx)(`span`,{children:t})]}),Y={root:`_root_ig8lp_1`,legend:`_legend_ig8lp_2`,range:`_range_ig8lp_3`},be=[{value:`1`,label:`День`},{value:`2`,label:`Неделя`},{value:`3`,label:`Месяц`}],xe={day:1,week:2,month:3},Se=({value:t,onChange:n,label:r,hint:i,error:a,disabled:o=!1,min:s,max:c,className:l=``,periodTypeOptions:u=be})=>(0,e.jsxs)(`fieldset`,{className:`${Y.root} ${l}`,disabled:o,children:[r&&(0,e.jsx)(`legend`,{className:Y.legend,children:r}),(0,e.jsx)(O,{options:u,value:String(t.periodType),disabled:o,onChange:e=>n?.({...t,periodType:Number(e)}),label:`Тип периода`}),(0,e.jsxs)(`div`,{className:Y.range,children:[(0,e.jsx)(b,{value:t.startDate,onChange:e=>n?.({...t,startDate:e}),label:`Начало`,min:s,max:c,disabled:o}),(0,e.jsx)(b,{value:t.endDate,onChange:e=>n?.({...t,endDate:e}),label:`Окончание`,min:t.startDate??s,max:c,disabled:o})]}),i&&!a&&(0,e.jsx)(p,{children:i}),a&&(0,e.jsx)(p,{variant:`error`,children:a})]}),X={viewport:`_viewport_v7rog_1`,"top-right":`_top-right_v7rog_2`,"top-left":`_top-left_v7rog_3`,"bottom-right":`_bottom-right_v7rog_4`,"bottom-left":`_bottom-left_v7rog_5`,toast:`_toast_v7rog_6`,body:`_body_v7rog_7`,icon:`_icon_v7rog_8`,info:`_info_v7rog_9`,success:`_success_v7rog_10`,warning:`_warning_v7rog_11`,error:`_error_v7rog_12`},Ce=({toast:n,onClose:r})=>{let[i,a]=(0,t.useState)(!1),o=(0,t.useRef)(n.duration),s=(0,t.useRef)(Date.now());return(0,t.useEffect)(()=>{if(i||n.duration<=0)return;s.current=Date.now();let e=setTimeout(()=>r(n.id),o.current);return()=>{clearTimeout(e),o.current=Math.max(0,o.current-(Date.now()-s.current))}},[r,i,n.duration,n.id]),(0,e.jsxs)(`article`,{className:`${X.toast} ${X[n.variant]}`,role:n.variant===`error`?`alert`:`status`,"aria-live":n.variant===`error`?`assertive`:`polite`,onMouseEnter:()=>a(!0),onMouseLeave:()=>a(!1),onFocus:()=>a(!0),onBlur:()=>a(!1),children:[(0,e.jsx)(ne,{name:n.variant===`warning`?`warning`:`info`,className:X.icon}),(0,e.jsxs)(`div`,{className:X.body,children:[n.title&&(0,e.jsx)(`strong`,{children:n.title}),(0,e.jsx)(`div`,{children:n.message}),n.action&&(0,e.jsx)(u,{variant:`ghost`,size:`sm`,onClick:()=>{n.action?.onClick(),(n.action?.dismissOnClick??!0)&&r(n.id)},children:n.action.label})]}),n.closable&&(0,e.jsx)(u,{variant:`ghost`,size:`sm`,"aria-label":`Закрыть уведомление`,onClick:()=>r(n.id),children:`×`})]})},we=0,Z=(0,i.create)(e=>({toasts:[],showToast:t=>{we+=1;let n=`ds-toast-${we}`;return e(e=>({toasts:[...e.toasts,{variant:`info`,duration:5e3,closable:!0,...t,id:n}]})),n},removeToast:t=>e(e=>({toasts:e.toasts.filter(e=>e.id!==t)})),clearToasts:()=>e({toasts:[]})})),Te=()=>Z.setState({toasts:[]}),Ee=({position:t=`top-right`})=>{let n=Z(e=>e.toasts),r=Z(e=>e.removeToast);return(0,e.jsx)(`div`,{className:`${X.viewport} ${X[t]}`,"aria-label":`Уведомления`,children:n.map(t=>(0,e.jsx)(Ce,{toast:t,onClose:r},t.id))})},De=()=>{let e=Z(e=>e.showToast),t=Z(e=>e.removeToast),n=Z(e=>e.clearToasts),r=t=>n=>e({...n,variant:t});return{showToast:e,infoToast:r(`info`),successToast:r(`success`),warningToast:r(`warning`),errorToast:r(`error`),removeToast:t,clearToasts:n}},Q={root:`_root_2bxal_1`,tooltip:`_tooltip_2bxal_2`,"ds-tooltip-in":`_ds-tooltip-in_2bxal_1`,top:`_top_2bxal_3`,bottom:`_bottom_2bxal_4`,left:`_left_2bxal_5`,right:`_right_2bxal_6`},Oe=({content:n,children:r,placement:i=`top`,delay:a=450,disabled:o=!1,maxWidth:s=280,className:c=``})=>{let l=(0,t.useId)(),[u,d]=(0,t.useState)(!1),f=(0,t.useRef)(null),p=()=>{o||!n||(f.current=setTimeout(()=>d(!0),a))},m=()=>{f.current&&clearTimeout(f.current),d(!1)};if((0,t.useEffect)(()=>{let e=e=>{e.key===`Escape`&&m()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e),f.current&&clearTimeout(f.current)}},[]),!(0,t.isValidElement)(r))return r;let h=(0,t.cloneElement)(r,{"aria-describedby":u?l:void 0,onMouseEnter:p,onMouseLeave:m,onFocus:p,onBlur:m});return(0,e.jsxs)(`span`,{className:`${Q.root} ${c}`,onPointerDown:u?m:p,children:[h,u&&(0,e.jsx)(`span`,{id:l,role:`tooltip`,className:`${Q.tooltip} ${Q[i]}`,style:{maxWidth:s},children:n})]})},$={root:`_root_tgni1_1`,frame:`_frame_tgni1_2`,video:`_video_tgni1_3`,overlay:`_overlay_tgni1_4`,error:`_error_tgni1_4`,caption:`_caption_tgni1_7`},ke=({sources:n,tracks:r=[],title:i,aspectRatio:a=`16 / 9`,objectFit:o=`contain`,loading:s=!1,error:l,fallback:u,className:d=``,controls:f=!0,playsInline:p=!0,...m})=>{let[h,g]=(0,t.useState)(!1),_=l??(h?`Не удалось воспроизвести видео`:void 0);return(0,e.jsxs)(`figure`,{className:`${$.root} ${d}`,children:[(0,e.jsxs)(`div`,{className:$.frame,style:{aspectRatio:a},children:[!_&&n.length>0&&(0,e.jsxs)(`video`,{...m,"aria-label":i,controls:f,playsInline:p,className:$.video,style:{objectFit:o},onError:e=>{g(!0),m.onError?.(e)},children:[n.map(t=>(0,e.jsx)(`source`,{...t},`${t.src}-${t.type}`)),r.map(t=>(0,e.jsx)(`track`,{...t},`${t.src}-${t.srcLang}`))]}),s&&(0,e.jsx)(`div`,{className:$.overlay,children:(0,e.jsx)(c,{label:`Загрузка видео`})}),(_||n.length===0)&&(0,e.jsx)(`div`,{className:$.error,role:`alert`,children:u??_??`Источник видео не указан`})]}),(0,e.jsx)(`figcaption`,{className:$.caption,children:i})]})};exports.ConfirmModal=le,exports.DSBadge=o,exports.DSButton=u,exports.DSCheckbox=h,exports.DSDataTable=N,exports.DSDateRange=C,exports.DSDateTimePicker=b,exports.DSDropDown=O,exports.DSDropDownMultiple=P,exports.DSFieldLabel=f,exports.DSFieldMessage=p,exports.DSFilters=ie,exports.DSIcon=ne,exports.DSInfoBlock=re,exports.DSInput=L,exports.DSLoader=c,exports.DSModal=G,exports.DSModalFrame=W,exports.DSPageLoader=ye,exports.DSRadioButton=z,exports.DSSkeleton=T,exports.DSSort=A,exports.DSTimePeriodPicker=Se,exports.DSToast=Ce,exports.DSToastProvider=Ee,exports.DSTooltip=Oe,exports.DSVideoPlayerFrame=ke,exports.DS_PERIOD_TYPE_CODES=xe,exports.ErrorModal=ue,exports.ModalSystemProvider=se,exports.builtInModalRegistry=de,exports.defineModalRegistry=K,exports.formatDateTimeLocalValue=v,exports.getErrorMessage=pe,exports.getNextEnabledOptionIndex=D,exports.isValidDateRange=S,exports.parseDateTimeLocalValue=y,exports.resetModalStore=oe,exports.resetToastStore=Te,exports.useConfirmModal=fe,exports.useConfirmModalStore=he,exports.useErrorModal=me,exports.useErrorModalStore=ge,exports.useModals=_e,exports.useModalsStore=V,exports.useToast=De,exports.useToastStore=Z,exports.validateDSDataTableData=M;
@@ -0,0 +1,33 @@
1
+ export * from './components/DSBadge/DSBadge';
2
+ export * from './components/DSButton/DSButton';
3
+ export * from './components/DSCheckbox/DSCheckbox';
4
+ export * from './components/DSDateTimePicker/DSDateTimePicker';
5
+ export * from './components/DSDateRange/DSDateRange';
6
+ export * from './components/DSDataTable/DSDataTable';
7
+ export * from './components/DSDropDown/DSDropDown';
8
+ export * from './components/DSDropDownMultiple/DSDropDownMultiple';
9
+ export * from './components/DSIcon/DSIcon';
10
+ export * from './components/DSInfoBlock/DSInfoBlock';
11
+ export * from './components/DSFilters/DSFilters';
12
+ export * from './components/DSInput/DSInput';
13
+ export * from './components/DSLoader/DSLoader';
14
+ export * from './components/DSModal/DSModal';
15
+ export * from './components/DSModal/ModalSystemProvider';
16
+ export * from './components/DSModal/builtins';
17
+ export * from './components/DSModal/modal.store';
18
+ export * from './components/DSModal/modal.types';
19
+ export * from './components/DSModal/useModals';
20
+ export * from './components/DSPageLoader/DSPageLoader';
21
+ export * from './components/DSRadioButton/DSRadioButton';
22
+ export * from './components/DSSkeleton/DSSkeleton';
23
+ export * from './components/DSSort/DSSort';
24
+ export * from './components/DSTimePeriodPicker/DSTimePeriodPicker';
25
+ export * from './components/DSToast/DSToast';
26
+ export * from './components/DSToast/DSToastProvider';
27
+ export * from './components/DSToast/toast.store';
28
+ export * from './components/DSToast/toast.types';
29
+ export * from './components/DSToast/useToast';
30
+ export * from './components/DSTooltip/DSTooltip';
31
+ export * from './components/DSVideoPlayerFrame/DSVideoPlayerFrame';
32
+ export * from './components/Field/DSField';
33
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,sCAAsC,CAAC;AACrD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,oDAAoD,CAAC;AACnE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,0CAA0C,CAAC;AACzD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,0CAA0C,CAAC;AACzD,cAAc,oCAAoC,CAAC;AACnD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oDAAoD,CAAC;AACnE,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,kCAAkC,CAAC;AACjD,cAAc,oDAAoD,CAAC;AACnE,cAAc,4BAA4B,CAAC"}