@pichetch08/trip-ui 0.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.
- package/README.md +46 -0
- package/dist/accordion.d.ts +18 -0
- package/dist/accordion.js +76 -0
- package/dist/agreement-modal.d.ts +16 -0
- package/dist/agreement-modal.js +67 -0
- package/dist/alert.d.ts +13 -0
- package/dist/alert.js +47 -0
- package/dist/auth-hero.d.ts +7 -0
- package/dist/auth-hero.js +63 -0
- package/dist/avatar.d.ts +21 -0
- package/dist/avatar.js +114 -0
- package/dist/badge.d.ts +13 -0
- package/dist/badge.js +36 -0
- package/dist/banner.d.ts +14 -0
- package/dist/banner.js +57 -0
- package/dist/breadcrumb.d.ts +15 -0
- package/dist/breadcrumb.js +37 -0
- package/dist/button.d.ts +15 -0
- package/dist/button.js +81 -0
- package/dist/card.d.ts +30 -0
- package/dist/card.js +66 -0
- package/dist/change-summary-modal.d.ts +35 -0
- package/dist/change-summary-modal.js +128 -0
- package/dist/channel-badge.d.ts +8 -0
- package/dist/channel-badge.js +17 -0
- package/dist/checkbox.d.ts +28 -0
- package/dist/checkbox.js +108 -0
- package/dist/chunk-ORMEWXMH.js +37 -0
- package/dist/color-picker.d.ts +15 -0
- package/dist/color-picker.js +159 -0
- package/dist/confirm-dialog.d.ts +23 -0
- package/dist/confirm-dialog.js +108 -0
- package/dist/copy-button.d.ts +13 -0
- package/dist/copy-button.js +69 -0
- package/dist/dashed-add-button.d.ts +8 -0
- package/dist/dashed-add-button.js +24 -0
- package/dist/data-table.d.ts +27 -0
- package/dist/data-table.js +152 -0
- package/dist/date-picker.d.ts +19 -0
- package/dist/date-picker.js +234 -0
- package/dist/date-range-picker.d.ts +25 -0
- package/dist/date-range-picker.js +456 -0
- package/dist/dev-auto-fill.d.ts +12 -0
- package/dist/dev-auto-fill.js +22 -0
- package/dist/divider.d.ts +10 -0
- package/dist/divider.js +44 -0
- package/dist/drawer.d.ts +16 -0
- package/dist/drawer.js +111 -0
- package/dist/dropdown-menu.d.ts +20 -0
- package/dist/dropdown-menu.js +94 -0
- package/dist/empty-state.d.ts +13 -0
- package/dist/empty-state.js +24 -0
- package/dist/file-upload.d.ts +32 -0
- package/dist/file-upload.js +212 -0
- package/dist/filter-tabs.d.ts +16 -0
- package/dist/filter-tabs.js +30 -0
- package/dist/footer-action-bar.d.ts +21 -0
- package/dist/footer-action-bar.js +95 -0
- package/dist/form-input.d.ts +16 -0
- package/dist/form-input.js +58 -0
- package/dist/form-textarea.d.ts +13 -0
- package/dist/form-textarea.js +41 -0
- package/dist/icon-button.d.ts +12 -0
- package/dist/icon-button.js +54 -0
- package/dist/icon-picker.d.ts +15 -0
- package/dist/icon-picker.js +311 -0
- package/dist/icon-wrapper.d.ts +15 -0
- package/dist/icon-wrapper.js +52 -0
- package/dist/image-upload.d.ts +24 -0
- package/dist/image-upload.js +122 -0
- package/dist/index.d.ts +71 -0
- package/dist/index.js +155 -0
- package/dist/kbd.d.ts +15 -0
- package/dist/kbd.js +27 -0
- package/dist/mobile-preview.d.ts +36 -0
- package/dist/mobile-preview.js +167 -0
- package/dist/modal.d.ts +19 -0
- package/dist/modal.js +110 -0
- package/dist/multi-select.d.ts +30 -0
- package/dist/multi-select.js +261 -0
- package/dist/number-input.d.ts +21 -0
- package/dist/number-input.js +129 -0
- package/dist/otp-input.d.ts +13 -0
- package/dist/otp-input.js +114 -0
- package/dist/page-header.d.ts +15 -0
- package/dist/page-header.js +43 -0
- package/dist/page-state.d.ts +14 -0
- package/dist/page-state.js +29 -0
- package/dist/pagination.d.ts +20 -0
- package/dist/pagination.js +87 -0
- package/dist/popover.d.ts +11 -0
- package/dist/popover.js +70 -0
- package/dist/preview-drawer.d.ts +33 -0
- package/dist/preview-drawer.js +74 -0
- package/dist/progress-bar.d.ts +15 -0
- package/dist/progress-bar.js +56 -0
- package/dist/qr-code-display.d.ts +10 -0
- package/dist/qr-code-display.js +43 -0
- package/dist/radio-group.d.ts +19 -0
- package/dist/radio-group.js +78 -0
- package/dist/rating.d.ts +12 -0
- package/dist/rating.js +123 -0
- package/dist/rich-editor.d.ts +13 -0
- package/dist/rich-editor.js +97 -0
- package/dist/search-bar.d.ts +14 -0
- package/dist/search-bar.js +64 -0
- package/dist/section-header.d.ts +12 -0
- package/dist/section-header.js +41 -0
- package/dist/segmented-control.d.ts +24 -0
- package/dist/segmented-control.js +38 -0
- package/dist/select-picker.d.ts +24 -0
- package/dist/select-picker.js +157 -0
- package/dist/skeleton.d.ts +14 -0
- package/dist/skeleton.js +53 -0
- package/dist/slider.d.ts +17 -0
- package/dist/slider.js +151 -0
- package/dist/spinner.d.ts +13 -0
- package/dist/spinner.js +38 -0
- package/dist/stat-card.d.ts +20 -0
- package/dist/stat-card.js +87 -0
- package/dist/stats-summary.d.ts +13 -0
- package/dist/stats-summary.js +28 -0
- package/dist/status-badge.d.ts +19 -0
- package/dist/status-badge.js +41 -0
- package/dist/stepper.d.ts +12 -0
- package/dist/stepper.js +89 -0
- package/dist/tabs.d.ts +18 -0
- package/dist/tabs.js +70 -0
- package/dist/tag.d.ts +23 -0
- package/dist/tag.js +158 -0
- package/dist/time-picker.d.ts +19 -0
- package/dist/time-picker.js +222 -0
- package/dist/timeline.d.ts +15 -0
- package/dist/timeline.js +49 -0
- package/dist/toast.d.ts +18 -0
- package/dist/toast.js +108 -0
- package/dist/toggle-switch.d.ts +12 -0
- package/dist/toggle-switch.js +34 -0
- package/dist/tooltip.d.ts +9 -0
- package/dist/tooltip.js +69 -0
- package/dist/trip-day-map-lazy.d.ts +15 -0
- package/dist/trip-day-map-lazy.js +16 -0
- package/dist/trip-day-map.d.ts +15 -0
- package/dist/trip-day-map.js +62 -0
- package/package.json +73 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import "./chunk-ORMEWXMH.js";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
function Breadcrumb({ items, className = "", navAriaLabel = "Breadcrumb", homeAriaLabel = "Home" }) {
|
|
4
|
+
return /* @__PURE__ */ jsx("nav", { "aria-label": navAriaLabel, className, children: /* @__PURE__ */ jsx("ol", { className: `flex flex-wrap gap-1 items-center`, children: items.map((item, index) => {
|
|
5
|
+
const isLast = index === items.length - 1;
|
|
6
|
+
const isFirst = index === 0;
|
|
7
|
+
const showHomeIcon = isFirst && !item.label;
|
|
8
|
+
return /* @__PURE__ */ jsxs("li", { className: "flex items-center gap-1", children: [
|
|
9
|
+
index > 0 && /* @__PURE__ */ jsx(
|
|
10
|
+
"span",
|
|
11
|
+
{
|
|
12
|
+
className: "material-symbols-outlined text-sm text-on-surface-variant opacity-40",
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
children: "chevron_right"
|
|
15
|
+
}
|
|
16
|
+
),
|
|
17
|
+
isLast || !item.href ? /* @__PURE__ */ jsx(
|
|
18
|
+
"span",
|
|
19
|
+
{
|
|
20
|
+
className: "text-sm font-semibold text-on-surface",
|
|
21
|
+
"aria-current": isLast ? "page" : void 0,
|
|
22
|
+
children: showHomeIcon ? /* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-sm", "aria-label": homeAriaLabel, children: "home" }) : item.label
|
|
23
|
+
}
|
|
24
|
+
) : /* @__PURE__ */ jsx(
|
|
25
|
+
"a",
|
|
26
|
+
{
|
|
27
|
+
href: item.href,
|
|
28
|
+
className: "text-sm text-on-surface-variant hover:text-on-surface transition-colors",
|
|
29
|
+
children: showHomeIcon ? /* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-sm", "aria-label": homeAriaLabel, children: "home" }) : item.label
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
] }, index);
|
|
33
|
+
}) }) });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
Breadcrumb
|
|
37
|
+
};
|
package/dist/button.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React$1 from 'react';
|
|
2
|
+
|
|
3
|
+
type ButtonVariant = "primary" | "secondary" | "outline" | "ghost" | "danger";
|
|
4
|
+
type ButtonSize = "sm" | "md" | "lg";
|
|
5
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
icon?: string;
|
|
10
|
+
iconPosition?: "left" | "right";
|
|
11
|
+
fullWidth?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const Button: React$1.ForwardRefExoticComponent<ButtonProps & React$1.RefAttributes<HTMLButtonElement>>;
|
|
14
|
+
|
|
15
|
+
export { Button, type ButtonSize, type ButtonVariant };
|
package/dist/button.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__objRest,
|
|
4
|
+
__spreadProps,
|
|
5
|
+
__spreadValues
|
|
6
|
+
} from "./chunk-ORMEWXMH.js";
|
|
7
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
|
+
import { forwardRef } from "react";
|
|
9
|
+
import { Spinner } from "./spinner";
|
|
10
|
+
const VARIANT = {
|
|
11
|
+
primary: "bg-primary text-on-primary hover:[filter:brightness(0.88)] shadow-sm hover:shadow-md active:scale-[0.98]",
|
|
12
|
+
secondary: "bg-surface-container text-on-surface hover:bg-surface-container-high active:scale-[0.98]",
|
|
13
|
+
outline: "bg-transparent border border-outline-variant text-on-surface hover:bg-surface-container-low hover:border-outline active:scale-[0.98]",
|
|
14
|
+
ghost: "bg-transparent text-on-surface-variant hover:bg-surface-container hover:text-on-surface active:scale-[0.98]",
|
|
15
|
+
danger: "bg-red-500 text-white hover:[filter:brightness(0.88)] shadow-sm hover:shadow-md active:scale-[0.98]"
|
|
16
|
+
};
|
|
17
|
+
const SIZE = {
|
|
18
|
+
sm: "px-3 py-1.5 text-xs rounded-lg gap-1.5",
|
|
19
|
+
md: "px-5 py-2.5 text-sm rounded-xl gap-2",
|
|
20
|
+
lg: "px-6 py-3.5 text-base rounded-xl gap-2.5"
|
|
21
|
+
};
|
|
22
|
+
const ICON_SIZE = {
|
|
23
|
+
sm: "text-sm",
|
|
24
|
+
md: "text-base",
|
|
25
|
+
lg: "text-lg"
|
|
26
|
+
};
|
|
27
|
+
const Button = forwardRef(
|
|
28
|
+
(_a, ref) => {
|
|
29
|
+
var _b = _a, {
|
|
30
|
+
variant = "primary",
|
|
31
|
+
size = "md",
|
|
32
|
+
loading = false,
|
|
33
|
+
icon,
|
|
34
|
+
iconPosition = "left",
|
|
35
|
+
fullWidth = false,
|
|
36
|
+
disabled,
|
|
37
|
+
children,
|
|
38
|
+
className = ""
|
|
39
|
+
} = _b, props = __objRest(_b, [
|
|
40
|
+
"variant",
|
|
41
|
+
"size",
|
|
42
|
+
"loading",
|
|
43
|
+
"icon",
|
|
44
|
+
"iconPosition",
|
|
45
|
+
"fullWidth",
|
|
46
|
+
"disabled",
|
|
47
|
+
"children",
|
|
48
|
+
"className"
|
|
49
|
+
]);
|
|
50
|
+
const isDisabled = disabled || loading;
|
|
51
|
+
return /* @__PURE__ */ jsxs(
|
|
52
|
+
"button",
|
|
53
|
+
__spreadProps(__spreadValues({
|
|
54
|
+
ref,
|
|
55
|
+
type: "button",
|
|
56
|
+
disabled: isDisabled,
|
|
57
|
+
className: [
|
|
58
|
+
"inline-flex items-center justify-center font-semibold",
|
|
59
|
+
"transition-all duration-200",
|
|
60
|
+
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40 focus-visible:ring-offset-2",
|
|
61
|
+
"disabled:opacity-40 disabled:cursor-not-allowed disabled:pointer-events-none",
|
|
62
|
+
VARIANT[variant],
|
|
63
|
+
SIZE[size],
|
|
64
|
+
fullWidth ? "w-full" : "",
|
|
65
|
+
className
|
|
66
|
+
].filter(Boolean).join(" ")
|
|
67
|
+
}, props), {
|
|
68
|
+
children: [
|
|
69
|
+
loading && /* @__PURE__ */ jsx(Spinner, { size: size === "lg" ? "sm" : "xs", color: variant === "primary" || variant === "danger" ? "white" : "primary" }),
|
|
70
|
+
!loading && icon && iconPosition === "left" && /* @__PURE__ */ jsx("span", { className: `material-symbols-outlined leading-none ${ICON_SIZE[size]}`, "aria-hidden": "true", children: icon }),
|
|
71
|
+
children,
|
|
72
|
+
!loading && icon && iconPosition === "right" && /* @__PURE__ */ jsx("span", { className: `material-symbols-outlined leading-none ${ICON_SIZE[size]}`, "aria-hidden": "true", children: icon })
|
|
73
|
+
]
|
|
74
|
+
})
|
|
75
|
+
);
|
|
76
|
+
}
|
|
77
|
+
);
|
|
78
|
+
Button.displayName = "Button";
|
|
79
|
+
export {
|
|
80
|
+
Button
|
|
81
|
+
};
|
package/dist/card.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import React__default from 'react';
|
|
3
|
+
|
|
4
|
+
interface CardProps {
|
|
5
|
+
children: React__default.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
padding?: "none" | "sm" | "md" | "lg";
|
|
8
|
+
shadow?: "none" | "sm" | "md";
|
|
9
|
+
border?: boolean;
|
|
10
|
+
hover?: boolean;
|
|
11
|
+
onClick?: () => void;
|
|
12
|
+
}
|
|
13
|
+
declare function Card({ children, className, padding, shadow, border, hover, onClick, }: CardProps): react_jsx_runtime.JSX.Element;
|
|
14
|
+
interface CardHeaderProps {
|
|
15
|
+
children: React__default.ReactNode;
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|
|
18
|
+
declare function CardHeader({ children, className }: CardHeaderProps): react_jsx_runtime.JSX.Element;
|
|
19
|
+
interface CardBodyProps {
|
|
20
|
+
children: React__default.ReactNode;
|
|
21
|
+
className?: string;
|
|
22
|
+
}
|
|
23
|
+
declare function CardBody({ children, className }: CardBodyProps): react_jsx_runtime.JSX.Element;
|
|
24
|
+
interface CardFooterProps {
|
|
25
|
+
children: React__default.ReactNode;
|
|
26
|
+
className?: string;
|
|
27
|
+
}
|
|
28
|
+
declare function CardFooter({ children, className }: CardFooterProps): react_jsx_runtime.JSX.Element;
|
|
29
|
+
|
|
30
|
+
export { Card, CardBody, CardFooter, CardHeader };
|
package/dist/card.js
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./chunk-ORMEWXMH.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
const paddingMap = {
|
|
5
|
+
none: "",
|
|
6
|
+
sm: "p-4",
|
|
7
|
+
md: "p-6",
|
|
8
|
+
lg: "p-8"
|
|
9
|
+
};
|
|
10
|
+
const shadowMap = {
|
|
11
|
+
none: "",
|
|
12
|
+
sm: "shadow-sm",
|
|
13
|
+
md: "shadow-md"
|
|
14
|
+
};
|
|
15
|
+
function Card({
|
|
16
|
+
children,
|
|
17
|
+
className = "",
|
|
18
|
+
padding = "md",
|
|
19
|
+
shadow = "sm",
|
|
20
|
+
border = true,
|
|
21
|
+
hover = false,
|
|
22
|
+
onClick
|
|
23
|
+
}) {
|
|
24
|
+
const base = [
|
|
25
|
+
"bg-surface rounded-2xl",
|
|
26
|
+
paddingMap[padding],
|
|
27
|
+
shadowMap[shadow],
|
|
28
|
+
border ? "border border-outline-variant/10" : "",
|
|
29
|
+
hover ? "hover:shadow-md transition-shadow cursor-pointer" : "",
|
|
30
|
+
onClick ? "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30" : "",
|
|
31
|
+
className
|
|
32
|
+
].filter(Boolean).join(" ");
|
|
33
|
+
if (onClick) {
|
|
34
|
+
return /* @__PURE__ */ jsx("div", { role: "button", tabIndex: 0, onClick, onKeyDown: (e) => {
|
|
35
|
+
if (e.key === "Enter" || e.key === " ") onClick();
|
|
36
|
+
}, className: base, children });
|
|
37
|
+
}
|
|
38
|
+
return /* @__PURE__ */ jsx("div", { className: base, children });
|
|
39
|
+
}
|
|
40
|
+
function CardHeader({ children, className = "" }) {
|
|
41
|
+
return /* @__PURE__ */ jsx(
|
|
42
|
+
"div",
|
|
43
|
+
{
|
|
44
|
+
className: `px-6 py-4 border-b border-outline-variant/10 flex items-center justify-between ${className}`,
|
|
45
|
+
children
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
function CardBody({ children, className = "" }) {
|
|
50
|
+
return /* @__PURE__ */ jsx("div", { className: `p-6 ${className}`, children });
|
|
51
|
+
}
|
|
52
|
+
function CardFooter({ children, className = "" }) {
|
|
53
|
+
return /* @__PURE__ */ jsx(
|
|
54
|
+
"div",
|
|
55
|
+
{
|
|
56
|
+
className: `px-6 py-4 border-t border-outline-variant/10 flex items-center gap-3 ${className}`,
|
|
57
|
+
children
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
Card,
|
|
63
|
+
CardBody,
|
|
64
|
+
CardFooter,
|
|
65
|
+
CardHeader
|
|
66
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
type ChangeEntry = {
|
|
2
|
+
type: "add" | "update" | "delete";
|
|
3
|
+
entity: "day" | "activity" | "trip_info";
|
|
4
|
+
dayNumber?: number;
|
|
5
|
+
field?: string;
|
|
6
|
+
oldValue?: string;
|
|
7
|
+
newValue?: string;
|
|
8
|
+
description: string;
|
|
9
|
+
};
|
|
10
|
+
interface ChangeSummaryLabels {
|
|
11
|
+
title?: string;
|
|
12
|
+
sentTitle?: string;
|
|
13
|
+
sentDescription?: (count: number) => string;
|
|
14
|
+
addLabel?: string;
|
|
15
|
+
updateLabel?: string;
|
|
16
|
+
deleteLabel?: string;
|
|
17
|
+
saveOnlyLabel?: string;
|
|
18
|
+
sendLabel?: string;
|
|
19
|
+
sendingLabel?: string;
|
|
20
|
+
doneLabel?: string;
|
|
21
|
+
closeAriaLabel?: string;
|
|
22
|
+
followerNoticeText?: (count: number) => React.ReactNode;
|
|
23
|
+
limitNoticeText?: React.ReactNode;
|
|
24
|
+
}
|
|
25
|
+
interface ChangeSummaryModalProps {
|
|
26
|
+
open: boolean;
|
|
27
|
+
onClose: () => void;
|
|
28
|
+
tripTitle: string;
|
|
29
|
+
followerCount: number;
|
|
30
|
+
changes: ChangeEntry[];
|
|
31
|
+
labels?: ChangeSummaryLabels;
|
|
32
|
+
}
|
|
33
|
+
declare function ChangeSummaryModal({ open, onClose, tripTitle, followerCount, changes, labels, }: ChangeSummaryModalProps): React.ReactNode;
|
|
34
|
+
|
|
35
|
+
export { type ChangeEntry, ChangeSummaryModal };
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./chunk-ORMEWXMH.js";
|
|
3
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useState, useRef } from "react";
|
|
5
|
+
import { Button } from "./button";
|
|
6
|
+
import { IconButton } from "./icon-button";
|
|
7
|
+
const CHANGE_TYPE_STYLE = {
|
|
8
|
+
add: { icon: "add_circle", color: "text-green-600" },
|
|
9
|
+
update: { icon: "edit", color: "text-blue-600" },
|
|
10
|
+
delete: { icon: "remove_circle", color: "text-red-500" }
|
|
11
|
+
};
|
|
12
|
+
function ChangeSummaryModal({
|
|
13
|
+
open,
|
|
14
|
+
onClose,
|
|
15
|
+
tripTitle,
|
|
16
|
+
followerCount,
|
|
17
|
+
changes,
|
|
18
|
+
labels
|
|
19
|
+
}) {
|
|
20
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
|
21
|
+
const resolvedLabels = {
|
|
22
|
+
title: (_a = labels == null ? void 0 : labels.title) != null ? _a : "\u0E2A\u0E23\u0E38\u0E1B\u0E01\u0E32\u0E23\u0E40\u0E1B\u0E25\u0E35\u0E48\u0E22\u0E19\u0E41\u0E1B\u0E25\u0E07",
|
|
23
|
+
sentTitle: (_b = labels == null ? void 0 : labels.sentTitle) != null ? _b : "\u0E2A\u0E48\u0E07\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E41\u0E25\u0E49\u0E27!",
|
|
24
|
+
sentDescription: (_c = labels == null ? void 0 : labels.sentDescription) != null ? _c : ((n) => `\u0E2A\u0E48\u0E07\u0E44\u0E1B\u0E22\u0E31\u0E07 ${n} \u0E04\u0E19\u0E17\u0E35\u0E48\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E17\u0E23\u0E34\u0E1B\u0E19\u0E35\u0E49`),
|
|
25
|
+
addLabel: (_d = labels == null ? void 0 : labels.addLabel) != null ? _d : "\u0E40\u0E1E\u0E34\u0E48\u0E21",
|
|
26
|
+
updateLabel: (_e = labels == null ? void 0 : labels.updateLabel) != null ? _e : "\u0E41\u0E01\u0E49\u0E44\u0E02",
|
|
27
|
+
deleteLabel: (_f = labels == null ? void 0 : labels.deleteLabel) != null ? _f : "\u0E25\u0E1A",
|
|
28
|
+
saveOnlyLabel: (_g = labels == null ? void 0 : labels.saveOnlyLabel) != null ? _g : "\u0E1A\u0E31\u0E19\u0E17\u0E36\u0E01\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E40\u0E14\u0E35\u0E22\u0E27",
|
|
29
|
+
sendLabel: (_h = labels == null ? void 0 : labels.sendLabel) != null ? _h : "\u0E2A\u0E48\u0E07\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19",
|
|
30
|
+
sendingLabel: (_i = labels == null ? void 0 : labels.sendingLabel) != null ? _i : "\u0E01\u0E33\u0E25\u0E31\u0E07\u0E2A\u0E48\u0E07...",
|
|
31
|
+
doneLabel: (_j = labels == null ? void 0 : labels.doneLabel) != null ? _j : "\u0E40\u0E2A\u0E23\u0E47\u0E08\u0E2A\u0E34\u0E49\u0E19",
|
|
32
|
+
closeAriaLabel: (_k = labels == null ? void 0 : labels.closeAriaLabel) != null ? _k : "\u0E1B\u0E34\u0E14",
|
|
33
|
+
followerNoticeText: (_l = labels == null ? void 0 : labels.followerNoticeText) != null ? _l : ((n) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
"\u0E08\u0E30\u0E2A\u0E48\u0E07\u0E41\u0E08\u0E49\u0E07\u0E40\u0E15\u0E37\u0E2D\u0E19\u0E44\u0E1B\u0E22\u0E31\u0E07 ",
|
|
35
|
+
/* @__PURE__ */ jsxs("strong", { children: [
|
|
36
|
+
n,
|
|
37
|
+
" \u0E04\u0E19"
|
|
38
|
+
] }),
|
|
39
|
+
" \u0E17\u0E35\u0E48\u0E15\u0E34\u0E14\u0E15\u0E32\u0E21\u0E17\u0E23\u0E34\u0E1B\u0E19\u0E35\u0E49"
|
|
40
|
+
] })),
|
|
41
|
+
limitNoticeText: (_m = labels == null ? void 0 : labels.limitNoticeText) != null ? _m : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
42
|
+
"\u0E01\u0E32\u0E23\u0E41\u0E01\u0E49\u0E44\u0E02\u0E04\u0E23\u0E31\u0E49\u0E07\u0E17\u0E35\u0E48 ",
|
|
43
|
+
/* @__PURE__ */ jsx("strong", { children: "1/2" }),
|
|
44
|
+
" (Free Plan)"
|
|
45
|
+
] })
|
|
46
|
+
};
|
|
47
|
+
const [sending, setSending] = useState(false);
|
|
48
|
+
const [sent, setSent] = useState(false);
|
|
49
|
+
const sendTimeoutRef = useRef(null);
|
|
50
|
+
if (!open) return null;
|
|
51
|
+
function handleSendNotification() {
|
|
52
|
+
setSending(true);
|
|
53
|
+
sendTimeoutRef.current = setTimeout(() => {
|
|
54
|
+
setSending(false);
|
|
55
|
+
setSent(true);
|
|
56
|
+
}, 1500);
|
|
57
|
+
}
|
|
58
|
+
function handleClose() {
|
|
59
|
+
if (sendTimeoutRef.current) {
|
|
60
|
+
clearTimeout(sendTimeoutRef.current);
|
|
61
|
+
sendTimeoutRef.current = null;
|
|
62
|
+
}
|
|
63
|
+
setSent(false);
|
|
64
|
+
onClose();
|
|
65
|
+
}
|
|
66
|
+
return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-100 flex items-center justify-center p-4", children: [
|
|
67
|
+
/* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-black/50 backdrop-blur-sm cursor-pointer", onClick: handleClose }),
|
|
68
|
+
/* @__PURE__ */ jsx("div", { className: "relative bg-surface rounded-2xl shadow-2xl w-full max-w-lg overflow-hidden", children: sent ? /* @__PURE__ */ jsxs("div", { className: "p-8 text-center space-y-4", children: [
|
|
69
|
+
/* @__PURE__ */ jsx("div", { className: "w-16 h-16 rounded-full bg-green-100 flex items-center justify-center mx-auto", children: /* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-green-600 text-4xl", style: { fontVariationSettings: "'FILL' 1" }, children: "check_circle" }) }),
|
|
70
|
+
/* @__PURE__ */ jsx("h3", { className: "text-xl font-bold text-on-surface", children: resolvedLabels.sentTitle }),
|
|
71
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-on-surface-variant", children: resolvedLabels.sentDescription(followerCount) }),
|
|
72
|
+
/* @__PURE__ */ jsx(Button, { variant: "primary", onClick: handleClose, className: "mt-4", children: resolvedLabels.doneLabel })
|
|
73
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
74
|
+
/* @__PURE__ */ jsx("div", { className: "p-6 pb-0", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between", children: [
|
|
75
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
|
|
76
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-xl bg-amber-100 flex items-center justify-center", children: /* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-amber-600", children: "edit_notifications" }) }),
|
|
77
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
78
|
+
/* @__PURE__ */ jsx("h3", { className: "font-bold text-on-surface", children: resolvedLabels.title }),
|
|
79
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-on-surface-variant", children: tripTitle })
|
|
80
|
+
] })
|
|
81
|
+
] }),
|
|
82
|
+
/* @__PURE__ */ jsx(IconButton, { icon: "close", variant: "ghost", size: "sm", onClick: handleClose, "aria-label": resolvedLabels.closeAriaLabel })
|
|
83
|
+
] }) }),
|
|
84
|
+
/* @__PURE__ */ jsx("div", { className: "p-6 space-y-3 max-h-64 overflow-y-auto", children: changes.map((change, i) => {
|
|
85
|
+
const ct = CHANGE_TYPE_STYLE[change.type];
|
|
86
|
+
const typeLabel = change.type === "add" ? resolvedLabels.addLabel : change.type === "update" ? resolvedLabels.updateLabel : resolvedLabels.deleteLabel;
|
|
87
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3 py-2", children: [
|
|
88
|
+
/* @__PURE__ */ jsx("span", { className: `material-symbols-outlined ${ct.color} text-lg mt-0.5`, style: { fontVariationSettings: "'FILL' 1" }, "aria-label": typeLabel, children: ct.icon }),
|
|
89
|
+
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
90
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-on-surface", children: change.description }),
|
|
91
|
+
change.dayNumber && /* @__PURE__ */ jsxs("p", { className: "text-[11px] text-on-surface-variant mt-0.5", children: [
|
|
92
|
+
"Day ",
|
|
93
|
+
change.dayNumber
|
|
94
|
+
] })
|
|
95
|
+
] })
|
|
96
|
+
] }, i);
|
|
97
|
+
}) }),
|
|
98
|
+
/* @__PURE__ */ jsxs("div", { className: "p-6 pt-0 space-y-3", children: [
|
|
99
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 bg-blue-50 rounded-xl p-3", children: [
|
|
100
|
+
/* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-blue-600 text-lg", children: "group" }),
|
|
101
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-blue-700", children: resolvedLabels.followerNoticeText(followerCount) })
|
|
102
|
+
] }),
|
|
103
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 bg-amber-50 rounded-xl p-3", children: [
|
|
104
|
+
/* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-amber-600 text-lg", children: "warning" }),
|
|
105
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm text-amber-700", children: resolvedLabels.limitNoticeText })
|
|
106
|
+
] }),
|
|
107
|
+
/* @__PURE__ */ jsxs("div", { className: "flex gap-3 pt-2", children: [
|
|
108
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", className: "flex-1", onClick: handleClose, children: resolvedLabels.saveOnlyLabel }),
|
|
109
|
+
/* @__PURE__ */ jsx(
|
|
110
|
+
Button,
|
|
111
|
+
{
|
|
112
|
+
variant: "primary",
|
|
113
|
+
className: "flex-1",
|
|
114
|
+
onClick: handleSendNotification,
|
|
115
|
+
disabled: sending,
|
|
116
|
+
loading: sending,
|
|
117
|
+
icon: "send",
|
|
118
|
+
children: sending ? resolvedLabels.sendingLabel : resolvedLabels.sendLabel
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
] })
|
|
122
|
+
] })
|
|
123
|
+
] }) })
|
|
124
|
+
] });
|
|
125
|
+
}
|
|
126
|
+
export {
|
|
127
|
+
ChangeSummaryModal
|
|
128
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
type FollowChannel = "line" | "web_push";
|
|
2
|
+
interface ChannelBadgeProps {
|
|
3
|
+
channel: FollowChannel;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
declare function ChannelBadge({ channel, className }: ChannelBadgeProps): React.ReactNode;
|
|
7
|
+
|
|
8
|
+
export { ChannelBadge, type FollowChannel };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./chunk-ORMEWXMH.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
const channelConfig = {
|
|
5
|
+
line: { label: "LINE", icon: "chat", cls: "bg-green-100 text-green-700" },
|
|
6
|
+
web_push: { label: "Push", icon: "notifications_active", cls: "bg-blue-100 text-blue-700" }
|
|
7
|
+
};
|
|
8
|
+
function ChannelBadge({ channel, className = "" }) {
|
|
9
|
+
const c = channelConfig[channel];
|
|
10
|
+
return /* @__PURE__ */ jsxs("span", { className: `inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-[10px] font-semibold ${c.cls} ${className}`, children: [
|
|
11
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", className: "material-symbols-outlined text-xs", children: c.icon }),
|
|
12
|
+
c.label
|
|
13
|
+
] });
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
ChannelBadge
|
|
17
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
interface CheckboxProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
description?: string;
|
|
4
|
+
checked: boolean;
|
|
5
|
+
onChange: (checked: boolean) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
error?: string;
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
name?: string;
|
|
10
|
+
}
|
|
11
|
+
declare function Checkbox({ label, description, checked, onChange, disabled, error, indeterminate, name, }: CheckboxProps): React.ReactNode;
|
|
12
|
+
interface CheckboxGroupOption {
|
|
13
|
+
value: string;
|
|
14
|
+
label: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
}
|
|
17
|
+
interface CheckboxGroupProps {
|
|
18
|
+
label?: string;
|
|
19
|
+
options: CheckboxGroupOption[];
|
|
20
|
+
value: string[];
|
|
21
|
+
onChange: (value: string[]) => void;
|
|
22
|
+
error?: string;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
name?: string;
|
|
25
|
+
}
|
|
26
|
+
declare function CheckboxGroup({ label, options, value, onChange, error, required, name, }: CheckboxGroupProps): React.ReactNode;
|
|
27
|
+
|
|
28
|
+
export { Checkbox, CheckboxGroup };
|
package/dist/checkbox.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import "./chunk-ORMEWXMH.js";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useRef, useEffect } from "react";
|
|
5
|
+
function Checkbox({
|
|
6
|
+
label,
|
|
7
|
+
description,
|
|
8
|
+
checked,
|
|
9
|
+
onChange,
|
|
10
|
+
disabled = false,
|
|
11
|
+
error,
|
|
12
|
+
indeterminate = false,
|
|
13
|
+
name
|
|
14
|
+
}) {
|
|
15
|
+
const inputRef = useRef(null);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (inputRef.current) {
|
|
18
|
+
inputRef.current.indeterminate = indeterminate && !checked;
|
|
19
|
+
}
|
|
20
|
+
}, [indeterminate, checked]);
|
|
21
|
+
const isActive = checked || indeterminate;
|
|
22
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
23
|
+
/* @__PURE__ */ jsxs(
|
|
24
|
+
"label",
|
|
25
|
+
{
|
|
26
|
+
className: `flex items-start gap-3 ${disabled ? "cursor-not-allowed opacity-40" : "cursor-pointer"}`,
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("span", { className: "relative shrink-0 mt-0.5", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(
|
|
30
|
+
"input",
|
|
31
|
+
{
|
|
32
|
+
ref: inputRef,
|
|
33
|
+
type: "checkbox",
|
|
34
|
+
name,
|
|
35
|
+
checked,
|
|
36
|
+
onChange: (e) => !disabled && onChange(e.target.checked),
|
|
37
|
+
disabled,
|
|
38
|
+
className: "sr-only peer"
|
|
39
|
+
}
|
|
40
|
+
),
|
|
41
|
+
/* @__PURE__ */ jsxs(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
className: `flex items-center justify-center w-5 h-5 rounded-md border-2 transition-all
|
|
45
|
+
peer-focus-visible:ring-2 peer-focus-visible:ring-primary/20
|
|
46
|
+
${isActive ? "bg-primary border-primary" : "bg-white border-outline-variant hover:border-primary/60"}`,
|
|
47
|
+
children: [
|
|
48
|
+
checked && !indeterminate && /* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-white text-sm leading-none", style: { fontSize: "14px" }, children: "check" }),
|
|
49
|
+
indeterminate && !checked && /* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-white text-sm leading-none", style: { fontSize: "14px" }, children: "remove" })
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] }),
|
|
54
|
+
(label || description) && /* @__PURE__ */ jsxs("span", { className: "flex flex-col gap-0.5", children: [
|
|
55
|
+
label && /* @__PURE__ */ jsx("span", { className: "text-sm font-medium text-on-surface leading-snug", children: label }),
|
|
56
|
+
description && /* @__PURE__ */ jsx("span", { className: "text-xs text-on-surface-variant leading-snug", children: description })
|
|
57
|
+
] })
|
|
58
|
+
]
|
|
59
|
+
}
|
|
60
|
+
),
|
|
61
|
+
error && /* @__PURE__ */ jsxs("p", { className: "text-xs text-red-500 flex items-center gap-1 pl-8", children: [
|
|
62
|
+
/* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-sm", children: "error" }),
|
|
63
|
+
error
|
|
64
|
+
] })
|
|
65
|
+
] });
|
|
66
|
+
}
|
|
67
|
+
function CheckboxGroup({
|
|
68
|
+
label,
|
|
69
|
+
options,
|
|
70
|
+
value,
|
|
71
|
+
onChange,
|
|
72
|
+
error,
|
|
73
|
+
required,
|
|
74
|
+
name
|
|
75
|
+
}) {
|
|
76
|
+
function toggle(optValue) {
|
|
77
|
+
if (value.includes(optValue)) {
|
|
78
|
+
onChange(value.filter((v) => v !== optValue));
|
|
79
|
+
} else {
|
|
80
|
+
onChange([...value, optValue]);
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
84
|
+
label && /* @__PURE__ */ jsxs("span", { className: "text-xs font-bold text-on-surface-variant uppercase tracking-widest px-1", children: [
|
|
85
|
+
label,
|
|
86
|
+
required && /* @__PURE__ */ jsx("span", { className: "text-red-500 ml-0.5", children: "*" })
|
|
87
|
+
] }),
|
|
88
|
+
/* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: options.map((opt) => /* @__PURE__ */ jsx(
|
|
89
|
+
Checkbox,
|
|
90
|
+
{
|
|
91
|
+
name,
|
|
92
|
+
label: opt.label,
|
|
93
|
+
description: opt.description,
|
|
94
|
+
checked: value.includes(opt.value),
|
|
95
|
+
onChange: () => toggle(opt.value)
|
|
96
|
+
},
|
|
97
|
+
opt.value
|
|
98
|
+
)) }),
|
|
99
|
+
error && /* @__PURE__ */ jsxs("p", { className: "text-xs text-red-500 flex items-center gap-1 px-1", children: [
|
|
100
|
+
/* @__PURE__ */ jsx("span", { className: "material-symbols-outlined text-sm", children: "error" }),
|
|
101
|
+
error
|
|
102
|
+
] })
|
|
103
|
+
] });
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
Checkbox,
|
|
107
|
+
CheckboxGroup
|
|
108
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export {
|
|
34
|
+
__spreadValues,
|
|
35
|
+
__spreadProps,
|
|
36
|
+
__objRest
|
|
37
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface ColorPickerProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
value: string;
|
|
4
|
+
onChange: (hex: string) => void;
|
|
5
|
+
presets?: string[];
|
|
6
|
+
showHexInput?: boolean;
|
|
7
|
+
showPalette?: boolean;
|
|
8
|
+
error?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
hexErrorText?: string;
|
|
11
|
+
paletteLabel?: string;
|
|
12
|
+
}
|
|
13
|
+
declare function ColorPicker({ label, value, onChange, presets, showHexInput, showPalette, error, required, hexErrorText, paletteLabel, }: ColorPickerProps): React.ReactNode;
|
|
14
|
+
|
|
15
|
+
export { ColorPicker };
|