@pichetch08/trip-ui 0.2.6 → 0.2.8
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.
|
@@ -8,7 +8,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
import { forwardRef } from "react";
|
|
9
9
|
import { Spinner } from "./spinner";
|
|
10
10
|
const VARIANT = {
|
|
11
|
-
primary: "bg-primary text-on-primary hover:[filter:brightness(0.88)] shadow-sm hover:shadow-md active:scale-[0.98]",
|
|
11
|
+
primary: "bg-primary text-(--on-primary) hover:[filter:brightness(0.88)] shadow-sm hover:shadow-md active:scale-[0.98]",
|
|
12
12
|
secondary: "bg-surface-container text-on-surface hover:bg-surface-container-high active:scale-[0.98]",
|
|
13
13
|
outline: "bg-transparent border border-outline-variant text-on-surface hover:bg-surface-container-low hover:border-outline active:scale-[0.98]",
|
|
14
14
|
ghost: "bg-transparent text-on-surface-variant hover:bg-surface-container hover:text-on-surface active:scale-[0.98]",
|
|
@@ -300,7 +300,7 @@ function DateRangePicker({
|
|
|
300
300
|
setLeftMonth({ year: d.getFullYear(), month: d.getMonth() });
|
|
301
301
|
}
|
|
302
302
|
const triggerId = label ? `daterange-${label.replace(/\s+/g, "-").toLowerCase()}` : void 0;
|
|
303
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
303
|
+
return /* @__PURE__ */ jsxs("div", { className: `flex flex-col gap-2 ${size === "sm" ? "min-w-[200px]" : ""}`, ref: containerRef, children: [
|
|
304
304
|
nameStart && /* @__PURE__ */ jsx("input", { type: "hidden", name: nameStart, value: startDate }),
|
|
305
305
|
nameEnd && /* @__PURE__ */ jsx("input", { type: "hidden", name: nameEnd, value: endDate }),
|
|
306
306
|
label && /* @__PURE__ */ jsxs("label", { htmlFor: triggerId, className: "text-xs font-bold text-on-surface-variant uppercase tracking-widest px-1", children: [
|
|
@@ -317,10 +317,10 @@ function DateRangePicker({
|
|
|
317
317
|
"aria-haspopup": "dialog",
|
|
318
318
|
"aria-required": required,
|
|
319
319
|
onClick: handleOpen,
|
|
320
|
-
className: `relative w-full bg-surface-container-low border rounded-xl text-left transition-all font-medium outline-none active:scale-[0.99] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 ${size === "sm" ? "h-10 pl-8 pr-
|
|
320
|
+
className: `relative w-full bg-surface-container-low border rounded-xl text-left transition-all font-medium outline-none active:scale-[0.99] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/30 overflow-hidden ${size === "sm" ? "h-10 pl-8 pr-9 text-sm" : "py-4 pl-12 pr-10"} ${open ? "bg-surface ring-2 ring-primary/20 border-primary" : error ? "border-red-400 bg-red-50/30" : "border-transparent hover:border-outline-variant"}`,
|
|
321
321
|
children: [
|
|
322
322
|
/* @__PURE__ */ jsx("span", { className: `material-symbols-outlined absolute top-1/2 -translate-y-1/2 text-on-surface-variant ${size === "sm" ? "left-2.5 text-base" : "left-4"}`, children: icon }),
|
|
323
|
-
displayText ? /* @__PURE__ */ jsx("span", { className: "text-on-surface text-sm", children: displayText }) : /* @__PURE__ */ jsxs("span", { className: "text-outline/40 text-sm", children: [
|
|
323
|
+
displayText ? /* @__PURE__ */ jsx("span", { className: "text-on-surface text-sm truncate block", children: displayText }) : /* @__PURE__ */ jsxs("span", { className: "text-outline/40 text-sm truncate block", children: [
|
|
324
324
|
placeholder.start,
|
|
325
325
|
" \u2192 ",
|
|
326
326
|
placeholder.end
|