@dinofront/design_system 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/dist/components/Accordion/Accordion.types.d.ts +4 -0
  2. package/dist/components/Badge/Badge.types.d.ts +11 -0
  3. package/dist/components/Breadcrumb/Breadcrumb.d.ts +2 -0
  4. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +19 -0
  5. package/dist/components/Breadcrumb/index.d.ts +2 -0
  6. package/dist/components/CardGroup/CardGroup.d.ts +2 -0
  7. package/dist/components/CardGroup/CardGroup.types.d.ts +19 -0
  8. package/dist/components/CardGroup/index.d.ts +2 -0
  9. package/dist/components/Copy/Copy.d.ts +2 -0
  10. package/dist/components/Copy/Copy.types.d.ts +17 -0
  11. package/dist/components/Copy/index.d.ts +2 -0
  12. package/dist/components/Counter/Counter.d.ts +2 -0
  13. package/dist/components/Counter/Counter.types.d.ts +20 -0
  14. package/dist/components/Counter/index.d.ts +2 -0
  15. package/dist/components/DistributionBar/DistributionBar.d.ts +2 -0
  16. package/dist/components/DistributionBar/DistributionBar.types.d.ts +20 -0
  17. package/dist/components/DistributionBar/index.d.ts +2 -0
  18. package/dist/components/Drawer/Drawer.types.d.ts +4 -0
  19. package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +22 -2
  20. package/dist/components/Empty/Empty.d.ts +2 -0
  21. package/dist/components/Empty/Empty.types.d.ts +12 -0
  22. package/dist/components/Empty/index.d.ts +2 -0
  23. package/dist/components/FormContainer/FormContainer.d.ts +2 -0
  24. package/dist/components/FormContainer/FormContainer.types.d.ts +18 -0
  25. package/dist/components/FormContainer/index.d.ts +2 -0
  26. package/dist/components/FormField/FormField.d.ts +2 -0
  27. package/dist/components/FormField/FormField.types.d.ts +22 -0
  28. package/dist/components/FormField/index.d.ts +2 -0
  29. package/dist/components/Input/Input.types.d.ts +2 -0
  30. package/dist/components/Link/Link.d.ts +2 -0
  31. package/dist/components/Link/Link.types.d.ts +15 -0
  32. package/dist/components/Link/index.d.ts +2 -0
  33. package/dist/components/MultiSelect/MultiSelect.types.d.ts +8 -0
  34. package/dist/components/Popover/Popover.d.ts +2 -0
  35. package/dist/components/Popover/Popover.types.d.ts +29 -0
  36. package/dist/components/Popover/index.d.ts +2 -0
  37. package/dist/components/ReadMore/ReadMore.d.ts +2 -0
  38. package/dist/components/ReadMore/ReadMore.types.d.ts +17 -0
  39. package/dist/components/ReadMore/index.d.ts +2 -0
  40. package/dist/components/Select/Select.types.d.ts +2 -0
  41. package/dist/components/StepIndicator/StepIndicator.d.ts +2 -0
  42. package/dist/components/StepIndicator/StepIndicator.types.d.ts +24 -0
  43. package/dist/components/StepIndicator/index.d.ts +2 -0
  44. package/dist/components/Tabs/Tabs.types.d.ts +16 -1
  45. package/dist/components/Text/Text.types.d.ts +2 -0
  46. package/dist/components/TextArea/TextArea.types.d.ts +2 -0
  47. package/dist/components/ThemeSwitch/ThemeSwitch.d.ts +2 -0
  48. package/dist/components/ThemeSwitch/ThemeSwitch.types.d.ts +7 -0
  49. package/dist/components/ThemeSwitch/index.d.ts +2 -0
  50. package/dist/components/UnderConstruction/UnderConstruction.d.ts +2 -0
  51. package/dist/components/UnderConstruction/UnderConstruction.types.d.ts +12 -0
  52. package/dist/components/UnderConstruction/index.d.ts +2 -0
  53. package/dist/components/Upload/Upload.types.d.ts +31 -2
  54. package/dist/components/Upload/index.d.ts +1 -1
  55. package/dist/hooks/index.d.ts +9 -0
  56. package/dist/hooks/useEscapeKey.d.ts +4 -0
  57. package/dist/hooks/useFormContext.d.ts +6 -0
  58. package/dist/hooks/useFormProps.d.ts +9 -0
  59. package/dist/hooks/useHideBodyScroll.d.ts +6 -0
  60. package/dist/hooks/useIsMobile.d.ts +9 -0
  61. package/dist/hooks/useOnOutsideClick.d.ts +6 -0
  62. package/dist/hooks/useStepper.d.ts +27 -0
  63. package/dist/icons/brands/AppleIcon.d.ts +1 -0
  64. package/dist/icons/brands/FacebookIcon.d.ts +1 -0
  65. package/dist/icons/brands/GoogleIcon.d.ts +1 -0
  66. package/dist/icons/brands/InstagramIcon.d.ts +1 -0
  67. package/dist/icons/brands/LinkedinIcon.d.ts +1 -0
  68. package/dist/icons/brands/MediumIcon.d.ts +1 -0
  69. package/dist/icons/brands/TelegramIcon.d.ts +1 -0
  70. package/dist/icons/brands/TwitterIcon.d.ts +1 -0
  71. package/dist/icons/brands/YoutubeIcon.d.ts +1 -0
  72. package/dist/icons/brands/index.d.ts +9 -0
  73. package/dist/icons/createIcon.d.ts +28 -0
  74. package/dist/icons/currency/AmdIcon.d.ts +1 -0
  75. package/dist/icons/currency/EurIcon.d.ts +1 -0
  76. package/dist/icons/currency/RubIcon.d.ts +1 -0
  77. package/dist/icons/currency/UsdIcon.d.ts +1 -0
  78. package/dist/icons/currency/index.d.ts +4 -0
  79. package/dist/icons/domain/BudgetTransferIcon.d.ts +1 -0
  80. package/dist/icons/domain/ContractCardIcon.d.ts +1 -0
  81. package/dist/icons/domain/HandOpenHeartIcon.d.ts +1 -0
  82. package/dist/icons/domain/OnlyEmployeeIcon.d.ts +1 -0
  83. package/dist/icons/domain/ProjectProductIcon.d.ts +1 -0
  84. package/dist/icons/domain/UnitsEmployeeIcon.d.ts +1 -0
  85. package/dist/icons/domain/VacationIcon.d.ts +1 -0
  86. package/dist/icons/domain/index.d.ts +7 -0
  87. package/dist/icons/flags/FlagAmIcon.d.ts +1 -0
  88. package/dist/icons/flags/FlagGbIcon.d.ts +1 -0
  89. package/dist/icons/flags/FlagRuIcon.d.ts +1 -0
  90. package/dist/icons/flags/FlagUsIcon.d.ts +1 -0
  91. package/dist/icons/flags/index.d.ts +4 -0
  92. package/dist/icons/index.d.ts +4 -0
  93. package/dist/icons.d.ts +2 -0
  94. package/dist/icons.js +342 -0
  95. package/dist/icons.js.map +1 -0
  96. package/dist/index.d.ts +15 -0
  97. package/dist/index.js +2283 -1158
  98. package/dist/index.js.map +1 -1
  99. package/dist/lib/FormContext.d.ts +22 -0
  100. package/dist/lib/mergeRefs.d.ts +4 -0
  101. package/dist/lib/motion.d.ts +11 -0
  102. package/dist/lib/useAnchoredPosition.d.ts +31 -0
  103. package/dist/lib/useFloatingPosition.d.ts +29 -0
  104. package/dist/lib/useMountTransition.d.ts +21 -0
  105. package/dist/styles.css +328 -0
  106. package/package.json +25 -4
