@inialum/memories-react 0.4.0 → 1.0.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 (34) hide show
  1. package/README.md +60 -12
  2. package/dist/assets/cross_icon.svg.js +6 -0
  3. package/dist/assets/inialum_logo_light_transparent.svg.js +6 -0
  4. package/dist/assets/inialum_logo_white_transparent.svg.js +6 -0
  5. package/dist/assets/menu_icon.svg.js +6 -0
  6. package/dist/assets/x_logo.svg.js +6 -0
  7. package/dist/components/{Button.d.ts → Button/Button.d.ts} +1 -1
  8. package/dist/components/Button/Button.js +59 -0
  9. package/dist/components/Button/Button.stories.d.ts +18 -0
  10. package/dist/components/Button/index.d.ts +1 -0
  11. package/dist/components/Button/index.js +2 -0
  12. package/dist/components/{ButtonLink.d.ts → ButtonLink/ButtonLink.d.ts} +1 -1
  13. package/dist/components/ButtonLink/ButtonLink.js +64 -0
  14. package/dist/components/ButtonLink/ButtonLink.stories.d.ts +19 -0
  15. package/dist/components/ButtonLink/index.d.ts +1 -0
  16. package/dist/components/ButtonLink/index.js +2 -0
  17. package/dist/components/Footer/Footer.js +105 -0
  18. package/dist/components/Footer/Footer.stories.d.ts +9 -0
  19. package/dist/components/Footer/index.d.ts +1 -0
  20. package/dist/components/Footer/index.js +2 -0
  21. package/dist/components/Header/Header.js +46 -0
  22. package/dist/components/Header/Header.stories.d.ts +11 -0
  23. package/dist/components/Header/index.d.ts +1 -0
  24. package/dist/components/Header/index.js +2 -0
  25. package/dist/components/Navigation/Navigation.js +153 -0
  26. package/dist/components/Navigation/Navigation.stories.d.ts +17 -0
  27. package/dist/components/Navigation/index.d.ts +1 -0
  28. package/dist/components/Navigation/index.js +2 -0
  29. package/dist/components/index.js +6 -0
  30. package/dist/index.js +5 -20484
  31. package/package.json +41 -31
  32. /package/dist/components/{Footer.d.ts → Footer/Footer.d.ts} +0 -0
  33. /package/dist/components/{Header.d.ts → Header/Header.d.ts} +0 -0
  34. /package/dist/components/{Navigation.d.ts → Navigation/Navigation.d.ts} +0 -0
