@lateralus-ai/shipping-ui 1.4.13 → 1.4.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +108 -108
- package/dist/index.cjs +38 -38
- package/dist/index.esm.js +4512 -4491
- package/dist/tailwind-theme.d.ts +21 -0
- package/package.json +99 -99
- package/src/components/DocumentEditor/DocumentEditor.tsx +871 -871
- package/src/components/HelloWorld.tsx +3 -3
- package/src/components/InputPrompt.tsx +96 -96
- package/src/components/ModalPanel.tsx +49 -49
- package/src/components/PdfViewer/ImageViewer.tsx +211 -211
- package/src/components/PdfViewer/PdfViewer.tsx +232 -232
- package/src/components/PdfViewer/index.ts +2 -2
- package/src/components/PdfViewer/usePageManagement.ts +32 -32
- package/src/components/PdfViewer/usePanning.ts +42 -42
- package/src/components/PdfViewer/useRefDimensions.ts +16 -16
- package/src/components/PdfViewer/useRotation.ts +13 -13
- package/src/components/PdfViewer/useZoom.ts +26 -26
- package/src/components/SearchModal.tsx +320 -320
- package/src/components/Sidebar/Button.tsx +20 -20
- package/src/components/Sidebar/Container.tsx +31 -31
- package/src/components/Sidebar/Item.tsx +39 -39
- package/src/components/Sidebar/Layout.tsx +32 -32
- package/src/components/Sidebar/Provider.tsx +47 -47
- package/src/components/Sidebar/SecondaryItem.tsx +39 -39
- package/src/components/Sidebar/SideContainer.tsx +31 -31
- package/src/components/Sidebar/ToggleCollapseButton.tsx +24 -24
- package/src/components/Sidebar/index.ts +8 -8
- package/src/components/Tabs.tsx +43 -43
- package/src/components/icons/CloseSidebarIcon.tsx +19 -19
- package/src/components/icons/CloseSidebarMidIcon.tsx +19 -19
- package/src/components/icons/ExpandIcon.tsx +21 -21
- package/src/components/icons/SendArrowIcon.tsx +23 -23
- package/src/components/icons/SendArrowIconGreen.tsx +17 -17
- package/src/components/icons/SettingsIcon.tsx +33 -33
- package/src/components/icons/XIcon.tsx +21 -21
- package/src/components/index.ts +6 -6
- package/src/index.ts +4 -4
- package/src/material-theme.ts +477 -477
- package/src/stories/Buttons.stories.tsx +15 -15
- package/src/stories/Buttons.tsx +52 -52
- package/src/stories/Checkbox.stories.tsx +15 -15
- package/src/stories/Checkbox.tsx +56 -56
- package/src/stories/ColorPalette.stories.tsx +15 -15
- package/src/stories/ColorPalette.tsx +85 -72
- package/src/stories/DocumentEditor.stories.tsx +287 -287
- package/src/stories/Dropdowns.stories.tsx +15 -15
- package/src/stories/Dropdowns.tsx +52 -52
- package/src/stories/InputPrompt.stories.tsx +15 -15
- package/src/stories/InputPrompt.tsx +63 -63
- package/src/stories/ModalHeader.stories.tsx +35 -35
- package/src/stories/PDFViewer.stories.tsx +39 -39
- package/src/stories/SearchModal.stories.tsx +132 -132
- package/src/stories/SearchModal.tsx +82 -82
- package/src/stories/Sidebar.stories.tsx +15 -15
- package/src/stories/Sidebar.tsx +108 -108
- package/src/stories/Tabs.stories.tsx +51 -51
- package/src/stories/Typography.stories.tsx +15 -15
- package/src/stories/Typography.tsx +110 -110
- package/src/style.css +2 -2
- package/src/styles/tabs.css +55 -55
- package/src/tailwind-theme.ts +258 -231
- package/src/types/documentEditor.ts +55 -55
- package/src/utils/checkboxModule.ts +241 -241
- 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
|
+
};
|