@@ -1,15 +1,42 @@
1
1
  import { HTMLAttributes, ReactNode } from 'react';
2
2
  import { BaseProps } from '../../types';
3
- export interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'onDrop' | 'onDragOver' | 'onDragLeave' | 'onKeyDown' | 'role' | 'tabIndex' | 'aria-disabled'>, BaseProps {
3
+ export type UploadMode = 'dropzone' | 'button' | 'icon';
4
+ export type UploadRejectionReason = 'size' | 'type' | 'maxFiles' | 'duplicate';
5
+ export interface UploadRejection {
6
+ file: File;
7
+ reason: UploadRejectionReason;
8
+ }
9
+ export interface UploadProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onClick' | 'onDrop' | 'onDragEnter' | 'onDragOver' | 'onDragLeave' | 'onKeyDown' | 'role' | 'tabIndex' | 'aria-disabled'>, BaseProps {
4
10
  /** Forwarded to the hidden native `<input type="file">`, e.g. `"image/png,image/jpeg"`. */
5
11
  accept?: string;
6
12
  multiple?: boolean;
7
- /** Shown in the default hint text (e.g. "PNG, up to 10 MB"); purely informational, not enforced. */
13
+ /** Shown in the default hint text (e.g. "PNG, up to 10 MB"). Enforced only when `validateFiles` is set. */
8
14
  maxSizeMB?: number;
9
15
  /** Overrides the auto-generated hint derived from `accept`/`maxSizeMB`. */
10
16
  hint?: ReactNode;
17
+ /** Called with the files that passed validation (or every selected/dropped file, when `validateFiles` is `false`). */
11
18
  onFiles?: (files: File[]) => void;
12
19
  disabled?: boolean;
20
+ /** Enforces `accept`, `maxSizeMB`, `maxFiles`, and de-duplication against `currentFiles`, routing rejected files to `onReject` instead of `onFiles`. Defaults to `false` — existing consumers keep receiving every file the user picked. */
21
+ validateFiles?: boolean;
22
+ /** Max total files, counted against `currentFiles.length` plus the new selection. Only enforced when `validateFiles` is set. */
23
+ maxFiles?: number;
24
+ /** Drops files already present in `currentFiles` (matched by name + size). Defaults to `validateFiles`'s value. */
25
+ dedupe?: boolean;
26
+ /** Files the consumer is already holding — enables `maxFiles`/`dedupe` enforcement without `Upload` owning any file state itself. */
27
+ currentFiles?: File[];
28
+ /** Files that failed validation, with the reason. Only called when `validateFiles` is set. */
29
+ onReject?: (rejections: UploadRejection[]) => void;
30
+ /** `'dropzone'` (default) is the drag-and-drop area. `'button'` renders a secondary Button trigger. `'icon'` renders a compact icon-only trigger. */
31
+ mode?: UploadMode;
32
+ /** Label for the `'button'`-mode trigger. Ignored in other modes. */
33
+ triggerLabel?: ReactNode;
34
+ /** Overrides the default trigger icon (a paperclip for `'button'` mode, a pencil for `'icon'` mode). */
35
+ triggerIcon?: ReactNode;
36
+ label?: ReactNode;
37
+ required?: boolean;
38
+ /** Content rendered on the label row, right of the label text and required marker — e.g. an info tooltip trigger. */
39
+ labelAddons?: ReactNode;
13
40
  }