@@ -0,0 +1,153 @@
1
+ import { jsx, jsxs } from 'react/jsx-runtime';
2
+ import clsx from 'clsx';
3
+ import { useRef, useCallback, useEffect } from 'react';
4
+ import { createPortal } from 'react-dom';
5
+ import { RemoveScroll } from 'react-remove-scroll';
6
+ import SvgCrossIcon from '../../assets/cross_icon.svg.js';
7
+ import SvgInialumLogoWhiteTransparent from '../../assets/inialum_logo_white_transparent.svg.js';
8
+ import SvgXLogo from '../../assets/x_logo.svg.js';
9
+
10
+ const Navigation = ({ portal = true, ...rest }) => {
11
+ if (portal) {
12
+ const rootElement = portal === true ? document.body : portal.rootElement;
13
+ return createPortal(/* @__PURE__ */ jsx(NavigationContent, { ...rest }), rootElement);
14
+ }
15
+ return /* @__PURE__ */ jsx(NavigationContent, { ...rest });
16
+ };
17
+ const NavigationContent = ({
18
+ isOpen,
19
+ className,
20
+ onClose: _onClose,
21
+ ...rest
22
+ }) => {
23
+ const nowYear = (/* @__PURE__ */ new Date()).getFullYear();
24
+ const dialogRef = useRef(null);
25
+ const onClose = useCallback(() => {
26
+ const dialogElem = dialogRef.current;
27
+ if (!dialogElem) return;
28
+ dialogElem.close();
29
+ _onClose();
30
+ }, [_onClose]);
31
+ useEffect(() => {
32
+ const dialogElem = dialogRef.current;
33
+ if (!dialogElem) return;
34
+ if (isOpen) {
35
+ if (dialogElem.hasAttribute("open")) return;
36
+ dialogElem.showModal();
37
+ } else {
38
+ if (!dialogElem.hasAttribute("open")) return;
39
+ dialogElem.close();
40
+ }
41
+ }, [isOpen]);
42
+ const onClickContent = useCallback((e) => {
43
+ e.stopPropagation();
44
+ }, []);
45
+ return /* @__PURE__ */ jsx(RemoveScroll, { removeScrollBar: true, enabled: isOpen, children: /* @__PURE__ */ jsxs(
46
+ "dialog",
47
+ {
48
+ ...rest,
49
+ ref: dialogRef,
50
+ onClick: onClose,
51
+ className: clsx(
52
+ "bg-blue-600 text-base-white",
53
+ "m-0 p-0 max-w-full max-h-full h-svh left-full -translate-x-full sm:w-372 w-full",
54
+ className
55
+ ),
56
+ style: { transition: "opacity .5s" },
57
+ children: [
58
+ /* @__PURE__ */ jsx(
59
+ "button",
60
+ {
61
+ type: "button",
62
+ className: "absolute top-20 right-20 p-4 fill-base-white",
63
+ "aria-label": "閉じる",
64
+ onClick: onClose,
65
+ children: /* @__PURE__ */ jsx(SvgCrossIcon, { width: "24", height: "24", "aria-hidden": "true" })
66
+ }
67
+ ),
68
+ /* @__PURE__ */ jsxs("div", { className: "w-full h-full", onClick: onClickContent, children: [
69
+ /* @__PURE__ */ jsx("div", { className: "object-cover h-160 w-160 p-12 sm:hidden", children: /* @__PURE__ */ jsx(SvgInialumLogoWhiteTransparent, { "aria-label": "INIALUM - INIAD Alumni Meetings" }) }),
70
+ /* @__PURE__ */ jsx("nav", { children: /* @__PURE__ */ jsxs("ul", { className: "flex flex-col justify-center gap-y-32 px-36 py-32 sm:mt-160", children: [
71
+ /* @__PURE__ */ jsx("li", { className: "font-bold text-xs", children: /* @__PURE__ */ jsx("a", { href: "/", children: "ホーム" }) }),
72
+ /* @__PURE__ */ jsx("li", { className: "font-bold text-xs", children: /* @__PURE__ */ jsx("a", { href: "/vision", children: "私たちの思い" }) }),
73
+ /* @__PURE__ */ jsx("li", { className: "font-bold text-xs", children: /* @__PURE__ */ jsx("a", { href: "https://inialum.org/join", children: "入会する" }) }),
74
+ /* @__PURE__ */ jsx("li", { className: "font-bold text-xs", children: /* @__PURE__ */ jsx("a", { href: "/contact", children: "お問い合わせ" }) }),
75
+ /* @__PURE__ */ jsx("li", { className: "font-bold text-xs", children: /* @__PURE__ */ jsx(
76
+ "a",
77
+ {
78
+ href: "https://inialum.notion.site/INIALUM-Q-A-0cfb2bd4cc814df6a29ca5aa7f9ad9b7",
79
+ target: "_blank",
80
+ rel: "noreferrer noopener",
81
+ children: "Q&A"
82
+ }
83
+ ) })
84
+ ] }) }),
85
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col justify-center border-t border-t-gray-300 gap-y-24 pt-24 mx-36 pb-80 sm:w-300", children: [
86
+ /* @__PURE__ */ jsx(
87
+ "a",
88
+ {
89
+ href: "https://twitter.com/inialum",
90
+ target: "_blank",
91
+ rel: "noreferrer noopener",
92
+ className: "flex items-center w-fit",
93
+ children: /* @__PURE__ */ jsx(
94
+ SvgXLogo,
95
+ {
96
+ "aria-label": "X公式アカウント",
97
+ className: "h-24 fill-base-white"
98
+ }
99
+ )
100
+ }
101
+ ),
102
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-x-20 text-gray-300 text-2xs", children: [
103
+ /* @__PURE__ */ jsx(
104
+ "a",
105
+ {
106
+ href: "https://inialum.notion.site/4cbf67b190544bff8891deabc64e776c",
107
+ target: "_blank",
108
+ rel: "noreferrer noopener",
109
+ children: "同窓会会則"
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsx(
113
+ "a",
114
+ {
115
+ href: "https://inialum.notion.site/4d2374f79b594f00b93c0efccf3c6bb4",
116
+ target: "_blank",
117
+ rel: "noreferrer noopener",
118
+ children: "役員一覧"
119
+ }
120
+ ),
121
+ /* @__PURE__ */ jsx(
122
+ "a",
123
+ {
124
+ href: "https://inialum.notion.site/d8a7e0dd14224c0dadfd630a6665cee0",
125
+ target: "_blank",
126
+ rel: "noreferrer noopener",
127
+ children: "プライバシーポリシー"
128
+ }
129
+ ),
130
+ /* @__PURE__ */ jsx(
131
+ "a",
132
+ {
133
+ href: "https://github.com/inialum",
134
+ target: "_blank",
135
+ rel: "noreferrer noopener",
136
+ children: "GitHub"
137
+ }
138
+ )
139
+ ] }),
140
+ /* @__PURE__ */ jsxs("div", { className: "text-2xs text-gray-300", children: [
141
+ "© ",
142
+ nowYear,
143
+ " INIALUM - INIAD Alumni Meetings."
144
+ ] })
145
+ ] })
146
+ ] })
147
+ ]
148
+ }
149
+ ) });
150
+ };
151
+
152
+ export { Navigation };
153
+ //# sourceMappingURL=Navigation.js.map
@@ -0,0 +1,17 @@
1
+ import { StoryObj } from '@storybook/react-vite';
2
+ import { ClassAttributes, DialogHTMLAttributes } from 'react';
3
+ declare const meta: {
4
+ title: string;
5
+ component: ({ portal, ...rest }: ClassAttributes<HTMLDialogElement> & DialogHTMLAttributes<HTMLDialogElement> & {
6
+ isOpen: boolean;
7
+ onClose: () => void;
8
+ } & {
9
+ portal?: true | {
10
+ rootElement: Element;
11
+ };
12
+ }) => import("react/jsx-runtime").JSX.Element;
13
+ tags: string[];
14
+ };
15
+ export default meta;
16
+ type Story = StoryObj<typeof meta>;
17
+ export declare const Default: Story;
@@ -0,0 +1 @@
1
+ export { Navigation } from './Navigation';
@@ -0,0 +1,2 @@
1
+ export { Navigation } from './Navigation.js';
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ export { Button } from './Button/Button.js';
2
+ export { ButtonLink } from './ButtonLink/ButtonLink.js';
3
+ export { Footer } from './Footer/Footer.js';
4
+ export { Header } from './Header/Header.js';
5
+ export { Navigation } from './Navigation/Navigation.js';
6
+ //# sourceMappingURL=index.js.map