@dinofront/design_system 0.1.4 → 1.1.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 (114) hide show
  1. package/dist/FormField-CwRAOtTN.js +170 -0
  2. package/dist/FormField-CwRAOtTN.js.map +1 -0
  3. package/dist/components/Accordion/Accordion.types.d.ts +4 -0
  4. package/dist/components/Badge/Badge.types.d.ts +11 -0
  5. package/dist/components/Breadcrumb/Breadcrumb.d.ts +2 -0
  6. package/dist/components/Breadcrumb/Breadcrumb.types.d.ts +19 -0
  7. package/dist/components/Breadcrumb/index.d.ts +2 -0
  8. package/dist/components/CardGroup/CardGroup.d.ts +2 -0
  9. package/dist/components/CardGroup/CardGroup.types.d.ts +19 -0
  10. package/dist/components/CardGroup/index.d.ts +2 -0
  11. package/dist/components/Copy/Copy.d.ts +2 -0
  12. package/dist/components/Copy/Copy.types.d.ts +17 -0
  13. package/dist/components/Copy/index.d.ts +2 -0
  14. package/dist/components/Counter/Counter.d.ts +2 -0
  15. package/dist/components/Counter/Counter.types.d.ts +20 -0
  16. package/dist/components/Counter/index.d.ts +2 -0
  17. package/dist/components/DistributionBar/DistributionBar.d.ts +2 -0
  18. package/dist/components/DistributionBar/DistributionBar.types.d.ts +20 -0
  19. package/dist/components/DistributionBar/index.d.ts +2 -0
  20. package/dist/components/Divider/Divider.d.ts +2 -0
  21. package/dist/components/Divider/Divider.types.d.ts +10 -0
  22. package/dist/components/Divider/index.d.ts +2 -0
  23. package/dist/components/Drawer/Drawer.types.d.ts +4 -0
  24. package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +22 -2
  25. package/dist/components/Empty/Empty.d.ts +2 -0
  26. package/dist/components/Empty/Empty.types.d.ts +12 -0
  27. package/dist/components/Empty/index.d.ts +2 -0
  28. package/dist/components/FormContainer/FormContainer.d.ts +2 -0
  29. package/dist/components/FormContainer/FormContainer.types.d.ts +18 -0
  30. package/dist/components/FormContainer/index.d.ts +2 -0
  31. package/dist/components/FormField/FormField.d.ts +2 -0
  32. package/dist/components/FormField/FormField.types.d.ts +22 -0
  33. package/dist/components/FormField/index.d.ts +2 -0
  34. package/dist/components/Input/Input.types.d.ts +2 -0
  35. package/dist/components/Link/Link.d.ts +2 -0
  36. package/dist/components/Link/Link.types.d.ts +15 -0
  37. package/dist/components/Link/index.d.ts +2 -0
  38. package/dist/components/MultiSelect/MultiSelect.types.d.ts +8 -0
  39. package/dist/components/Popover/Popover.d.ts +2 -0
  40. package/dist/components/Popover/Popover.types.d.ts +29 -0
  41. package/dist/components/Popover/index.d.ts +2 -0
  42. package/dist/components/Progress/Progress.d.ts +2 -0
  43. package/dist/components/Progress/Progress.types.d.ts +18 -0
  44. package/dist/components/Progress/index.d.ts +2 -0
  45. package/dist/components/ReadMore/ReadMore.d.ts +2 -0
  46. package/dist/components/ReadMore/ReadMore.types.d.ts +17 -0
  47. package/dist/components/ReadMore/index.d.ts +2 -0
  48. package/dist/components/Select/Select.types.d.ts +2 -0
  49. package/dist/components/Skeleton/Skeleton.d.ts +2 -0
  50. package/dist/components/Skeleton/Skeleton.types.d.ts +22 -0
  51. package/dist/components/Skeleton/index.d.ts +2 -0
  52. package/dist/components/StepIndicator/StepIndicator.d.ts +2 -0
  53. package/dist/components/StepIndicator/StepIndicator.types.d.ts +24 -0
  54. package/dist/components/StepIndicator/index.d.ts +2 -0
  55. package/dist/components/Tabs/Tabs.types.d.ts +16 -1
  56. package/dist/components/Text/Text.types.d.ts +2 -0
  57. package/dist/components/TextArea/TextArea.types.d.ts +2 -0
  58. package/dist/components/ThemeSwitch/ThemeSwitch.d.ts +2 -0
  59. package/dist/components/ThemeSwitch/ThemeSwitch.types.d.ts +7 -0
  60. package/dist/components/ThemeSwitch/index.d.ts +2 -0
  61. package/dist/components/UnderConstruction/UnderConstruction.d.ts +2 -0
  62. package/dist/components/UnderConstruction/UnderConstruction.types.d.ts +12 -0
  63. package/dist/components/UnderConstruction/index.d.ts +2 -0
  64. package/dist/components/Upload/Upload.types.d.ts +31 -2
  65. package/dist/components/Upload/index.d.ts +1 -1
  66. package/dist/form/index.d.ts +2 -0
  67. package/dist/form.d.ts +2 -0
  68. package/dist/form.js +2 -0
  69. package/dist/hooks/index.d.ts +2 -0
  70. package/dist/hooks/useStepper.d.ts +27 -0
  71. package/dist/icons/brands/AppleIcon.d.ts +1 -0
  72. package/dist/icons/brands/FacebookIcon.d.ts +1 -0
  73. package/dist/icons/brands/GoogleIcon.d.ts +1 -0
  74. package/dist/icons/brands/InstagramIcon.d.ts +1 -0
  75. package/dist/icons/brands/LinkedinIcon.d.ts +1 -0
  76. package/dist/icons/brands/MediumIcon.d.ts +1 -0
  77. package/dist/icons/brands/TelegramIcon.d.ts +1 -0
  78. package/dist/icons/brands/TwitterIcon.d.ts +1 -0
  79. package/dist/icons/brands/YoutubeIcon.d.ts +1 -0
  80. package/dist/icons/brands/index.d.ts +9 -0
  81. package/dist/icons/createIcon.d.ts +28 -0
  82. package/dist/icons/currency/AmdIcon.d.ts +1 -0
  83. package/dist/icons/currency/EurIcon.d.ts +1 -0
  84. package/dist/icons/currency/RubIcon.d.ts +1 -0
  85. package/dist/icons/currency/UsdIcon.d.ts +1 -0
  86. package/dist/icons/currency/index.d.ts +4 -0
  87. package/dist/icons/domain/BudgetTransferIcon.d.ts +1 -0
  88. package/dist/icons/domain/ContractCardIcon.d.ts +1 -0
  89. package/dist/icons/domain/HandOpenHeartIcon.d.ts +1 -0
  90. package/dist/icons/domain/OnlyEmployeeIcon.d.ts +1 -0
  91. package/dist/icons/domain/ProjectProductIcon.d.ts +1 -0
  92. package/dist/icons/domain/UnitsEmployeeIcon.d.ts +1 -0
  93. package/dist/icons/domain/VacationIcon.d.ts +1 -0
  94. package/dist/icons/domain/index.d.ts +7 -0
  95. package/dist/icons/flags/FlagAmIcon.d.ts +1 -0
  96. package/dist/icons/flags/FlagGbIcon.d.ts +1 -0
  97. package/dist/icons/flags/FlagRuIcon.d.ts +1 -0
  98. package/dist/icons/flags/FlagUsIcon.d.ts +1 -0
  99. package/dist/icons/flags/index.d.ts +4 -0
  100. package/dist/icons/index.d.ts +4 -0
  101. package/dist/icons.d.ts +2 -0
  102. package/dist/icons.js +342 -0
  103. package/dist/icons.js.map +1 -0
  104. package/dist/index.d.ts +18 -0
  105. package/dist/index.js +2513 -1472
  106. package/dist/index.js.map +1 -1
  107. package/dist/lib/FormContext.d.ts +22 -0
  108. package/dist/lib/mergeRefs.d.ts +4 -0
  109. package/dist/lib/motion.d.ts +11 -0
  110. package/dist/lib/useAnchoredPosition.d.ts +31 -0
  111. package/dist/lib/useFloatingPosition.d.ts +29 -0
  112. package/dist/lib/useMountTransition.d.ts +21 -0
  113. package/dist/styles.css +548 -0
  114. package/package.json +30 -4
