@geomak/ui 7.1.0 → 7.2.1
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/dist/index.cjs +552 -306
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +157 -1
- package/dist/index.d.ts +157 -1
- package/dist/index.js +267 -26
- package/dist/index.js.map +1 -1
- package/dist/styles.css +41 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { icons_default as Icon, createIcon } from './chunk-KAFJJO5O.js';
|
|
2
2
|
import { colors_default } from './chunk-I2P4JJDB.js';
|
|
3
3
|
export { colors_default as COLORS, PALETTE as palette, semanticTokens, vars } from './chunk-I2P4JJDB.js';
|
|
4
|
-
import
|
|
4
|
+
import React29, { createContext, useState, useEffect, useMemo, useId, useCallback, useRef, useContext, useSyncExternalStore, useLayoutEffect } from 'react';
|
|
5
5
|
import { createPortal } from 'react-dom';
|
|
6
6
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
7
7
|
import * as AvatarPrimitive from '@radix-ui/react-avatar';
|
|
@@ -16,8 +16,8 @@ import * as ToggleGroup from '@radix-ui/react-toggle-group';
|
|
|
16
16
|
import * as ContextMenuPrimitive from '@radix-ui/react-context-menu';
|
|
17
17
|
import * as SwitchPrimitive from '@radix-ui/react-switch';
|
|
18
18
|
import * as NavigationMenu from '@radix-ui/react-navigation-menu';
|
|
19
|
-
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
20
19
|
import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
|
|
20
|
+
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
21
21
|
import * as SliderPrimitive from '@radix-ui/react-slider';
|
|
22
22
|
|
|
23
23
|
// src/utils/cx.ts
|
|
@@ -555,7 +555,7 @@ var SIZE_CLASSES = {
|
|
|
555
555
|
md: "h-9 px-4 text-sm gap-1.5 rounded-lg",
|
|
556
556
|
lg: "h-11 px-5 text-sm gap-2 rounded-xl"
|
|
557
557
|
};
|
|
558
|
-
var Button =
|
|
558
|
+
var Button = React29.forwardRef(function Button2({
|
|
559
559
|
content,
|
|
560
560
|
variant = "primary",
|
|
561
561
|
size = "md",
|
|
@@ -663,7 +663,7 @@ function MenuButton({
|
|
|
663
663
|
"data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
|
|
664
664
|
"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95"
|
|
665
665
|
].join(" "),
|
|
666
|
-
children: items.map((item) => /* @__PURE__ */ jsxs(
|
|
666
|
+
children: items.map((item) => /* @__PURE__ */ jsxs(React29.Fragment, { children: [
|
|
667
667
|
item.separatorBefore && /* @__PURE__ */ jsx(DropdownMenu.Separator, { className: "my-1 h-px bg-border" }),
|
|
668
668
|
/* @__PURE__ */ jsxs(
|
|
669
669
|
DropdownMenu.Item,
|
|
@@ -1762,7 +1762,7 @@ function Kbd({
|
|
|
1762
1762
|
style
|
|
1763
1763
|
}) {
|
|
1764
1764
|
if (keys && keys.length > 0) {
|
|
1765
|
-
return /* @__PURE__ */ jsx("span", { className: cx("inline-flex items-center gap-1", className), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(
|
|
1765
|
+
return /* @__PURE__ */ jsx("span", { className: cx("inline-flex items-center gap-1", className), style, children: keys.map((k, i) => /* @__PURE__ */ jsxs(React29.Fragment, { children: [
|
|
1766
1766
|
i > 0 && /* @__PURE__ */ jsx("span", { className: "text-foreground-muted text-xs select-none", children: separator }),
|
|
1767
1767
|
/* @__PURE__ */ jsx("kbd", { className: [cap, SIZE3[size]].join(" "), children: k })
|
|
1768
1768
|
] }, `${k}-${i}`)) });
|
|
@@ -1854,7 +1854,7 @@ function FlatCarousel({
|
|
|
1854
1854
|
style
|
|
1855
1855
|
}) {
|
|
1856
1856
|
const scrollerRef = useRef(null);
|
|
1857
|
-
const slides =
|
|
1857
|
+
const slides = React29.Children.toArray(children);
|
|
1858
1858
|
const [active, setActive] = useState(0);
|
|
1859
1859
|
const [atStart, setAtStart] = useState(true);
|
|
1860
1860
|
const [atEnd, setAtEnd] = useState(false);
|
|
@@ -1909,7 +1909,7 @@ function RotatingCarousel({
|
|
|
1909
1909
|
className = "",
|
|
1910
1910
|
style
|
|
1911
1911
|
}) {
|
|
1912
|
-
const slides =
|
|
1912
|
+
const slides = React29.Children.toArray(children);
|
|
1913
1913
|
const count = slides.length;
|
|
1914
1914
|
const [active, setActive] = useState(0);
|
|
1915
1915
|
const reduced = useReducedMotion();
|
|
@@ -5131,7 +5131,7 @@ function Wizard({
|
|
|
5131
5131
|
] });
|
|
5132
5132
|
}
|
|
5133
5133
|
var SearchIcon = /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", className: "w-4 h-4", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", d: "M10.5 3.75a6.75 6.75 0 100 13.5 6.75 6.75 0 000-13.5zM2.25 10.5a8.25 8.25 0 1114.59 5.28l4.69 4.69a.75.75 0 11-1.06 1.06l-4.69-4.69A8.25 8.25 0 012.25 10.5z", clipRule: "evenodd" }) });
|
|
5134
|
-
var SearchInput =
|
|
5134
|
+
var SearchInput = React29.forwardRef(function SearchInput2({ value, onChange, disabled, label, htmlFor, placeholder, name, inputStyle, style, layout = "vertical", size = "md", icon, helperText, className }, ref) {
|
|
5135
5135
|
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, layout, helperText, children: /* @__PURE__ */ jsxs(
|
|
5136
5136
|
"div",
|
|
5137
5137
|
{
|
|
@@ -5379,6 +5379,7 @@ function EditableCell({
|
|
|
5379
5379
|
"input",
|
|
5380
5380
|
{
|
|
5381
5381
|
autoFocus: true,
|
|
5382
|
+
size: 1,
|
|
5382
5383
|
defaultValue: value == null ? "" : String(value),
|
|
5383
5384
|
onBlur: (e) => commit(e.target.value),
|
|
5384
5385
|
onKeyDown: (e) => {
|
|
@@ -5391,7 +5392,7 @@ function EditableCell({
|
|
|
5391
5392
|
}
|
|
5392
5393
|
},
|
|
5393
5394
|
"aria-label": `Edit ${typeof col.label === "string" ? col.label : col.keyBind}`,
|
|
5394
|
-
className: "w-full rounded border border-accent bg-surface px-2 py-1 text-sm text-foreground outline-none"
|
|
5395
|
+
className: "box-border w-full min-w-0 rounded border border-accent bg-surface px-2 py-1 text-sm text-foreground outline-none"
|
|
5395
5396
|
}
|
|
5396
5397
|
);
|
|
5397
5398
|
}
|
|
@@ -5428,7 +5429,7 @@ function TableBody({
|
|
|
5428
5429
|
return /* @__PURE__ */ jsx("tbody", { children: rows.map((row, i) => {
|
|
5429
5430
|
const rowKey = getRowKey(row, i);
|
|
5430
5431
|
const isExpanded = expanded.has(rowKey);
|
|
5431
|
-
return /* @__PURE__ */ jsxs(
|
|
5432
|
+
return /* @__PURE__ */ jsxs(React29.Fragment, { children: [
|
|
5432
5433
|
/* @__PURE__ */ jsxs(
|
|
5433
5434
|
"tr",
|
|
5434
5435
|
{
|
|
@@ -5441,7 +5442,7 @@ function TableBody({
|
|
|
5441
5442
|
onClick: () => toggleRow(rowKey),
|
|
5442
5443
|
"aria-expanded": isExpanded,
|
|
5443
5444
|
"aria-label": isExpanded ? "Collapse row" : "Expand row",
|
|
5444
|
-
className: `w-9 h-9 inline-flex items-center justify-center rounded-md hover:
|
|
5445
|
+
className: `w-9 h-9 inline-flex items-center justify-center rounded-md text-foreground-muted hover:text-foreground transition-[transform,color] duration-200 focus:outline-none focus-visible:ring-2 focus-visible:ring-accent ${isExpanded && !expandRow.collapseIcon ? "rotate-180" : ""}`,
|
|
5445
5446
|
children: isExpanded ? expandRow.collapseIcon ?? expandRow.expandIcon ?? DefaultExpandIcon : expandRow.expandIcon ?? DefaultExpandIcon
|
|
5446
5447
|
}
|
|
5447
5448
|
) }),
|
|
@@ -5499,7 +5500,7 @@ function Pagination({
|
|
|
5499
5500
|
const chevronRight = /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M9 6l6 6-6 6" }) });
|
|
5500
5501
|
const doubleChevronRight = /* @__PURE__ */ jsx("svg", { "aria-hidden": "true", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, className: "h-4 w-4", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 6l6 6-6 6M12 6l6 6-6 6" }) });
|
|
5501
5502
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center justify-end gap-x-4 gap-y-3", children: [
|
|
5502
|
-
options.withPicker && /* @__PURE__ */ jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
|
|
5503
|
+
options.withPicker !== false && /* @__PURE__ */ jsxs("div", { className: "mr-auto flex items-center gap-2", children: [
|
|
5503
5504
|
/* @__PURE__ */ jsx("span", { className: "whitespace-nowrap text-xs text-foreground-muted", children: "Rows per page" }),
|
|
5504
5505
|
/* @__PURE__ */ jsx(
|
|
5505
5506
|
MenuButton,
|
|
@@ -5715,6 +5716,84 @@ function TableSkeletonBody({
|
|
|
5715
5716
|
i
|
|
5716
5717
|
)) });
|
|
5717
5718
|
}
|
|
5719
|
+
var useIsoLayoutEffect = typeof window !== "undefined" ? useLayoutEffect : useEffect;
|
|
5720
|
+
function VirtualList({
|
|
5721
|
+
items,
|
|
5722
|
+
rowHeight,
|
|
5723
|
+
renderItem: renderItem2,
|
|
5724
|
+
height = 400,
|
|
5725
|
+
getKey,
|
|
5726
|
+
overscan = 6,
|
|
5727
|
+
searchable = false,
|
|
5728
|
+
searchKeys,
|
|
5729
|
+
filter,
|
|
5730
|
+
searchPlaceholder = "Search\u2026",
|
|
5731
|
+
emptyState = "No results",
|
|
5732
|
+
"aria-label": ariaLabel = "List",
|
|
5733
|
+
className = "",
|
|
5734
|
+
style
|
|
5735
|
+
}) {
|
|
5736
|
+
const scrollRef = useRef(null);
|
|
5737
|
+
const [scrollTop, setScrollTop] = useState(0);
|
|
5738
|
+
const [viewport, setViewport] = useState(typeof height === "number" ? height : 400);
|
|
5739
|
+
const [term, setTerm] = useState("");
|
|
5740
|
+
useIsoLayoutEffect(() => {
|
|
5741
|
+
const el = scrollRef.current;
|
|
5742
|
+
if (!el) return;
|
|
5743
|
+
const measure = () => setViewport(el.clientHeight);
|
|
5744
|
+
measure();
|
|
5745
|
+
if (typeof ResizeObserver === "undefined") return;
|
|
5746
|
+
const ro = new ResizeObserver(measure);
|
|
5747
|
+
ro.observe(el);
|
|
5748
|
+
return () => ro.disconnect();
|
|
5749
|
+
}, []);
|
|
5750
|
+
const filtered = useMemo(() => {
|
|
5751
|
+
if (!searchable || !term) return items;
|
|
5752
|
+
if (filter) return items.filter((it) => filter(it, term));
|
|
5753
|
+
const needle = term.toLowerCase();
|
|
5754
|
+
return items.filter((it) => {
|
|
5755
|
+
if (searchKeys) return searchKeys.some((k) => String(it[k] ?? "").toLowerCase().includes(needle));
|
|
5756
|
+
return String(it).toLowerCase().includes(needle);
|
|
5757
|
+
});
|
|
5758
|
+
}, [items, searchable, term, filter, searchKeys]);
|
|
5759
|
+
const total = filtered.length * rowHeight;
|
|
5760
|
+
const startIndex = Math.max(0, Math.floor(scrollTop / rowHeight) - overscan);
|
|
5761
|
+
const endIndex = Math.min(filtered.length, Math.ceil((scrollTop + viewport) / rowHeight) + overscan);
|
|
5762
|
+
const offsetY = startIndex * rowHeight;
|
|
5763
|
+
const visible = filtered.slice(startIndex, endIndex);
|
|
5764
|
+
const onSearch = (e) => {
|
|
5765
|
+
setTerm(e.target.value);
|
|
5766
|
+
setScrollTop(0);
|
|
5767
|
+
if (scrollRef.current) scrollRef.current.scrollTop = 0;
|
|
5768
|
+
};
|
|
5769
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("flex w-full flex-col gap-2", className), style, children: [
|
|
5770
|
+
searchable && /* @__PURE__ */ jsx(SearchInput_default, { value: term, onChange: onSearch, placeholder: searchPlaceholder }),
|
|
5771
|
+
/* @__PURE__ */ jsx(
|
|
5772
|
+
"div",
|
|
5773
|
+
{
|
|
5774
|
+
ref: scrollRef,
|
|
5775
|
+
onScroll: (e) => setScrollTop(e.currentTarget.scrollTop),
|
|
5776
|
+
role: "list",
|
|
5777
|
+
"aria-label": ariaLabel,
|
|
5778
|
+
className: "relative overflow-y-auto rounded-lg border border-border bg-surface",
|
|
5779
|
+
style: { height },
|
|
5780
|
+
children: filtered.length === 0 ? /* @__PURE__ */ jsx("div", { className: "flex h-full items-center justify-center p-6 text-sm text-foreground-muted", children: emptyState }) : /* @__PURE__ */ jsx("div", { style: { height: total, position: "relative" }, children: /* @__PURE__ */ jsx("div", { style: { transform: `translateY(${offsetY}px)` }, children: visible.map((item, i) => {
|
|
5781
|
+
const index = startIndex + i;
|
|
5782
|
+
return /* @__PURE__ */ jsx(
|
|
5783
|
+
"div",
|
|
5784
|
+
{
|
|
5785
|
+
role: "listitem",
|
|
5786
|
+
style: { height: rowHeight },
|
|
5787
|
+
className: "box-border",
|
|
5788
|
+
children: renderItem2(item, index)
|
|
5789
|
+
},
|
|
5790
|
+
getKey ? getKey(item, index) : index
|
|
5791
|
+
);
|
|
5792
|
+
}) }) })
|
|
5793
|
+
}
|
|
5794
|
+
)
|
|
5795
|
+
] });
|
|
5796
|
+
}
|
|
5718
5797
|
function ThemeSwitch({ checked, onChange, label = "Toggle dark mode", className = "" }) {
|
|
5719
5798
|
const id = useId();
|
|
5720
5799
|
return /* @__PURE__ */ jsx("label", { htmlFor: id, className: `flex items-center gap-2 cursor-pointer select-none ${className}`.trim(), children: /* @__PURE__ */ jsx(
|
|
@@ -6016,8 +6095,8 @@ function MegaMenuLink({ href, icon, description, active, onClick, children, clas
|
|
|
6016
6095
|
function MegaMenuFeatured({ children, className = "" }) {
|
|
6017
6096
|
return /* @__PURE__ */ jsx("div", { className: cx("min-w-0 rounded-lg bg-surface-raised border border-border p-4 flex flex-col", className), children });
|
|
6018
6097
|
}
|
|
6019
|
-
var elementsOfType = (children, type) =>
|
|
6020
|
-
(c) =>
|
|
6098
|
+
var elementsOfType = (children, type) => React29.Children.toArray(children).filter(
|
|
6099
|
+
(c) => React29.isValidElement(c) && c.type === type
|
|
6021
6100
|
);
|
|
6022
6101
|
var MOBILE_CHEVRON = /* @__PURE__ */ jsx(
|
|
6023
6102
|
"svg",
|
|
@@ -6054,9 +6133,9 @@ function MobileLinkRow({ link, onNavigate }) {
|
|
|
6054
6133
|
);
|
|
6055
6134
|
}
|
|
6056
6135
|
function MobilePanel({ panel, onNavigate }) {
|
|
6057
|
-
const nodes =
|
|
6136
|
+
const nodes = React29.Children.toArray(panel.props.children);
|
|
6058
6137
|
return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 px-2 pb-3 pt-1", children: nodes.map((node, i) => {
|
|
6059
|
-
if (!
|
|
6138
|
+
if (!React29.isValidElement(node)) return null;
|
|
6060
6139
|
const el = node;
|
|
6061
6140
|
if (el.type === MegaMenuSection) {
|
|
6062
6141
|
const { title, children } = el.props;
|
|
@@ -6465,7 +6544,7 @@ function ThemeProvider({
|
|
|
6465
6544
|
className = "",
|
|
6466
6545
|
style
|
|
6467
6546
|
}) {
|
|
6468
|
-
const id =
|
|
6547
|
+
const id = React29.useId().replace(/:/g, "");
|
|
6469
6548
|
const scopeClass = `geo-th-${id}`;
|
|
6470
6549
|
const divRef = useRef(null);
|
|
6471
6550
|
useEffect(() => {
|
|
@@ -6712,6 +6791,168 @@ function Password({
|
|
|
6712
6791
|
}
|
|
6713
6792
|
);
|
|
6714
6793
|
}
|
|
6794
|
+
var defaultPasswordRules = [
|
|
6795
|
+
{ label: "At least 8 characters", test: (p) => p.length >= 8 },
|
|
6796
|
+
{ label: "A lowercase letter", test: (p) => /[a-z]/.test(p) },
|
|
6797
|
+
{ label: "An uppercase letter", test: (p) => /[A-Z]/.test(p) },
|
|
6798
|
+
{ label: "A number", test: (p) => /\d/.test(p) },
|
|
6799
|
+
{ label: "A symbol", test: (p) => /[^A-Za-z0-9]/.test(p) }
|
|
6800
|
+
];
|
|
6801
|
+
var LABELS = ["", "Weak", "Fair", "Good", "Strong"];
|
|
6802
|
+
function scorePassword(password) {
|
|
6803
|
+
if (!password) return { score: 0, label: "" };
|
|
6804
|
+
let s = 0;
|
|
6805
|
+
if (password.length >= 8) s++;
|
|
6806
|
+
if (/[a-z]/.test(password) && /[A-Z]/.test(password)) s++;
|
|
6807
|
+
if (/\d/.test(password)) s++;
|
|
6808
|
+
if (/[^A-Za-z0-9]/.test(password)) s++;
|
|
6809
|
+
if (password.length >= 12) s++;
|
|
6810
|
+
const lowEntropy = /^(.)\1+$/.test(password) || /^(?:0123456789|abcdefghijklmnopqrstuvwxyz|qwertyuiop)/i.test(password);
|
|
6811
|
+
if (lowEntropy) s = Math.min(s, 1);
|
|
6812
|
+
const score = Math.max(1, Math.min(4, s));
|
|
6813
|
+
return { score, label: LABELS[score] };
|
|
6814
|
+
}
|
|
6815
|
+
var BAR_COLOR = {
|
|
6816
|
+
0: "bg-border",
|
|
6817
|
+
1: "bg-status-error",
|
|
6818
|
+
2: "bg-status-warning",
|
|
6819
|
+
3: "bg-accent",
|
|
6820
|
+
4: "bg-status-success"
|
|
6821
|
+
};
|
|
6822
|
+
var TEXT_COLOR = {
|
|
6823
|
+
0: "text-foreground-muted",
|
|
6824
|
+
1: "text-status-error",
|
|
6825
|
+
2: "text-status-warning",
|
|
6826
|
+
3: "text-accent",
|
|
6827
|
+
4: "text-status-success"
|
|
6828
|
+
};
|
|
6829
|
+
var Tick = ({ ok }) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 20 20", "aria-hidden": "true", className: cx("h-3.5 w-3.5 shrink-0", ok ? "text-status-success" : "text-foreground-muted"), children: ok ? /* @__PURE__ */ jsx("path", { fill: "currentColor", fillRule: "evenodd", clipRule: "evenodd", d: "M10 2a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm3.7 6.3a1 1 0 0 0-1.4-1.4L9 10.18 7.7 8.88a1 1 0 0 0-1.4 1.42l2 2a1 1 0 0 0 1.4 0l4-4Z" }) : /* @__PURE__ */ jsx("circle", { cx: "10", cy: "10", r: "2.5", fill: "currentColor" }) });
|
|
6830
|
+
function PasswordStrength({
|
|
6831
|
+
value,
|
|
6832
|
+
scorer = scorePassword,
|
|
6833
|
+
showRequirements = false,
|
|
6834
|
+
rules = defaultPasswordRules,
|
|
6835
|
+
confirmValue,
|
|
6836
|
+
hideMeter = false,
|
|
6837
|
+
className = "",
|
|
6838
|
+
style
|
|
6839
|
+
}) {
|
|
6840
|
+
const { score, label } = useMemo(() => scorer(value), [scorer, value]);
|
|
6841
|
+
const showMatch = confirmValue != null && (value.length > 0 || confirmValue.length > 0);
|
|
6842
|
+
const matches = value.length > 0 && value === confirmValue;
|
|
6843
|
+
return /* @__PURE__ */ jsxs("div", { className: cx("flex flex-col gap-2", className), style, "aria-live": "polite", children: [
|
|
6844
|
+
!hideMeter && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
6845
|
+
/* @__PURE__ */ jsx("div", { className: "flex gap-1", role: "meter", "aria-valuemin": 0, "aria-valuemax": 4, "aria-valuenow": score, "aria-label": "Password strength", children: [1, 2, 3, 4].map((seg) => {
|
|
6846
|
+
const active = seg <= score;
|
|
6847
|
+
return /* @__PURE__ */ jsx("div", { className: "h-1.5 flex-1 overflow-hidden rounded-full bg-border", children: /* @__PURE__ */ jsx(
|
|
6848
|
+
"div",
|
|
6849
|
+
{
|
|
6850
|
+
className: cx(
|
|
6851
|
+
"h-full origin-left rounded-full transition-[transform,background-color] duration-300 ease-out motion-reduce:transition-none",
|
|
6852
|
+
score > 0 ? BAR_COLOR[score] : "bg-border"
|
|
6853
|
+
),
|
|
6854
|
+
style: { transform: `scaleX(${active ? 1 : 0})`, transitionDelay: active ? `${(seg - 1) * 70}ms` : "0ms" }
|
|
6855
|
+
}
|
|
6856
|
+
) }, seg);
|
|
6857
|
+
}) }),
|
|
6858
|
+
label && /* @__PURE__ */ jsxs("p", { className: "text-xs", children: [
|
|
6859
|
+
/* @__PURE__ */ jsx("span", { className: "text-foreground-muted", children: "Strength: " }),
|
|
6860
|
+
/* @__PURE__ */ jsx("span", { className: cx("font-medium", TEXT_COLOR[score]), children: label })
|
|
6861
|
+
] })
|
|
6862
|
+
] }),
|
|
6863
|
+
showRequirements && /* @__PURE__ */ jsx("ul", { className: "mt-0.5 flex flex-col gap-1", children: rules.map((rule, i) => {
|
|
6864
|
+
const ok = rule.test(value);
|
|
6865
|
+
return /* @__PURE__ */ jsxs("li", { className: cx("flex items-center gap-1.5 text-xs", ok ? "text-foreground-secondary" : "text-foreground-muted"), children: [
|
|
6866
|
+
/* @__PURE__ */ jsx(Tick, { ok }),
|
|
6867
|
+
rule.label
|
|
6868
|
+
] }, i);
|
|
6869
|
+
}) }),
|
|
6870
|
+
showMatch && /* @__PURE__ */ jsxs("p", { className: cx("flex items-center gap-1.5 text-xs font-medium", matches ? "text-status-success" : "text-status-error"), children: [
|
|
6871
|
+
/* @__PURE__ */ jsx(Tick, { ok: matches }),
|
|
6872
|
+
matches ? "Passwords match" : "Passwords don\u2019t match"
|
|
6873
|
+
] })
|
|
6874
|
+
] });
|
|
6875
|
+
}
|
|
6876
|
+
var COLS = {
|
|
6877
|
+
1: "grid-cols-1",
|
|
6878
|
+
2: "grid-cols-1 sm:grid-cols-2",
|
|
6879
|
+
3: "grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
|
|
6880
|
+
};
|
|
6881
|
+
var PAD2 = { sm: "p-3", md: "p-4", lg: "p-5" };
|
|
6882
|
+
var TITLE = { sm: "text-sm", md: "text-sm", lg: "text-base" };
|
|
6883
|
+
var CheckMark = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", className: "h-5 w-5 text-accent", children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5Zm4.28 7.53a.75.75 0 0 0-1.06-1.06l-4.97 4.97-1.97-1.97a.75.75 0 1 0-1.06 1.06l2.5 2.5a.75.75 0 0 0 1.06 0l5.5-5.5Z" }) });
|
|
6884
|
+
function RadioTile({
|
|
6885
|
+
options,
|
|
6886
|
+
value,
|
|
6887
|
+
defaultValue,
|
|
6888
|
+
onChange,
|
|
6889
|
+
name,
|
|
6890
|
+
label,
|
|
6891
|
+
columns = 2,
|
|
6892
|
+
size = "md",
|
|
6893
|
+
disabled,
|
|
6894
|
+
required,
|
|
6895
|
+
helperText,
|
|
6896
|
+
errorMessage,
|
|
6897
|
+
className
|
|
6898
|
+
}) {
|
|
6899
|
+
const groupId = useId();
|
|
6900
|
+
const errorId = useId();
|
|
6901
|
+
const hasError = errorMessage != null;
|
|
6902
|
+
return /* @__PURE__ */ jsx(
|
|
6903
|
+
Field,
|
|
6904
|
+
{
|
|
6905
|
+
className,
|
|
6906
|
+
label,
|
|
6907
|
+
htmlFor: groupId,
|
|
6908
|
+
errorId,
|
|
6909
|
+
errorMessage,
|
|
6910
|
+
required,
|
|
6911
|
+
helperText,
|
|
6912
|
+
children: /* @__PURE__ */ jsx(
|
|
6913
|
+
RadioGroupPrimitive.Root,
|
|
6914
|
+
{
|
|
6915
|
+
id: groupId,
|
|
6916
|
+
name,
|
|
6917
|
+
value,
|
|
6918
|
+
defaultValue,
|
|
6919
|
+
onValueChange: onChange,
|
|
6920
|
+
disabled,
|
|
6921
|
+
required,
|
|
6922
|
+
"aria-invalid": hasError || void 0,
|
|
6923
|
+
"aria-describedby": hasError ? errorId : void 0,
|
|
6924
|
+
className: cx("grid gap-3", COLS[columns]),
|
|
6925
|
+
children: options.map((opt) => /* @__PURE__ */ jsxs(
|
|
6926
|
+
RadioGroupPrimitive.Item,
|
|
6927
|
+
{
|
|
6928
|
+
value: opt.value,
|
|
6929
|
+
disabled: opt.disabled,
|
|
6930
|
+
className: cx(
|
|
6931
|
+
"group relative flex flex-col gap-1 rounded-xl border bg-surface text-left transition-colors duration-150",
|
|
6932
|
+
PAD2[size],
|
|
6933
|
+
"border-border hover:border-border-strong",
|
|
6934
|
+
"data-[state=checked]:border-accent data-[state=checked]:ring-1 data-[state=checked]:ring-accent",
|
|
6935
|
+
// Keyboard focus only (no mouse-click flash); ring is instant, not animated.
|
|
6936
|
+
"focus:outline-none focus-visible:ring-2 focus-visible:ring-accent focus-visible:ring-offset-1 focus-visible:ring-offset-surface",
|
|
6937
|
+
"disabled:cursor-not-allowed disabled:opacity-50"
|
|
6938
|
+
),
|
|
6939
|
+
children: [
|
|
6940
|
+
/* @__PURE__ */ jsx(RadioGroupPrimitive.Indicator, { className: "absolute right-3 top-3", children: CheckMark }),
|
|
6941
|
+
opt.icon != null && /* @__PURE__ */ jsx("span", { className: "mb-1 text-accent [&>svg]:h-6 [&>svg]:w-6", children: opt.icon }),
|
|
6942
|
+
/* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2 pr-6", children: [
|
|
6943
|
+
/* @__PURE__ */ jsx("span", { className: cx("font-semibold text-foreground", TITLE[size]), children: opt.label }),
|
|
6944
|
+
opt.badge != null && /* @__PURE__ */ jsx("span", { className: "rounded-full border border-border bg-surface-raised px-2 py-0.5 text-[11px] font-medium text-foreground-secondary", children: opt.badge })
|
|
6945
|
+
] }),
|
|
6946
|
+
opt.description != null && /* @__PURE__ */ jsx("span", { className: "text-xs leading-relaxed text-foreground-secondary", children: opt.description })
|
|
6947
|
+
]
|
|
6948
|
+
},
|
|
6949
|
+
opt.value
|
|
6950
|
+
))
|
|
6951
|
+
}
|
|
6952
|
+
)
|
|
6953
|
+
}
|
|
6954
|
+
);
|
|
6955
|
+
}
|
|
6715
6956
|
function Checkbox({
|
|
6716
6957
|
checked,
|
|
6717
6958
|
value,
|
|
@@ -8607,7 +8848,7 @@ function OtpInput({
|
|
|
8607
8848
|
emit(valid.join(""));
|
|
8608
8849
|
focusBox(valid.length);
|
|
8609
8850
|
};
|
|
8610
|
-
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(
|
|
8851
|
+
return /* @__PURE__ */ jsx(Field, { className, label, htmlFor, errorId, errorMessage, required, layout, helperText, children: /* @__PURE__ */ jsx("div", { className: "flex flex-wrap items-center gap-2", role: "group", "aria-label": typeof label === "string" ? label : "One-time code", children: chars.map((char, idx) => /* @__PURE__ */ jsxs(React29.Fragment, { children: [
|
|
8611
8852
|
/* @__PURE__ */ jsx(
|
|
8612
8853
|
"input",
|
|
8613
8854
|
{
|
|
@@ -9331,7 +9572,7 @@ function Jumbotron({
|
|
|
9331
9572
|
}
|
|
9332
9573
|
);
|
|
9333
9574
|
}
|
|
9334
|
-
var
|
|
9575
|
+
var COLS2 = {
|
|
9335
9576
|
2: "sm:grid-cols-2",
|
|
9336
9577
|
3: "sm:grid-cols-2 lg:grid-cols-3",
|
|
9337
9578
|
4: "sm:grid-cols-2 lg:grid-cols-4"
|
|
@@ -9353,7 +9594,7 @@ function FeatureGrid({
|
|
|
9353
9594
|
title != null && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight text-foreground", children: title }),
|
|
9354
9595
|
description != null && /* @__PURE__ */ jsx("p", { className: "max-w-2xl text-base leading-relaxed text-foreground-secondary", children: description })
|
|
9355
9596
|
] }),
|
|
9356
|
-
/* @__PURE__ */ jsx("div", { className: ["grid grid-cols-1 gap-6",
|
|
9597
|
+
/* @__PURE__ */ jsx("div", { className: ["grid grid-cols-1 gap-6", COLS2[columns]].join(" "), children: features.map((f, i) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3 rounded-xl border border-border bg-surface p-5", children: [
|
|
9357
9598
|
f.icon != null && /* @__PURE__ */ jsx(
|
|
9358
9599
|
"span",
|
|
9359
9600
|
{
|
|
@@ -9410,7 +9651,7 @@ function PricingPlans({ plans, eyebrow, title, description, className = "", styl
|
|
|
9410
9651
|
)) })
|
|
9411
9652
|
] });
|
|
9412
9653
|
}
|
|
9413
|
-
var
|
|
9654
|
+
var COLS3 = {
|
|
9414
9655
|
1: "mx-auto max-w-2xl",
|
|
9415
9656
|
2: "sm:grid-cols-2",
|
|
9416
9657
|
3: "sm:grid-cols-2 lg:grid-cols-3"
|
|
@@ -9427,7 +9668,7 @@ function Testimonials({ testimonials, eyebrow, title, description, columns = 3,
|
|
|
9427
9668
|
title != null && /* @__PURE__ */ jsx("h2", { className: "text-3xl font-bold tracking-tight text-foreground", children: title }),
|
|
9428
9669
|
description != null && /* @__PURE__ */ jsx("p", { className: "max-w-2xl text-base leading-relaxed text-foreground-secondary", children: description })
|
|
9429
9670
|
] }),
|
|
9430
|
-
/* @__PURE__ */ jsx("div", { className: ["grid grid-cols-1 gap-6",
|
|
9671
|
+
/* @__PURE__ */ jsx("div", { className: ["grid grid-cols-1 gap-6", COLS3[columns]].join(" "), children: testimonials.map((tm, i) => /* @__PURE__ */ jsxs("figure", { className: "flex flex-col gap-4 rounded-xl border border-border bg-surface p-6", children: [
|
|
9431
9672
|
tm.rating != null && /* @__PURE__ */ jsx(Stars, { value: tm.rating }),
|
|
9432
9673
|
/* @__PURE__ */ jsxs("blockquote", { className: "flex-1 text-sm leading-relaxed text-foreground", children: [
|
|
9433
9674
|
"\u201C",
|
|
@@ -9631,7 +9872,7 @@ function Parallax({
|
|
|
9631
9872
|
}
|
|
9632
9873
|
);
|
|
9633
9874
|
}
|
|
9634
|
-
var
|
|
9875
|
+
var COLS4 = {
|
|
9635
9876
|
2: "sm:grid-cols-2",
|
|
9636
9877
|
3: "sm:grid-cols-2 lg:grid-cols-3"
|
|
9637
9878
|
};
|
|
@@ -9652,7 +9893,7 @@ function Blog({
|
|
|
9652
9893
|
title != null && /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold tracking-tight text-foreground sm:text-3xl", children: title }),
|
|
9653
9894
|
description != null && /* @__PURE__ */ jsx("p", { className: "max-w-2xl text-base leading-relaxed text-foreground-secondary", children: description })
|
|
9654
9895
|
] }),
|
|
9655
|
-
/* @__PURE__ */ jsx("div", { className: ["grid grid-cols-1 gap-6",
|
|
9896
|
+
/* @__PURE__ */ jsx("div", { className: ["grid grid-cols-1 gap-6", COLS4[columns]].join(" "), children: posts.map((post, i) => {
|
|
9656
9897
|
const meta = [post.author, post.date, post.readTime].filter((m) => m != null);
|
|
9657
9898
|
const inner = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9658
9899
|
post.image && /* @__PURE__ */ jsxs("div", { className: "relative aspect-video overflow-hidden bg-backdrop", children: [
|
|
@@ -9663,7 +9904,7 @@ function Blog({
|
|
|
9663
9904
|
post.tag != null && !post.image && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Badge, { tone: "accent", variant: "soft", size: "sm", children: post.tag }) }),
|
|
9664
9905
|
/* @__PURE__ */ jsx("h3", { className: "text-base font-semibold leading-snug text-foreground transition-colors group-hover:text-accent", children: post.title }),
|
|
9665
9906
|
post.excerpt != null && /* @__PURE__ */ jsx("p", { className: "line-clamp-3 text-sm leading-relaxed text-foreground-secondary", children: post.excerpt }),
|
|
9666
|
-
meta.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-auto flex flex-wrap items-center gap-x-2 gap-y-1 pt-3 text-xs text-foreground-muted", children: meta.map((m, j) => /* @__PURE__ */ jsxs(
|
|
9907
|
+
meta.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-auto flex flex-wrap items-center gap-x-2 gap-y-1 pt-3 text-xs text-foreground-muted", children: meta.map((m, j) => /* @__PURE__ */ jsxs(React29.Fragment, { children: [
|
|
9667
9908
|
j > 0 && /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\xB7" }),
|
|
9668
9909
|
/* @__PURE__ */ jsx("span", { children: m })
|
|
9669
9910
|
] }, j)) })
|
|
@@ -9836,6 +10077,6 @@ function LeadCapture({
|
|
|
9836
10077
|
);
|
|
9837
10078
|
}
|
|
9838
10079
|
|
|
9839
|
-
export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Blog, Box, Breadcrumbs, Button_default as Button, CARD_BRANDS, Card_default as Card, CardCarousel, Cart, CartButton, CartProvider, Catalog, CatalogCarousel, CatalogGrid, Chat, Checkbox, Checkout, ColorPicker, ContextMenu, CookieConsent, CreditCardForm, DateRangePicker, Drawer, Dropdown, EmptyCart, FAB, FadingBase, FeatureGrid, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid, GridCard, IconButton, Jumbotron, Kbd, LeadCapture, List2 as List, LoadingSpinner, LogoutTimer, MegaMenu_default as MegaMenu, MenuButton, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Parallax, Password, PopConfirm, Portal, PricingPlans, RadioGroup, Rating, ScalableContainer, Scheduler, SearchInput_default as SearchInput, SecureLayout, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, SlideShow, Slider, Socials, Statistic, Stepper, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, Testimonials, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Timeline, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Video, Wizard, cardNumberError, cvvError, cx, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, useBreakpoint, useCart, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification };
|
|
10080
|
+
export { Accordion_default as Accordion, AppShell, AutoComplete, Avatar, Badge, Blog, Box, Breadcrumbs, Button_default as Button, CARD_BRANDS, Card_default as Card, CardCarousel, Cart, CartButton, CartProvider, Catalog, CatalogCarousel, CatalogGrid, Chat, Checkbox, Checkout, ColorPicker, ContextMenu, CookieConsent, CreditCardForm, DateRangePicker, Drawer, Dropdown, EmptyCart, FAB, FadingBase, FeatureGrid, Field, FieldHelpIcon, FieldLabel, FileInput, Flex, Form, FormContext, FormField, FormStore, Grid, GridCard, IconButton, Jumbotron, Kbd, LeadCapture, List2 as List, LoadingSpinner, LogoutTimer, MegaMenu_default as MegaMenu, MenuButton, Modal, NotificationProvider, NumberInput, OpaqueGridCard, OtpInput, Parallax, Password, PasswordStrength, PopConfirm, Portal, PricingPlans, RadioGroup, RadioTile, Rating, ScalableContainer, Scheduler, SearchInput_default as SearchInput, SecureLayout, SegmentedControl, Sidebar, SkeletonBox, SkeletonCard, SkeletonCircle, SkeletonText, SlideShow, Slider, Socials, Statistic, Stepper, Switch, Table, Tabs_default as Tabs, TagsInput, DatePicker as Temporal, Testimonials, TextArea, TextInput, ThemeProvider, ThemeSwitch, TimePicker, Timeline, Tooltip, TooltipProvider, TopBar, Tree, TreeSelect, Typography, Video, VirtualList, Wizard, cardNumberError, cvvError, cx, defaultPasswordRules, detectBrand, expiryError, fieldShell, formatCardNumber, formatExpiry, isRequired, luhnValid, onlyDigits, patterns, runFieldRules, scorePassword, useBreakpoint, useCart, useFieldArray, useForm, useFormField, useFormStore, useJwt, useLocalStorage, useMediaQuery, useNotification };
|
|
9840
10081
|
//# sourceMappingURL=index.js.map
|
|
9841
10082
|
//# sourceMappingURL=index.js.map
|