@lateralus-ai/shipping-ui 1.4.12 → 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 +4936 -4913
  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 -209
  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,15 +1,15 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { Buttons } from "./Buttons";
3
-
4
- const meta = {
5
- title: "Design System/Buttons",
6
- component: Buttons,
7
- parameters: {
8
- layout: "fullscreen",
9
- },
10
- } satisfies Meta<typeof Buttons>;
11
-
12
- export default meta;
13
- type Story = StoryObj<typeof meta>;
14
-
15
- export const Default: Story = {};
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Buttons } from "./Buttons";
3
+
4
+ const meta = {
5
+ title: "Design System/Buttons",
6
+ component: Buttons,
7
+ parameters: {
8
+ layout: "fullscreen",
9
+ },
10
+ } satisfies Meta<typeof Buttons>;
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const Default: Story = {};
@@ -1,52 +1,52 @@
1
- import { Button, IconButton } from "@material-tailwind/react";
2
- import { Icon } from "@iconify/react";
3
-
4
- export const Buttons = () => (
5
- <div className="p-8 grid gap-4">
6
- <div className="flex gap-4">
7
- <IconButton color="blue">
8
- <Icon icon="lucide:ship" />
9
- </IconButton>
10
-
11
- <IconButton color="green">
12
- <Icon icon="lucide:ship" />
13
- </IconButton>
14
-
15
- <IconButton color="gray" variant="text">
16
- <Icon icon="lucide:ship" />
17
- </IconButton>
18
-
19
- <IconButton color="orange">
20
- <Icon icon="lucide:ship" />
21
- </IconButton>
22
-
23
- <IconButton color="red">
24
- <Icon icon="lucide:ship" />
25
- </IconButton>
26
-
27
- <IconButton variant="outlined" color="gray">
28
- <Icon icon="lucide:ship" />
29
- </IconButton>
30
- </div>
31
-
32
- <div className="flex gap-4">
33
- <Button color="blue" className="tracking-[0.16px]">
34
- Lorem ipsum
35
- </Button>
36
-
37
- <Button color="green">Lorem ipsum</Button>
38
-
39
- <Button color="gray" variant="text">
40
- Lorem ipsum
41
- </Button>
42
-
43
- <Button color="orange">Lorem ipsum</Button>
44
-
45
- <Button color="red">Lorem ipsum</Button>
46
-
47
- <Button variant="outlined" color="gray">
48
- Lorem ipsum
49
- </Button>
50
- </div>
51
- </div>
52
- );
1
+ import { Button, IconButton } from "@material-tailwind/react";
2
+ import { Icon } from "@iconify/react";
3
+
4
+ export const Buttons = () => (
5
+ <div className="p-8 grid gap-4">
6
+ <div className="flex gap-4">
7
+ <IconButton color="blue">
8
+ <Icon icon="lucide:ship" />
9
+ </IconButton>
10
+
11
+ <IconButton color="green">
12
+ <Icon icon="lucide:ship" />
13
+ </IconButton>
14
+
15
+ <IconButton color="gray" variant="text">
16
+ <Icon icon="lucide:ship" />
17
+ </IconButton>
18
+
19
+ <IconButton color="orange">
20
+ <Icon icon="lucide:ship" />
21
+ </IconButton>
22
+
23
+ <IconButton color="red">
24
+ <Icon icon="lucide:ship" />
25
+ </IconButton>
26
+
27
+ <IconButton variant="outlined" color="gray">
28
+ <Icon icon="lucide:ship" />
29
+ </IconButton>
30
+ </div>
31
+
32
+ <div className="flex gap-4">
33
+ <Button color="blue" className="tracking-[0.16px]">
34
+ Lorem ipsum
35
+ </Button>
36
+
37
+ <Button color="green">Lorem ipsum</Button>
38
+
39
+ <Button color="gray" variant="text">
40
+ Lorem ipsum
41
+ </Button>
42
+
43
+ <Button color="orange">Lorem ipsum</Button>
44
+
45
+ <Button color="red">Lorem ipsum</Button>
46
+
47
+ <Button variant="outlined" color="gray">
48
+ Lorem ipsum
49
+ </Button>
50
+ </div>
51
+ </div>
52
+ );
@@ -1,15 +1,15 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { CheckboxItem } from "./Checkbox";
3
-
4
- const meta = {
5
- title: "Design System/CheckboxItem",
6
- component: CheckboxItem,
7
- parameters: {
8
- layout: "fullscreen",
9
- },
10
- } satisfies Meta<typeof CheckboxItem>;
11
-
12
- export default meta;
13
- type Story = StoryObj<typeof meta>;
14
-
15
- export const Default: Story = {};
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { CheckboxItem } from "./Checkbox";
3
+
4
+ const meta = {
5
+ title: "Design System/CheckboxItem",
6
+ component: CheckboxItem,
7
+ parameters: {
8
+ layout: "fullscreen",
9
+ },
10
+ } satisfies Meta<typeof CheckboxItem>;
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const Default: Story = {};
@@ -1,56 +1,56 @@
1
- import { Checkbox } from "@material-tailwind/react";
2
- import { Icon } from "@iconify/react";
3
- import { useState } from "react";
4
-
5
- export const CheckboxItem = () => {
6
- const [isChecked, setIsChecked] = useState(false);
7
-
8
- return (
9
- <div className="p-8 grid gap-4">
10
- <div className="flex flex-col gap-2">
11
- <div className="font-medium text-lg">Default</div>
12
- <Checkbox
13
- checked={isChecked}
14
- icon={<Icon icon="lucide:check" className="w-3.5 h-3.5" />}
15
- onChange={() => {
16
- setIsChecked(!isChecked);
17
- }}
18
- containerProps={{
19
- className: "pl-1 pr-2 pb-0 pt-1",
20
- }}
21
- />
22
- </div>
23
-
24
- <div className="flex flex-col gap-2">
25
- <div className="font-medium text-lg">With label</div>
26
- <Checkbox
27
- label="Remember Me"
28
- checked={isChecked}
29
- icon={<Icon icon="lucide:check" className="w-3.5 h-3.5" />}
30
- onChange={() => {
31
- setIsChecked(!isChecked);
32
- }}
33
- containerProps={{
34
- className: "pl-1 pr-2 pb-0 pt-1",
35
- }}
36
- />
37
- </div>
38
-
39
- <div className="flex flex-col gap-2">
40
- <div className="font-medium text-lg">Disabled</div>
41
- <Checkbox
42
- label="Remember Me"
43
- checked={isChecked}
44
- disabled={true}
45
- icon={<Icon icon="lucide:check" className="w-3.5 h-3.5" />}
46
- onChange={() => {
47
- setIsChecked(!isChecked);
48
- }}
49
- containerProps={{
50
- className: "pl-1 pr-2 pb-0 pt-1",
51
- }}
52
- />
53
- </div>
54
- </div>
55
- );
56
- };
1
+ import { Checkbox } from "@material-tailwind/react";
2
+ import { Icon } from "@iconify/react";
3
+ import { useState } from "react";
4
+
5
+ export const CheckboxItem = () => {
6
+ const [isChecked, setIsChecked] = useState(false);
7
+
8
+ return (
9
+ <div className="p-8 grid gap-4">
10
+ <div className="flex flex-col gap-2">
11
+ <div className="font-medium text-lg">Default</div>
12
+ <Checkbox
13
+ checked={isChecked}
14
+ icon={<Icon icon="lucide:check" className="w-3.5 h-3.5" />}
15
+ onChange={() => {
16
+ setIsChecked(!isChecked);
17
+ }}
18
+ containerProps={{
19
+ className: "pl-1 pr-2 pb-0 pt-1",
20
+ }}
21
+ />
22
+ </div>
23
+
24
+ <div className="flex flex-col gap-2">
25
+ <div className="font-medium text-lg">With label</div>
26
+ <Checkbox
27
+ label="Remember Me"
28
+ checked={isChecked}
29
+ icon={<Icon icon="lucide:check" className="w-3.5 h-3.5" />}
30
+ onChange={() => {
31
+ setIsChecked(!isChecked);
32
+ }}
33
+ containerProps={{
34
+ className: "pl-1 pr-2 pb-0 pt-1",
35
+ }}
36
+ />
37
+ </div>
38
+
39
+ <div className="flex flex-col gap-2">
40
+ <div className="font-medium text-lg">Disabled</div>
41
+ <Checkbox
42
+ label="Remember Me"
43
+ checked={isChecked}
44
+ disabled={true}
45
+ icon={<Icon icon="lucide:check" className="w-3.5 h-3.5" />}
46
+ onChange={() => {
47
+ setIsChecked(!isChecked);
48
+ }}
49
+ containerProps={{
50
+ className: "pl-1 pr-2 pb-0 pt-1",
51
+ }}
52
+ />
53
+ </div>
54
+ </div>
55
+ );
56
+ };
@@ -1,15 +1,15 @@
1
- import type { Meta, StoryObj } from "@storybook/react";
2
- import { ColorPalette } from "./ColorPalette";
3
-
4
- const meta = {
5
- title: "Design System/Color Palette",
6
- component: ColorPalette,
7
- parameters: {
8
- layout: "fullscreen",
9
- },
10
- } satisfies Meta<typeof ColorPalette>;
11
-
12
- export default meta;
13
- type Story = StoryObj<typeof meta>;
14
-
15
- export const Default: Story = {};
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ColorPalette } from "./ColorPalette";
3
+
4
+ const meta = {
5
+ title: "Design System/Color Palette",
6
+ component: ColorPalette,
7
+ parameters: {
8
+ layout: "fullscreen",
9
+ },
10
+ } satisfies Meta<typeof ColorPalette>;
11
+
12
+ export default meta;
13
+ type Story = StoryObj<typeof meta>;
14
+
15
+ export const Default: Story = {};
@@ -1,72 +1,85 @@
1
- import React from "react";
2
-
3
- const colorGroups = {
4
- Gray: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
5
- Green: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
6
- Blue: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
7
- Red: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
8
- Orange: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
9
- };
10
-
11
- export const ColorPalette = () => {
12
- return (
13
- <div className="p-8 space-y-8">
14
- <h2 className="text-2xl font-bold mb-4">Color Palette</h2>
15
-
16
- {Object.entries(colorGroups).map(([colorName, shades]) => (
17
- <div key={colorName}>
18
- <h3 className="text-lg font-semibold mb-4">{colorName}</h3>
19
- <div className="grid grid-cols-10 gap-2">
20
- {shades.map((shade) => {
21
- const colorClass = `bg-${colorName.toLowerCase()}-${shade}`;
22
- return (
23
- <div key={shade} className="text-center">
24
- <div
25
- className={`${colorClass} h-20 rounded-md border border-gray-200`}
26
- />
27
- <p className="text-xs mt-1">{shade}</p>
28
- <p className="text-xs text-gray-500">
29
- {colorName.toLowerCase()}-{shade}
30
- </p>
31
- </div>
32
- );
33
- })}
34
- </div>
35
- </div>
36
- ))}
37
-
38
- <div>
39
- <h3 className="text-lg font-semibold mb-4">Special Colors</h3>
40
- <div className="grid grid-cols-6 gap-4">
41
- <div className="text-center">
42
- <div className="bg-brand-purple h-20 rounded-md border border-gray-200" />
43
- <p className="text-xs mt-1">Brand Purple</p>
44
- <p className="text-xs text-gray-500">#ab68ff</p>
45
- </div>
46
- </div>
47
- </div>
48
-
49
- <div>
50
- <h3 className="text-lg font-semibold mb-4">CSS Variables</h3>
51
- <div className="grid grid-cols-4 gap-4">
52
- <div className="text-center">
53
- <div className="bg-surface-primary h-20 rounded-md border border-gray-200" />
54
- <p className="text-xs mt-1">Surface Primary</p>
55
- </div>
56
- <div className="text-center">
57
- <div className="bg-surface-secondary h-20 rounded-md border border-gray-200" />
58
- <p className="text-xs mt-1">Surface Secondary</p>
59
- </div>
60
- <div className="text-center">
61
- <div className="bg-surface-tertiary h-20 rounded-md border border-gray-200" />
62
- <p className="text-xs mt-1">Surface Tertiary</p>
63
- </div>
64
- <div className="text-center">
65
- <div className="bg-surface-submit h-20 rounded-md border border-gray-200" />
66
- <p className="text-xs mt-1">Surface Submit</p>
67
- </div>
68
- </div>
69
- </div>
70
- </div>
71
- );
72
- };
1
+ import { theme } from "../tailwind-theme";
2
+
3
+ const colorGroups = {
4
+ Gray: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
5
+ Green: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
6
+ Blue: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
7
+ Red: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
8
+ Orange: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
9
+ Purple: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
10
+ Brand: ["50", "100", "200", "300", "400", "500", "600", "700", "800", "900"],
11
+ };
12
+
13
+ export const ColorPalette = () => {
14
+ const getColorValue = (colorName: string, shade: string): string => {
15
+ const colorKey = colorName.toLowerCase() as keyof typeof theme.colors;
16
+ const color = theme.colors[colorKey];
17
+ if (typeof color === "object" && color !== null && shade in color) {
18
+ return (color as Record<string, string>)[shade];
19
+ }
20
+ return "#000000";
21
+ };
22
+
23
+ return (
24
+ <div className="p-8 space-y-8">
25
+ <h2 className="text-2xl font-bold mb-4">Color Palette</h2>
26
+
27
+ {Object.entries(colorGroups).map(([colorName, shades]) => (
28
+ <div key={colorName}>
29
+ <h3 className="text-lg font-semibold mb-4">{colorName}</h3>
30
+ <div className="grid grid-cols-10 gap-2">
31
+ {shades.map((shade) => {
32
+ const colorValue = getColorValue(colorName, shade);
33
+ return (
34
+ <div key={shade} className="text-center">
35
+ <div
36
+ className="h-20 rounded-md border border-gray-200"
37
+ style={{ backgroundColor: colorValue }}
38
+ />
39
+ <p className="text-xs mt-1">{shade}</p>
40
+ <p className="text-xs text-gray-500">
41
+ {colorName.toLowerCase()}-{shade}
42
+ </p>
43
+ <p className="text-xs text-gray-400">{colorValue}</p>
44
+ </div>
45
+ );
46
+ })}
47
+ </div>
48
+ </div>
49
+ ))}
50
+
51
+ <div>
52
+ <h3 className="text-lg font-semibold mb-4">Special Colors</h3>
53
+ <div className="grid grid-cols-6 gap-4">
54
+ <div className="text-center">
55
+ <div className="bg-brand-purple h-20 rounded-md border border-gray-200" />
56
+ <p className="text-xs mt-1">Brand Purple</p>
57
+ <p className="text-xs text-gray-500">#ab68ff</p>
58
+ </div>
59
+ </div>
60
+ </div>
61
+
62
+ <div>
63
+ <h3 className="text-lg font-semibold mb-4">CSS Variables</h3>
64
+ <div className="grid grid-cols-4 gap-4">
65
+ <div className="text-center">
66
+ <div className="bg-surface-primary h-20 rounded-md border border-gray-200" />
67
+ <p className="text-xs mt-1">Surface Primary</p>
68
+ </div>
69
+ <div className="text-center">
70
+ <div className="bg-surface-secondary h-20 rounded-md border border-gray-200" />
71
+ <p className="text-xs mt-1">Surface Secondary</p>
72
+ </div>
73
+ <div className="text-center">
74
+ <div className="bg-surface-tertiary h-20 rounded-md border border-gray-200" />
75
+ <p className="text-xs mt-1">Surface Tertiary</p>
76
+ </div>
77
+ <div className="text-center">
78
+ <div className="bg-surface-submit h-20 rounded-md border border-gray-200" />
79
+ <p className="text-xs mt-1">Surface Submit</p>
80
+ </div>
81
+ </div>
82
+ </div>
83
+ </div>
84
+ );
85
+ };