@giddaa-housing/ui 2.0.0 → 2.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.
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { t as cn } from "./cn-BI_4DMBf.js";
3
3
  import { Popover, PopoverContent } from "./popover.js";
4
- import { n as PickerTrigger, t as PickerFooter } from "./picker-lzgmsNfG.js";
4
+ import { n as PickerFooter, r as PickerTrigger, t as PICKER_COLLISION_AVOIDANCE } from "./picker-xSTzeYhc.js";
5
5
  import { ClockIcon } from "lucide-react";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  import * as React from "react";
@@ -132,7 +132,7 @@ function TimeColumn({ label, items, value, onChange }) {
132
132
  role: "listbox",
133
133
  "aria-label": label,
134
134
  style: { height: `${VISIBLE_COUNT * ITEM_HEIGHT}px` },
135
- className: "relative snap-y snap-mandatory overflow-y-scroll overscroll-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",
135
+ className: "relative snap-y snap-mandatory overflow-y-scroll overscroll-contain scrollbar-none [&::-webkit-scrollbar]:hidden",
136
136
  children: /* @__PURE__ */ jsx("div", {
137
137
  style: {
138
138
  paddingTop: `${SCROLL_PADDING}px`,
@@ -161,7 +161,7 @@ function TimeColumn({ label, items, value, onChange }) {
161
161
  })]
162
162
  });
163
163
  }
164
- function TimePicker({ value, onChange, format = "12h", disabled = false, placeholder = "Select time", className }) {
164
+ function TimePicker({ value, onChange, format = "12h", disabled = false, size, placeholder = "Select time", className }) {
165
165
  const [open, setOpen] = React.useState(false);
166
166
  const [pending, setPending] = React.useState(() => parseTimeString(value, format));
167
167
  function handleOpenChange(next) {
@@ -191,11 +191,14 @@ function TimePicker({ value, onChange, format = "12h", disabled = false, placeho
191
191
  placeholder,
192
192
  disabled,
193
193
  open,
194
+ size,
194
195
  className
195
196
  }), /* @__PURE__ */ jsxs(PopoverContent, {
196
197
  showArrow: false,
197
- align: "start",
198
- className: "min-w-(--anchor-width) gap-0 overflow-hidden rounded-2xl p-0",
198
+ align: "center",
199
+ side: "bottom",
200
+ collisionAvoidance: PICKER_COLLISION_AVOIDANCE,
201
+ className: "min-w-(--anchor-width) gap-0 overflow-hidden rounded-2xl p-0 border border-line-subtle",
199
202
  children: [
200
203
  /* @__PURE__ */ jsx("div", {
201
204
  className: "flex w-full items-center justify-center gap-2 border-b border-line-subtle",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@giddaa-housing/ui",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "Giddaa reusable UI component library.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -161,6 +161,10 @@
161
161
  "types": "./dist/infotip.d.ts",
162
162
  "import": "./dist/infotip.js"
163
163
  },
164
+ "./infinite-scroll": {
165
+ "types": "./dist/infinite-scroll.d.ts",
166
+ "import": "./dist/infinite-scroll.js"
167
+ },
164
168
  "./input": {
165
169
  "types": "./dist/input.d.ts",
166
170
  "import": "./dist/input.js"
@@ -383,6 +387,7 @@
383
387
  },
384
388
  "dependencies": {
385
389
  "@base-ui/react": "^1.5.0",
390
+ "@tanstack/react-virtual": "^3.14.7",
386
391
  "@tiptap/extension-color": "^3.22.5",
387
392
  "@tiptap/extension-image": "^3.22.5",
388
393
  "@tiptap/extension-placeholder": "^3.22.5",
@@ -1,32 +0,0 @@
1
- import { t as cn } from "./cn-BI_4DMBf.js";
2
- import { Button } from "./button.js";
3
- import { PopoverTrigger } from "./popover.js";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
- //#region src/lib/picker.tsx
6
- function PickerTrigger({ icon: Icon, displayValue, placeholder, disabled, open, className }) {
7
- return /* @__PURE__ */ jsxs(PopoverTrigger, {
8
- disabled,
9
- className: cn("flex h-10 w-full items-center justify-between rounded-full border px-3.5 text-gdt-sm transition-[border-color,box-shadow] outline-none", disabled ? "cursor-not-allowed border-line-subtle bg-surface text-fg-caption-placeholder" : open ? "border-line-focus bg-canvas text-fg-primary inset-ring-1 inset-ring-line-focus" : "border-line bg-canvas text-fg-primary hover:border-line-strong", className),
10
- children: [/* @__PURE__ */ jsx("span", {
11
- className: cn("min-w-0 truncate", !displayValue && "text-fg-caption-placeholder"),
12
- children: displayValue || placeholder
13
- }), /* @__PURE__ */ jsx(Icon, { className: cn("ml-2 size-4 shrink-0", disabled ? "text-fg-caption-placeholder" : "text-fg-secondary") })]
14
- });
15
- }
16
- function PickerFooter({ secondaryLabel, onSecondary, onApply }) {
17
- return /* @__PURE__ */ jsxs("div", {
18
- className: "flex w-full items-center justify-between border-t border-line-subtle px-4 py-3",
19
- children: [/* @__PURE__ */ jsx(Button, {
20
- variant: "tertiary-outline",
21
- size: "sm",
22
- onClick: onSecondary,
23
- children: secondaryLabel
24
- }), /* @__PURE__ */ jsx(Button, {
25
- size: "sm",
26
- onClick: onApply,
27
- children: "Apply"
28
- })]
29
- });
30
- }
31
- //#endregion
32
- export { PickerTrigger as n, PickerFooter as t };