14
41
  export type UploadItemStatus = 'processing' | 'completed' | 'error';
15
42
  export interface UploadItemProps extends HTMLAttributes<HTMLDivElement>, BaseProps {
@@ -21,4 +48,6 @@ export interface UploadItemProps extends HTMLAttributes<HTMLDivElement>, BasePro
21
48
  errorText?: ReactNode;
22
49
  onRetry?: () => void;
23
50
  onRemove?: () => void;
51
+ /** Image thumbnail URL, rendered in place of the file-type icon. The consumer owns the URL's lifetime (e.g. call `URL.revokeObjectURL` on unmount). Falls back to the file icon on load failure. */
52
+ previewSrc?: string;
24
53
  }
@@ -1,2 +1,2 @@
1
1
  export { Upload, UploadItem } from './Upload';
2
- export type { UploadItemProps, UploadItemStatus, UploadProps } from './Upload.types';
2
+ export type { UploadItemProps, UploadItemStatus, UploadMode, UploadProps, UploadRejection, UploadRejectionReason, } from './Upload.types';
@@ -0,0 +1,9 @@
1
+ export { useStepper } from './useStepper';
2
+ export type { UseStepperOptions, UseStepperResult } from './useStepper';
3
+ export { useOnOutsideClick } from './useOnOutsideClick';
4
+ export { useEscapeKey } from './useEscapeKey';
5
+ export { useHideBodyScroll } from './useHideBodyScroll';
6
+ export { useIsMobile } from './useIsMobile';
7
+ export { useFormContext } from './useFormContext';
8
+ export { useFormProps } from './useFormProps';
9
+ export type { FormContextValue } from '../lib/FormContext';
@@ -0,0 +1,4 @@
1
+ /** Fires `onEscape` when the user presses `Escape`, anywhere in the
2
+ * document — not scoped to a container, matching how dismissible
3
+ * overlays (menus, drawers, popovers) listen for it today. */
4
+ export declare function useEscapeKey(onEscape: () => void, enabled?: boolean): void;
@@ -0,0 +1,6 @@
1
+ import { FormContextValue } from '../lib/FormContext';
2
+ /** Reads the ambient form state provided by the nearest `FormContainer`.
3
+ * Throws outside one, matching `FormField`'s existing null-check — the
4
+ * same failure whether a consumer uses `FormField` or this hook
5
+ * directly. */
6
+ export declare function useFormContext(): FormContextValue;
@@ -0,0 +1,9 @@
1
+ import { FormContextValue } from '../lib/FormContext';
2
+ /** Reads the ambient form state provided by the nearest `FormContainer` —
3
+ * the same context `useFormContext` reads — but never throws outside
4
+ * one. Returns an inert default context instead, so call sites migrated
5
+ * from an existing `useFormProps()` (e.g. an app's own hrm_ui_lib-shaped
6
+ * shim) keep working without adding a null check. Prefer
7
+ * `useFormContext` in new code, where a missing `FormContainer` is
8
+ * usually a programmer error you want to surface immediately. */
9
+ export declare function useFormProps(): FormContextValue;
@@ -0,0 +1,6 @@
1
+ /** Locks `document.body` scrolling while `active`, restoring whatever
2
+ * `overflow` value was set before the first lock once the last active
3
+ * caller deactivates. Reference-counted across concurrent callers (e.g.
4
+ * a drawer opened from within a modal) so one overlay closing early
5
+ * never clobbers another's lock. */
6
+ export declare function useHideBodyScroll(active: boolean): void;
@@ -0,0 +1,9 @@
1
+ /** True when the viewport is at or below `breakpoint` (default 768px).
2
+ * Returns `false` during SSR and during the very first client render —
3
+ * the effect computes and syncs the real value right after mount, so
4
+ * the server-rendered markup and the client's first render always
5
+ * agree (no hydration mismatch), at the cost of one extra render after
6
+ * mount when the viewport actually is narrow. Subscribes to the media
7
+ * query's `change` event rather than `window.resize`, so it only
8
+ * re-renders when the mobile/desktop boundary is actually crossed. */
9
+ export declare function useIsMobile(breakpoint?: number): boolean;
@@ -0,0 +1,6 @@
1
+ import { RefObject } from 'react';
2
+ /** Fires `handler` on any `mousedown`/`touchstart` outside `ref.current`.
3
+ * No effect while `ref.current` is null or `enabled` is false — callers
4
+ * don't need to guard call sites where the ref isn't attached yet (e.g.
5
+ * before a portal mounts). */
6
+ export declare function useOnOutsideClick(ref: RefObject<HTMLElement | null> | null | undefined, handler: (event: MouseEvent | TouchEvent) => void, enabled?: boolean): void;
@@ -0,0 +1,27 @@
1
+ export interface UseStepperOptions {
2
+ /** Total number of steps. */
3
+ count: number;
4
+ /** Uncontrolled initial step index. Default `0`. */
5
+ initialStep?: number;
6
+ /** Controlled step index. Pass alongside `onStepChange` to fully control the step. */
7
+ step?: number;
8
+ onStepChange?: (step: number) => void;
9
+ /** Wraps `next`/`prev` past the last/first step instead of clamping. Default `false`. */
10
+ loop?: boolean;
11
+ }
12
+ export interface UseStepperResult {
13
+ step: number;
14
+ count: number;
15
+ isFirst: boolean;
16
+ isLast: boolean;
17
+ next: () => void;
18
+ prev: () => void;
19
+ goTo: (step: number) => void;
20
+ reset: () => void;
21
+ }
22
+ /** Drives a multi-step flow's current index — the logic half of a wizard,
23
+ * with no rendering of its own; render `list[step]` (or similar) yourself.
24
+ * Supports both controlled (`step` + `onStepChange`) and uncontrolled
25
+ * (`initialStep`) usage, the same shape as a controlled/uncontrolled form
26
+ * input. */
27
+ export declare function useStepper({ count, initialStep, step: controlledStep, onStepChange, loop, }: UseStepperOptions): UseStepperResult;
@@ -0,0 +1 @@
1
+ export declare const AppleIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const FacebookIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const GoogleIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const InstagramIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const LinkedinIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const MediumIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const TelegramIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const TwitterIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const YoutubeIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1,9 @@
1
+ export { GoogleIcon } from './GoogleIcon';
2
+ export { AppleIcon } from './AppleIcon';
3
+ export { FacebookIcon } from './FacebookIcon';
4
+ export { InstagramIcon } from './InstagramIcon';
5
+ export { TelegramIcon } from './TelegramIcon';
6
+ export { TwitterIcon } from './TwitterIcon';
7
+ export { LinkedinIcon } from './LinkedinIcon';
8
+ export { MediumIcon } from './MediumIcon';
9
+ export { YoutubeIcon } from './YoutubeIcon';
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ import { LucideIcon } from 'lucide-react';
3
+ type IconRenderer = (uid: string) => ReactNode;
4
+ /** Builds a solid-fill glyph icon (currency, brand logos, HR-domain marks)
5
+ * typed as lucide's own `LucideIcon`, so it drops straight into any
6
+ * `icon: LucideIcon` prop (`IconTile`, `InfoField`, ...) with no widening
7
+ * of the existing type. `fill` is set on the root `<svg>` from `color`
8
+ * (default `currentColor`) and inherited by every child `<path>` that
9
+ * doesn't set its own `fill` — the same mechanism the source icon set
10
+ * relied on via a `path:not([fill]) { fill: currentColor }` CSS rule,
11
+ * reproduced here without needing any external CSS. `strokeWidth` is
12
+ * accepted (for prop-shape compatibility with `LucideIcon`) but has no
13
+ * effect — these are solid fills, not stroke-based glyphs.
14
+ *
15
+ * `content` is either static markup, or — for the handful of icons whose
16
+ * source used a `<clipPath>` — a function receiving a mask/clip id
17
+ * generated fresh per instance via `useId()`. The source hardcoded these
18
+ * ids (e.g. `clip0_697_1766`), which collide (`url(#...)` resolves to
19
+ * whichever instance rendered first) the moment the same icon renders
20
+ * twice on one page. */
21
+ export declare function createIcon(name: string, content: ReactNode | IconRenderer, viewBox?: string): LucideIcon;
22
+ /** Builds a fixed multi-color icon (flags) — same `LucideIcon` shape as
23
+ * `createIcon`, but `color`/`strokeWidth` have no effect: every shape
24
+ * already carries its own literal `fill`, since a flag's colors aren't
25
+ * theme-able. `renderShapes` receives a fresh-per-instance mask id, same
26
+ * rationale as `createIcon`'s clip id. */
27
+ export declare function createFlagIcon(name: string, renderShapes: IconRenderer, viewBox?: string): LucideIcon;
28
+ export {};
@@ -0,0 +1 @@
1
+ export declare const AmdIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const EurIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const RubIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const UsdIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1,4 @@
1
+ export { AmdIcon } from './AmdIcon';
2
+ export { EurIcon } from './EurIcon';
3
+ export { UsdIcon } from './UsdIcon';
4
+ export { RubIcon } from './RubIcon';
@@ -0,0 +1 @@
1
+ export declare const BudgetTransferIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const ContractCardIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const HandOpenHeartIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const OnlyEmployeeIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const ProjectProductIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const UnitsEmployeeIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const VacationIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1,7 @@
1
+ export { OnlyEmployeeIcon } from './OnlyEmployeeIcon';
2
+ export { UnitsEmployeeIcon } from './UnitsEmployeeIcon';
3
+ export { ProjectProductIcon } from './ProjectProductIcon';
4
+ export { BudgetTransferIcon } from './BudgetTransferIcon';
5
+ export { HandOpenHeartIcon } from './HandOpenHeartIcon';
6
+ export { VacationIcon } from './VacationIcon';
7
+ export { ContractCardIcon } from './ContractCardIcon';
@@ -0,0 +1 @@
1
+ export declare const FlagAmIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const FlagGbIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const FlagRuIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1 @@
1
+ export declare const FlagUsIcon: import('lucide-react').LucideIcon;
@@ -0,0 +1,4 @@
1
+ export { FlagAmIcon } from './FlagAmIcon';
2
+ export { FlagUsIcon } from './FlagUsIcon';
3
+ export { FlagGbIcon } from './FlagGbIcon';
4
+ export { FlagRuIcon } from './FlagRuIcon';
@@ -0,0 +1,4 @@
1
+ export * from './currency';
2
+ export * from './flags';
3
+ export * from './brands';
4
+ export * from './domain';
@@ -0,0 +1,2 @@
1
+ export * from './icons/index.js'
2
+ export {}