@lateralus-ai/shipping-ui 1.4.13 → 1.4.14

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 (64) hide show
  1. package/README.md +108 -108
  2. package/dist/index.cjs +38 -38
  3. package/dist/index.esm.js +4495 -4489
  4. package/dist/tailwind-theme.d.ts +12 -0
  5. package/package.json +99 -99
  6. package/src/components/DocumentEditor/DocumentEditor.tsx +871 -871
  7. package/src/components/HelloWorld.tsx +3 -3
  8. package/src/components/InputPrompt.tsx +96 -96
  9. package/src/components/ModalPanel.tsx +49 -49
  10. package/src/components/PdfViewer/ImageViewer.tsx +211 -211
  11. package/src/components/PdfViewer/PdfViewer.tsx +232 -232
  12. package/src/components/PdfViewer/index.ts +2 -2
  13. package/src/components/PdfViewer/usePageManagement.ts +32 -32
  14. package/src/components/PdfViewer/usePanning.ts +42 -42
  15. package/src/components/PdfViewer/useRefDimensions.ts +16 -16
  16. package/src/components/PdfViewer/useRotation.ts +13 -13
  17. package/src/components/PdfViewer/useZoom.ts +26 -26
  18. package/src/components/SearchModal.tsx +320 -320
  19. package/src/components/Sidebar/Button.tsx +20 -20
  20. package/src/components/Sidebar/Container.tsx +31 -31
  21. package/src/components/Sidebar/Item.tsx +39 -39
  22. package/src/components/Sidebar/Layout.tsx +32 -32
  23. package/src/components/Sidebar/Provider.tsx +47 -47
  24. package/src/components/Sidebar/SecondaryItem.tsx +39 -39
  25. package/src/components/Sidebar/SideContainer.tsx +31 -31
  26. package/src/components/Sidebar/ToggleCollapseButton.tsx +24 -24
  27. package/src/components/Sidebar/index.ts +8 -8
  28. package/src/components/Tabs.tsx +43 -43
  29. package/src/components/icons/CloseSidebarIcon.tsx +19 -19
  30. package/src/components/icons/CloseSidebarMidIcon.tsx +19 -19
  31. package/src/components/icons/ExpandIcon.tsx +21 -21
  32. package/src/components/icons/SendArrowIcon.tsx +23 -23
  33. package/src/components/icons/SendArrowIconGreen.tsx +17 -17
  34. package/src/components/icons/SettingsIcon.tsx +33 -33
  35. package/src/components/icons/XIcon.tsx +21 -21
  36. package/src/components/index.ts +6 -6
  37. package/src/index.ts +4 -4
  38. package/src/material-theme.ts +477 -477
  39. package/src/stories/Buttons.stories.tsx +15 -15
  40. package/src/stories/Buttons.tsx +52 -52
  41. package/src/stories/Checkbox.stories.tsx +15 -15
  42. package/src/stories/Checkbox.tsx +56 -56
  43. package/src/stories/ColorPalette.stories.tsx +15 -15
  44. package/src/stories/ColorPalette.tsx +85 -72
  45. package/src/stories/DocumentEditor.stories.tsx +287 -287
  46. package/src/stories/Dropdowns.stories.tsx +15 -15
  47. package/src/stories/Dropdowns.tsx +52 -52
  48. package/src/stories/InputPrompt.stories.tsx +15 -15
  49. package/src/stories/InputPrompt.tsx +63 -63
  50. package/src/stories/ModalHeader.stories.tsx +35 -35
  51. package/src/stories/PDFViewer.stories.tsx +39 -39
  52. package/src/stories/SearchModal.stories.tsx +132 -132
  53. package/src/stories/SearchModal.tsx +82 -82
  54. package/src/stories/Sidebar.stories.tsx +15 -15
  55. package/src/stories/Sidebar.tsx +108 -108
  56. package/src/stories/Tabs.stories.tsx +51 -51
  57. package/src/stories/Typography.stories.tsx +15 -15
  58. package/src/stories/Typography.tsx +110 -110
  59. package/src/style.css +2 -2
  60. package/src/styles/tabs.css +55 -55
  61. package/src/tailwind-theme.ts +243 -231
  62. package/src/types/documentEditor.ts +55 -55
  63. package/src/utils/checkboxModule.ts +241 -241
  64. package/src/utils/cn.ts +11 -11
@@ -1,13 +1,13 @@
1
- import { useState } from "react";
2
-
3
- export const useRotation = () => {
4
- const [rotation, setRotation] = useState<number>(0);
5
-
6
- const actions = {
7
- rotateClockwise: () => setRotation((prev) => (prev + 90) % 360),
8
- rotateCounterClockwise: () =>
9
- setRotation((prev) => (prev - 90 + 360) % 360),
10
- };
11
-
12
- return [rotation, actions] as const;
13
- };
1
+ import { useState } from "react";
2
+
3
+ export const useRotation = () => {
4
+ const [rotation, setRotation] = useState<number>(0);
5
+
6
+ const actions = {
7
+ rotateClockwise: () => setRotation((prev) => (prev + 90) % 360),
8
+ rotateCounterClockwise: () =>
9
+ setRotation((prev) => (prev - 90 + 360) % 360),
10
+ };
11
+
12
+ return [rotation, actions] as const;
13
+ };
@@ -1,26 +1,26 @@
1
- import { useState, WheelEvent } from "react";
2
-
3
- export const useZoom = (
4
- initialZoom = 100,
5
- minZoom = 50,
6
- maxZoom = 990,
7
- step = 10,
8
- ) => {
9
- const [zoom, setZoom] = useState<number>(initialZoom);
10
-
11
- const actions = {
12
- zoomIn: () => setZoom((prev) => Math.min(prev + step, maxZoom)),
13
- zoomOut: () => setZoom((prev) => Math.max(prev - step, minZoom)),
14
- reset: () => setZoom(initialZoom),
15
- zoomToValue: (value: number) =>
16
- setZoom(Math.max(minZoom, Math.min(value, maxZoom))),
17
- };
18
-
19
- const handleWheel = (e: WheelEvent) => {
20
- e.preventDefault();
21
- const delta = e.deltaY > 0 ? -step : step;
22
- setZoom((prev) => Math.max(minZoom, Math.min(prev + delta, maxZoom)));
23
- };
24
-
25
- return [zoom, { ...actions, handleWheel }] as const;
26
- };
1
+ import { useState, WheelEvent } from "react";
2
+
3
+ export const useZoom = (
4
+ initialZoom = 100,
5
+ minZoom = 50,
6
+ maxZoom = 990,
7
+ step = 10,
8
+ ) => {
9
+ const [zoom, setZoom] = useState<number>(initialZoom);
10
+
11
+ const actions = {
12
+ zoomIn: () => setZoom((prev) => Math.min(prev + step, maxZoom)),
13
+ zoomOut: () => setZoom((prev) => Math.max(prev - step, minZoom)),
14
+ reset: () => setZoom(initialZoom),
15
+ zoomToValue: (value: number) =>
16
+ setZoom(Math.max(minZoom, Math.min(value, maxZoom))),
17
+ };
18
+
19
+ const handleWheel = (e: WheelEvent) => {
20
+ e.preventDefault();
21
+ const delta = e.deltaY > 0 ? -step : step;
22
+ setZoom((prev) => Math.max(minZoom, Math.min(prev + delta, maxZoom)));
23
+ };
24
+
25
+ return [zoom, { ...actions, handleWheel }] as const;
26
+ };