@@ -0,0 +1,22 @@
1
+ import { Control, FieldErrors, FieldValues, UseFormClearErrors, UseFormGetFieldState, UseFormGetValues, UseFormRegister, UseFormReset, UseFormSetError, UseFormSetValue, UseFormTrigger, UseFormUnregister, UseFormWatch } from 'react-hook-form';
2
+ export interface FormContextValue {
3
+ control: Control<FieldValues>;
4
+ register: UseFormRegister<FieldValues>;
5
+ errors: FieldErrors<FieldValues>;
6
+ setValue: UseFormSetValue<FieldValues>;
7
+ getValues: UseFormGetValues<FieldValues>;
8
+ watch: UseFormWatch<FieldValues>;
9
+ reset: UseFormReset<FieldValues>;
10
+ trigger: UseFormTrigger<FieldValues>;
11
+ clearErrors: UseFormClearErrors<FieldValues>;
12
+ setError: UseFormSetError<FieldValues>;
13
+ getFieldState: UseFormGetFieldState<FieldValues>;
14
+ unregister: UseFormUnregister<FieldValues>;
15
+ isDirty: boolean;
16
+ isSubmitted: boolean;
17
+ isSubmitting: boolean;
18
+ isValid: boolean;
19
+ dirtyFields: Partial<Readonly<Record<string, boolean>>>;
20
+ submit: () => void;
21
+ }
22
+ export declare const FormContext: import('react').Context<FormContextValue | null>;
@@ -0,0 +1,4 @@
1
+ import { Ref } from 'react';
2
+ /** Combines multiple refs (a forwarded consumer ref, an internal ref) into a
3
+ * single callback ref so they all point at the same DOM node. */
4
+ export declare function mergeRefs<T>(...refs: Array<Ref<T> | undefined>): (node: T | null) => void;
@@ -0,0 +1,11 @@
1
+ /** Durations in ms for JS-driven transition timing (mount/unmount
2
+ * orchestration). Kept in sync by hand with the Tailwind `duration-*`
3
+ * utilities used alongside them in component classes — same
4
+ * two-parallel-representations discipline as the token pipeline. */
5
+ export declare const MOTION_DURATION: {
6
+ readonly fast: 150;
7
+ readonly base: 200;
8
+ readonly slow: 300;
9
+ };
10
+ /** True when the user has asked for reduced motion. SSR-safe. */
11
+ export declare function prefersReducedMotion(): boolean;
@@ -0,0 +1,31 @@
1
+ import { CSSProperties, RefObject } from 'react';
2
+ export type AnchoredSide = 'bottom' | 'top';
3
+ export type AnchoredAlign = 'start' | 'end';
4
+ export interface UseAnchoredPositionOptions {
5
+ /** A ref pointing at the anchor element, read fresh on every recompute —
6
+ * never dereferenced by the caller, so the caller never has to read
7
+ * `.current` during render or copy it into its own state. */
8
+ anchor: RefObject<HTMLElement | null> | null | undefined;
9
+ panel: HTMLElement | null;
10
+ open: boolean;
11
+ /** Preferred side. Flips to the opposite side when there isn't room, unless `flip` is false. */
12
+ side?: AnchoredSide;
13
+ align?: AnchoredAlign;
14
+ offset?: number;
15
+ flip?: boolean;
16
+ /** Clamp the panel horizontally so it stays inside the viewport. */
17
+ shift?: boolean;
18
+ matchAnchorWidth?: boolean;
19
+ }
20
+ export interface AnchoredPosition {
21
+ style: CSSProperties;
22
+ /** The side actually used, after flipping — for `data-side` and animation origin. */
23
+ resolvedSide: AnchoredSide;
24
+ }
25
+ /** Computes `position: fixed` coordinates for a panel anchored to a trigger
26
+ * element, so the panel can portal to `document.body` without being
27
+ * clipped by an `overflow: hidden` ancestor. Recomputes on open, resize,
28
+ * and any ancestor scroll (capture-phase, since `position: fixed`
29
+ * coordinates are viewport-relative and unaffected by scroll offset
30
+ * themselves — but the anchor's rect moves when something scrolls). */
31
+ export declare function useAnchoredPosition({ anchor, panel, open, side, align, offset, flip, shift, matchAnchorWidth, }: UseAnchoredPositionOptions): AnchoredPosition;
@@ -0,0 +1,29 @@
1
+ import { CSSProperties, RefObject } from 'react';
2
+ export type FloatingSide = 'top' | 'bottom' | 'left' | 'right';
3
+ export type FloatingAlign = 'start' | 'center' | 'end';
4
+ export interface UseFloatingPositionOptions {
5
+ /** A ref pointing at the anchor element, read fresh on every recompute. */
6
+ anchor: RefObject<HTMLElement | null> | null | undefined;
7
+ panel: HTMLElement | null;
8
+ open: boolean;
9
+ side?: FloatingSide;
10
+ align?: FloatingAlign;
11
+ offset?: number;
12
+ /** Flips to the opposite side on the same axis (top<->bottom, left<->right) when there isn't room. */
13
+ flip?: boolean;
14
+ /** Clamps the cross-axis position so the panel stays inside the viewport. */
15
+ shift?: boolean;
16
+ }
17
+ export interface FloatingPosition {
18
+ style: CSSProperties;
19
+ /** Positions the arrow at the anchor's center on the cross axis, relative to the panel's own box — apply on top of the arrow's own border/rotation classes, which are keyed off `resolvedSide` by the caller. */
20
+ arrowStyle: CSSProperties;
21
+ /** The side actually used, after flipping. */
22
+ resolvedSide: FloatingSide;
23
+ }
24
+ /** Computes `position: fixed` coordinates (+ a matching arrow offset) for a
25
+ * panel anchored to a trigger element on any of 4 sides x 3 alignments,
26
+ * so the panel can portal to `document.body` without being clipped by an
27
+ * `overflow: hidden` ancestor. Recomputes on open, resize, and any
28
+ * ancestor scroll. */
29
+ export declare function useFloatingPosition({ anchor, panel, open, side, align, offset, flip, shift, }: UseFloatingPositionOptions): FloatingPosition;
@@ -0,0 +1,21 @@
1
+ export type TransitionState = 'closed' | 'entering' | 'entered' | 'exiting';
2
+ /** Keeps a node mounted through its exit transition instead of unmounting
3
+ * the instant `open` goes false.
4
+ * - `open` false -> true: `mounted` becomes `true` immediately, `state`
5
+ * is `'entering'`, then flips to `'entered'` after *two* animation
6
+ * frames — a single `requestAnimationFrame` fires before the browser
7
+ * has actually painted the `'entering'` styles (React's commit, this
8
+ * effect, and that one callback can all still land inside the same
9
+ * frame), so the flip to `'entered'` can end up coalesced into the
10
+ * same paint and never visibly transition. Waiting a full frame first
11
+ * guarantees the browser paints the from-state at least once before
12
+ * the to-state is applied, which is what makes a CSS transition
13
+ * actually animate instead of jumping straight to its end value.
14
+ * - `open` true -> false: `state` becomes `'exiting'`; `mounted` stays
15
+ * `true` for `durationMs`, then both flip to `'closed'`/`false`.
16
+ * - Honors `prefers-reduced-motion` by collapsing `durationMs` to `0`, so
17
+ * a reduced-motion user never waits on an invisible mounted node. */
18
+ export declare function useMountTransition(open: boolean, durationMs: number): {
19
+ mounted: boolean;
20
+ state: TransitionState;
21
+ };