@plexui/ui 0.54.1 → 0.55.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/dist/es/components/ColorPicker/ColorWell.js.map +1 -1
- package/dist/es/components/NavigationRow/NavigationRow.js +60 -3
- package/dist/es/components/NavigationRow/NavigationRow.js.map +1 -1
- package/dist/types/components/ColorPicker/ColorWell.d.ts +2 -2
- package/dist/types/components/NavigationRow/NavigationRow.d.ts +6 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorWell.js","sourceRoot":"","sources":["../../../../src/components/ColorPicker/ColorWell.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAsC,MAAM,OAAO,CAAA;AAC9F,OAAO,CAAC,MAAM,8DAA8D,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAClC,OAAO,EAAE,UAAU,EAAE,CAAC,EAAE,MAAM,SAAS,CAAA;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,WAAW,EAAyB,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AA6BjG;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,EACxB,EAAE,EACF,KAAK,EAAE,SAAS,EAChB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AE,KAAK,GAAgB,GACtB,EAChB,KAAC,MAAM,CAAC,IAAI,IAAC,SAAS,EAAE,CAAC,CAAC,SAAS,YAAG,MAAM,GAAe,IAC5C,IACV,CACV,IACA,CACJ,CAAA;AACH,CAAC","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { useEffect, useId, useRef, useState, type CSSProperties, type ReactNode } from \"react\"\nimport s from \"@plexui/styles/components/ColorPicker/ColorPicker.module.css\"\nimport { useBreakpoint } from \"../../hooks/useBreakpoints\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { Button, NavigationButton } from \"../Button\"\nimport { Dialog } from \"../Dialog\"\nimport { Eyedropper, X } from \"../Icon\"\nimport { Popover } from \"../Popover\"\nimport { Toolbar } from \"../Toolbar\"\nimport { ColorPicker, type ColorPickerProps } from \"./ColorPicker\"\nimport { alphaPercent, cssColor, eyeDropper, formatColor, hexDigits, parseColor } from \"./shared\"\n\nexport type ColorWellProps = Omit<ColorPickerProps, \"value\" | \"defaultValue\" | \"onChange\" | \"aria-label\" | \"className\" | \"id\"> & {\n /** The `id` of the well. */\n id?: string\n /** The controlled color, `#rrggbb` or `#rrggbbaa`; `null` shows the rainbow well with no color. Use with `onChange`. */\n value?: string | null\n /** The color when it is initially rendered. Use when you do not need to control the color. @default null */\n defaultValue?: string | null\n /** Called with the color the picker chose. */\n onChange?: (value: string) => void\n /** The title of the picker. @default \"Colors\" */\n title?: string\n /** Shows the eyedropper in the picker where the browser can pick a color from the screen (EyeDropper API). @default true */\n supportsEyedropper?: boolean\n /** The kit's Picker Button sizes: `sm` 28px, `lg` 36px. @default \"sm\" */\n size?: \"sm\" | \"lg\"\n /** When `true`, prevents the user from opening the picker. */\n disabled?: boolean\n /** The name of the well. Submits its color with the owning form. */\n name?: string\n /** Accessible name of the well. @default \"Color\" */\n \"aria-label\"?: string\n /** The `id` of the visible label of the well. */\n \"aria-labelledby\"?: string\n /** CSS classes applied to the well */\n className?: string\n}\n\n/**\n * A color well, as `UIColorWell`: the kit's Picker Button (5739:34128), a rainbow ring around the chosen color. It\n * opens the color picker, in a Popover from the well, and on a phone in a sheet, as the system picker.\n */\nexport function ColorWell({\n id,\n value: valueProp,\n defaultValue = null,\n onChange,\n title = \"Colors\",\n supportsEyedropper = true,\n size = \"sm\",\n disabled = false,\n name,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n className,\n ...pickerProps\n}: ColorWellProps) {\n const wide = useBreakpoint(\"md\")\n const valueId = `${useId()}-value`\n const [open, setOpen] = useState(false)\n const [internalValue, setInternalValue] = useState<string | null>(defaultValue)\n const value = valueProp === undefined ? internalValue : valueProp\n const color = parseColor(value)\n const options = useLatestValue({ controlled: valueProp !== undefined, onChange })\n // The EyeDropper API exists only in a browser, so the button appears after hydration.\n const [canPick, setCanPick] = useState(false)\n useEffect(() => setCanPick(eyeDropper() !== null), [])\n const picking = useRef(false)\n\n const choose = (next: string) => {\n if (!options.current.controlled) setInternalValue(next)\n options.current.onChange?.(next)\n }\n\n const pick = async () => {\n const EyeDropper = eyeDropper()\n if (!EyeDropper || picking.current) return\n picking.current = true\n try {\n const picked = parseColor((await new EyeDropper().open()).sRGBHex)\n if (picked) choose(formatColor({ ...picked, a: color?.a ?? 1 }))\n } catch {\n // Escape, or a click the browser did not hand to the page, cancels the pick.\n } finally {\n picking.current = false\n }\n }\n\n const well = (\n <button\n id={id}\n type=\"button\"\n className={clsx(s.Well, className)}\n data-size={size}\n data-selected={color ? \"\" : undefined}\n disabled={disabled}\n aria-label={ariaLabelledBy ? undefined : ariaLabel ?? \"Color\"}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={color ? valueId : undefined}\n style={color ? { \"--color-well-color\": cssColor(color) } as CSSProperties : undefined}\n >\n {color && <span className={s.WellColor} />}\n {/* The color, read as the well's description. */}\n {color && <span id={valueId} hidden>{`#${hexDigits(color)}${color.a < 1 ? `, ${alphaPercent(color.a)}% opacity` : \"\"}`}</span>}\n </button>\n )\n\n const picker = (\n <ColorPicker {...pickerProps} value={formatColor(color ?? { r: 0, g: 0, b: 0, a: 1 })} onChange={choose} aria-label={title} />\n )\n const eyedropperButton = (glass: boolean): ReactNode => supportsEyedropper && canPick && (\n <Button\n color=\"secondary\"\n variant={glass ? \"soft\" : \"ghost\"}\n mobileMaterial={glass ? \"glass\" : undefined}\n size={glass ? \"lg\" : \"sm\"}\n uniform\n pill\n aria-label=\"Eyedropper\"\n onClick={() => void pick()}\n >\n <Eyedropper />\n </Button>\n )\n\n return (\n <>\n {name !== undefined && <input type=\"hidden\" name={name} value={value ?? \"\"} disabled={disabled} />}\n {wide ? (\n <Popover open={open} onOpenChange={setOpen}>\n <Popover.Trigger>{well}</Popover.Trigger>\n <Popover.Content className={s.Popover} width=\"auto\" side=\"bottom\" align=\"center\">\n <div className={s.PopoverHeader}>\n <div className={s.PopoverLeading}>{eyedropperButton(false)}</div>\n <span className={s.PopoverTitle}>{title}</span>\n <div className={s.PopoverTrailing}>\n <Button color=\"secondary\" variant=\"ghost\" size=\"sm\" uniform pill aria-label=\"Close\" onClick={() => setOpen(false)}>\n <X />\n </Button>\n </div>\n </div>\n {picker}\n </Popover.Content>\n </Popover>\n ) : (\n <Dialog open={open} onOpenChange={setOpen}>\n <Dialog.Trigger>{well}</Dialog.Trigger>\n <Dialog.Content mobileVariant=\"sheet\" surface=\"grouped\" showClose={false} className={s.Sheet}>\n {/* iOS 27.2 sets Close first and the eyedropper last (UIColorPickerViewController on an iPhone 17); the\n iOS 26 kit had them the other way round. */}\n <Toolbar background=\"solid\">\n <Toolbar.Leading>\n <Dialog.Close>\n <NavigationButton action=\"close\" />\n </Dialog.Close>\n </Toolbar.Leading>\n <Toolbar.Title>{title}</Toolbar.Title>\n <Toolbar.Trailing>{eyedropperButton(true)}</Toolbar.Trailing>\n </Toolbar>\n <Dialog.Header>\n <Dialog.Title>{title}</Dialog.Title>\n </Dialog.Header>\n <Dialog.Body className={s.SheetBody}>{picker}</Dialog.Body>\n </Dialog.Content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K,GAAQ,EAC/C,cAAK,SAAS,EAAE,CAAC,CAAC,eAAe,YAC/B,KAAC,MAAM,IAAC,KAAK,EAAC,WAAW,EAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,IAAI,EAAC,OAAO,QAAC,IAAI,sBAAY,OAAO,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,YAC/G,KAAC,CAAC,KAAG,GACE,GACL,IACF,EACL,MAAM,IACS,IACV,CACX,CAAC,CAAC,CAAC,CACF,MAAC,MAAM,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,aACvC,KAAC,MAAM,CAAC,OAAO,cAAE,IAAI,GAAkB,EACvC,MAAC,MAAM,CAAC,OAAO,IAAC,aAAa,EAAC,OAAO,EAAC,OAAO,EAAC,SAAS,EAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC,KAAK,aAG1F,MAAC,OAAO,IAAC,UAAU,EAAC,OAAO,aACzB,KAAC,OAAO,CAAC,OAAO,cACd,KAAC,MAAM,CAAC,KAAK,cACX,KAAC,gBAAgB,IAAC,MAAM,EAAC,OAAO,GAAG,GACtB,GACC,EAClB,KAAC,OAAO,CAAC,KAAK,cAAE,KAAK,GAAiB,EACtC,KAAC,OAAO,CAAC,QAAQ,cAAE,gBAAgB,CAAC,IAAI,CAAC,GAAoB,IACrD,EACV,KAAC,MAAM,CAAC,MAAM,cACZ,KAAC,MAAM,CAAC,KAAK,cAAE,KAAK,GAAgB,GACtB,EAChB,KAAC,MAAM,CAAC,IAAI,IAAC,SAAS,EAAE,CAAC,CAAC,SAAS,YAAG,MAAM,GAAe,IAC5C,IACV,CACV,IACA,CACJ,CAAA;AACH,CAAC","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { useEffect, useId, useRef, useState, type CSSProperties, type ReactNode } from \"react\"\nimport s from \"@plexui/styles/components/ColorPicker/ColorPicker.module.css\"\nimport { useBreakpoint } from \"../../hooks/useBreakpoints\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { Button, NavigationButton } from \"../Button\"\nimport { Dialog } from \"../Dialog\"\nimport { Eyedropper, X } from \"../Icon\"\nimport { Popover } from \"../Popover\"\nimport { Toolbar } from \"../Toolbar\"\nimport { ColorPicker, type ColorPickerProps } from \"./ColorPicker\"\nimport { alphaPercent, cssColor, eyeDropper, formatColor, hexDigits, parseColor } from \"./shared\"\n\nexport type ColorWellProps = Omit<ColorPickerProps, \"value\" | \"defaultValue\" | \"onChange\" | \"aria-label\" | \"className\" | \"id\"> & {\n /** The `id` of the well. */\n id?: string\n /** The controlled color, `#rrggbb` or `#rrggbbaa`; `null` shows the rainbow well with no color. Use with `onChange`. */\n value?: string | null\n /** The color when it is initially rendered. Use when you do not need to control the color. @default null */\n defaultValue?: string | null\n /** Called with the color the picker chose. */\n onChange?: (value: string) => void\n /** The title of the picker. @default \"Colors\" */\n title?: string\n /** Shows the eyedropper in the picker where the browser can pick a color from the screen (EyeDropper API). @default true */\n supportsEyedropper?: boolean\n /** The kit's Picker Button sizes, `sm` 28px and `lg` 36px, and `xs` 24px for the start of a 32px field. @default \"sm\" */\n size?: \"xs\" | \"sm\" | \"lg\"\n /** When `true`, prevents the user from opening the picker. */\n disabled?: boolean\n /** The name of the well. Submits its color with the owning form. */\n name?: string\n /** Accessible name of the well. @default \"Color\" */\n \"aria-label\"?: string\n /** The `id` of the visible label of the well. */\n \"aria-labelledby\"?: string\n /** CSS classes applied to the well */\n className?: string\n}\n\n/**\n * A color well, as `UIColorWell`: the kit's Picker Button (5739:34128), a rainbow ring around the chosen color. It\n * opens the color picker, in a Popover from the well, and on a phone in a sheet, as the system picker.\n */\nexport function ColorWell({\n id,\n value: valueProp,\n defaultValue = null,\n onChange,\n title = \"Colors\",\n supportsEyedropper = true,\n size = \"sm\",\n disabled = false,\n name,\n \"aria-label\": ariaLabel,\n \"aria-labelledby\": ariaLabelledBy,\n className,\n ...pickerProps\n}: ColorWellProps) {\n const wide = useBreakpoint(\"md\")\n const valueId = `${useId()}-value`\n const [open, setOpen] = useState(false)\n const [internalValue, setInternalValue] = useState<string | null>(defaultValue)\n const value = valueProp === undefined ? internalValue : valueProp\n const color = parseColor(value)\n const options = useLatestValue({ controlled: valueProp !== undefined, onChange })\n // The EyeDropper API exists only in a browser, so the button appears after hydration.\n const [canPick, setCanPick] = useState(false)\n useEffect(() => setCanPick(eyeDropper() !== null), [])\n const picking = useRef(false)\n\n const choose = (next: string) => {\n if (!options.current.controlled) setInternalValue(next)\n options.current.onChange?.(next)\n }\n\n const pick = async () => {\n const EyeDropper = eyeDropper()\n if (!EyeDropper || picking.current) return\n picking.current = true\n try {\n const picked = parseColor((await new EyeDropper().open()).sRGBHex)\n if (picked) choose(formatColor({ ...picked, a: color?.a ?? 1 }))\n } catch {\n // Escape, or a click the browser did not hand to the page, cancels the pick.\n } finally {\n picking.current = false\n }\n }\n\n const well = (\n <button\n id={id}\n type=\"button\"\n className={clsx(s.Well, className)}\n data-size={size}\n data-selected={color ? \"\" : undefined}\n disabled={disabled}\n aria-label={ariaLabelledBy ? undefined : ariaLabel ?? \"Color\"}\n aria-labelledby={ariaLabelledBy}\n aria-describedby={color ? valueId : undefined}\n style={color ? { \"--color-well-color\": cssColor(color) } as CSSProperties : undefined}\n >\n {color && <span className={s.WellColor} />}\n {/* The color, read as the well's description. */}\n {color && <span id={valueId} hidden>{`#${hexDigits(color)}${color.a < 1 ? `, ${alphaPercent(color.a)}% opacity` : \"\"}`}</span>}\n </button>\n )\n\n const picker = (\n <ColorPicker {...pickerProps} value={formatColor(color ?? { r: 0, g: 0, b: 0, a: 1 })} onChange={choose} aria-label={title} />\n )\n const eyedropperButton = (glass: boolean): ReactNode => supportsEyedropper && canPick && (\n <Button\n color=\"secondary\"\n variant={glass ? \"soft\" : \"ghost\"}\n mobileMaterial={glass ? \"glass\" : undefined}\n size={glass ? \"lg\" : \"sm\"}\n uniform\n pill\n aria-label=\"Eyedropper\"\n onClick={() => void pick()}\n >\n <Eyedropper />\n </Button>\n )\n\n return (\n <>\n {name !== undefined && <input type=\"hidden\" name={name} value={value ?? \"\"} disabled={disabled} />}\n {wide ? (\n <Popover open={open} onOpenChange={setOpen}>\n <Popover.Trigger>{well}</Popover.Trigger>\n <Popover.Content className={s.Popover} width=\"auto\" side=\"bottom\" align=\"center\">\n <div className={s.PopoverHeader}>\n <div className={s.PopoverLeading}>{eyedropperButton(false)}</div>\n <span className={s.PopoverTitle}>{title}</span>\n <div className={s.PopoverTrailing}>\n <Button color=\"secondary\" variant=\"ghost\" size=\"sm\" uniform pill aria-label=\"Close\" onClick={() => setOpen(false)}>\n <X />\n </Button>\n </div>\n </div>\n {picker}\n </Popover.Content>\n </Popover>\n ) : (\n <Dialog open={open} onOpenChange={setOpen}>\n <Dialog.Trigger>{well}</Dialog.Trigger>\n <Dialog.Content mobileVariant=\"sheet\" surface=\"grouped\" showClose={false} className={s.Sheet}>\n {/* iOS 27.2 sets Close first and the eyedropper last (UIColorPickerViewController on an iPhone 17); the\n iOS 26 kit had them the other way round. */}\n <Toolbar background=\"solid\">\n <Toolbar.Leading>\n <Dialog.Close>\n <NavigationButton action=\"close\" />\n </Dialog.Close>\n </Toolbar.Leading>\n <Toolbar.Title>{title}</Toolbar.Title>\n <Toolbar.Trailing>{eyedropperButton(true)}</Toolbar.Trailing>\n </Toolbar>\n <Dialog.Header>\n <Dialog.Title>{title}</Dialog.Title>\n </Dialog.Header>\n <Dialog.Body className={s.SheetBody}>{picker}</Dialog.Body>\n </Dialog.Content>\n </Dialog>\n )}\n </>\n )\n}\n"]}
|
|
@@ -1,22 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
+
import { useLayoutEffect, useRef, useState } from "react";
|
|
4
5
|
import s from "@plexui/styles/components/NavigationRow/NavigationRow.module.css";
|
|
5
6
|
import { Button, ButtonLink } from "../Button/index.js";
|
|
6
7
|
import { Disclosure } from "../Icon/index.js";
|
|
8
|
+
import { useFieldColumns } from "../../lib/fieldRow.js";
|
|
7
9
|
const shown = (value) => value !== null && value !== undefined && value !== false && value !== "";
|
|
10
|
+
/** Whether the label and the value of a row fit beside each other on one line: measured in the end layout, unwrapped */
|
|
11
|
+
const valueFitsBeside = (row) => {
|
|
12
|
+
const content = row.querySelector("[data-navigation-row-content]");
|
|
13
|
+
if (!content)
|
|
14
|
+
return true;
|
|
15
|
+
const below = row.hasAttribute("data-value-below");
|
|
16
|
+
row.removeAttribute("data-value-below");
|
|
17
|
+
row.setAttribute("data-measuring", "");
|
|
18
|
+
const fits = [content, ...content.querySelectorAll("[data-navigation-row-part]")].every((element) => element.scrollWidth <= element.clientWidth + 0.5);
|
|
19
|
+
row.removeAttribute("data-measuring");
|
|
20
|
+
if (below)
|
|
21
|
+
row.setAttribute("data-value-below", "");
|
|
22
|
+
return fits;
|
|
23
|
+
};
|
|
8
24
|
/**
|
|
9
25
|
* A FieldGroup row that opens what it holds, as an iOS Settings drill-in: label, current value, chevron, one press.
|
|
10
26
|
* Every other prop (id, events, ARIA, data attributes, className) goes to the pressable, so a caller states what
|
|
11
27
|
* the row opens (`aria-haspopup`, `aria-expanded`) itself.
|
|
12
28
|
*/
|
|
13
29
|
export function NavigationRow(props) {
|
|
14
|
-
const { label, value, description, href, external, as, disabled, className, ref, target, rel, download, hrefLang, ping, referrerPolicy, ...rest } = props;
|
|
30
|
+
const { label, value, description, href, external, as, disabled, valuePlacement = "end", className, ref, target, rel, download, hrefLang, ping, referrerPolicy, ...rest } = props;
|
|
15
31
|
// Only the link attributes given: an undefined `target` would override the new tab of an external link
|
|
16
32
|
const linkAttributes = Object.fromEntries(Object.entries({ target, rel, download, hrefLang, ping, referrerPolicy }).filter(([, attribute]) => attribute !== undefined));
|
|
17
33
|
const hasValue = shown(value);
|
|
18
34
|
const hasDescription = shown(description);
|
|
19
|
-
const
|
|
35
|
+
const rowRef = useRef(null);
|
|
36
|
+
// FieldGroup columns give the label a column of its own: a change of them measures again
|
|
37
|
+
const columns = useFieldColumns();
|
|
38
|
+
const [fits, setFits] = useState(true);
|
|
39
|
+
const auto = valuePlacement === "auto" && hasValue;
|
|
40
|
+
// "auto": measure on mount, when the label or value changes, and when the row's width changes
|
|
41
|
+
useLayoutEffect(() => {
|
|
42
|
+
const row = rowRef.current;
|
|
43
|
+
if (!auto || !row)
|
|
44
|
+
return;
|
|
45
|
+
let live = true;
|
|
46
|
+
const check = () => {
|
|
47
|
+
if (live)
|
|
48
|
+
setFits(valueFitsBeside(row));
|
|
49
|
+
};
|
|
50
|
+
check();
|
|
51
|
+
// A web font that arrives late (font-display: swap) changes the words' widths, not the row's
|
|
52
|
+
const fonts = typeof document !== "undefined" ? document.fonts : undefined;
|
|
53
|
+
fonts?.ready.then(check);
|
|
54
|
+
fonts?.addEventListener?.("loadingdone", check);
|
|
55
|
+
const stop = () => {
|
|
56
|
+
live = false;
|
|
57
|
+
fonts?.removeEventListener?.("loadingdone", check);
|
|
58
|
+
};
|
|
59
|
+
if (typeof ResizeObserver === "undefined")
|
|
60
|
+
return stop;
|
|
61
|
+
let width = row.getBoundingClientRect().width;
|
|
62
|
+
const observer = new ResizeObserver(() => {
|
|
63
|
+
const next = row.getBoundingClientRect().width;
|
|
64
|
+
if (next === width)
|
|
65
|
+
return;
|
|
66
|
+
width = next;
|
|
67
|
+
check();
|
|
68
|
+
});
|
|
69
|
+
observer.observe(row);
|
|
70
|
+
return () => {
|
|
71
|
+
stop();
|
|
72
|
+
observer.disconnect();
|
|
73
|
+
};
|
|
74
|
+
}, [auto, label, value, description, columns]);
|
|
75
|
+
const below = hasValue && (valuePlacement === "below" || (auto && !fits));
|
|
76
|
+
const content = (_jsxs("span", { className: s.Content, "data-navigation-row-content": "", children: [_jsxs("span", { className: s.Text, children: [_jsx("span", { className: s.Label, "data-navigation-row-part": "", children: label }), hasDescription && _jsx("span", { className: s.Description, children: description })] }), hasValue && _jsx("span", { className: s.Value, "data-navigation-row-part": "", children: value }), _jsx(Disclosure, { className: s.Disclosure, "aria-hidden": "true", "data-no-autosize": "" })] }));
|
|
20
77
|
const shared = {
|
|
21
78
|
className: clsx(s.Pressable, className),
|
|
22
79
|
block: true,
|
|
@@ -24,6 +81,6 @@ export function NavigationRow(props) {
|
|
|
24
81
|
variant: "ghost",
|
|
25
82
|
"data-navigation-row": "",
|
|
26
83
|
};
|
|
27
|
-
return (_jsx("div", { className: s.NavigationRow, "data-row": "", "data-value": hasValue ? "" : undefined, "data-description": hasDescription ? "" : undefined, children: href !== undefined && !disabled ? (_jsx(ButtonLink, { ...rest, ...shared, ref: ref, href: href, external: external, as: as, ...linkAttributes, children: content })) : (_jsx(Button, { ...rest, ...shared, ref: ref, disabled: disabled, children: content })) }));
|
|
84
|
+
return (_jsx("div", { ref: rowRef, className: s.NavigationRow, "data-row": "", "data-value-below": below ? "" : undefined, "data-value": hasValue ? "" : undefined, "data-description": hasDescription ? "" : undefined, children: href !== undefined && !disabled ? (_jsx(ButtonLink, { ...rest, ...shared, ref: ref, href: href, external: external, as: as, ...linkAttributes, children: content })) : (_jsx(Button, { ...rest, ...shared, ref: ref, disabled: disabled, children: content })) }));
|
|
28
85
|
}
|
|
29
86
|
//# sourceMappingURL=NavigationRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationRow.js","sourceRoot":"","sources":["../../../../src/components/NavigationRow/NavigationRow.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AAEvB,OAAO,CAAC,MAAM,kEAAkE,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AA6BpC,MAAM,KAAK,GAAG,CAAC,KAAgB,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,S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SAAS,EAAE,SAAS,CAAC;QACvC,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,OAAO;QAChB,qBAAqB,EAAE,EAAE;KACjB,CAAA;IAEV,OAAO,CACL,cACE,SAAS,EAAE,CAAC,CAAC,aAAa,cACjB,EAAE,gBACC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,sBACnB,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YAEhD,IAAI,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CACjC,KAAC,UAAU,OACJ,IAAgC,KACjC,MAAM,EACV,GAAG,EAAE,GAA6B,EAClC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAA0B,KAC1B,cAAc,YAEjB,OAAO,GACG,CACd,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,OAAM,IAAgD,KAAM,MAAM,EAAE,GAAG,EAAE,GAA6B,EAAE,QAAQ,EAAE,QAAQ,YAC9H,OAAO,GACD,CACV,GACG,CACP,CAAA;AACH,CAAC","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport type { AnchorHTMLAttributes, ButtonHTMLAttributes, ComponentType, ReactNode, Ref } from \"react\"\nimport s from \"@plexui/styles/components/NavigationRow/NavigationRow.module.css\"\nimport { Button, ButtonLink } from \"../Button\"\nimport { Disclosure } from \"../Icon\"\n\ntype LinkAttributes = Pick<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n \"target\" | \"rel\" | \"download\" | \"hrefLang\" | \"ping\" | \"referrerPolicy\"\n>\n\n// Events come from a button or, with `href`, a link (a disabled link is a button again), so handlers see either\nexport type NavigationRowProps = Omit<ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, \"children\" | \"value\" | \"type\"> &\n LinkAttributes & {\n /** The row's name, where a row's label starts */\n label: ReactNode\n /** The current value, at the end of the row in the secondary label. `0` shows; `null`, `undefined` and `\"\"` do not. */\n value?: ReactNode\n /** A line under the label; the row grows from 52 to hold it */\n description?: ReactNode\n /** Where the row goes. With it the row is a link (through `PlexUIProvider`'s `linkComponent`, or `as`). */\n href?: string\n /** Force external-link behavior for `href` */\n external?: boolean\n /** Link component for `href`, e.g. a router's link. @default PlexUIProvider linkComponent */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n as?: ComponentType<any> | \"a\"\n /** The row can't be pressed. A disabled link renders as a disabled button, so it never navigates. */\n disabled?: boolean\n /** Ref for the row's pressable (a `button`, or the link's element) */\n ref?: Ref<HTMLButtonElement | HTMLAnchorElement | null>\n}\n\nconst shown = (value: ReactNode) => value !== null && value !== undefined && value !== false && value !== \"\"\n\n/**\n * A FieldGroup row that opens what it holds, as an iOS Settings drill-in: label, current value, chevron, one press.\n * Every other prop (id, events, ARIA, data attributes, className) goes to the pressable, so a caller states what\n * the row opens (`aria-haspopup`, `aria-expanded`) itself.\n */\nexport function NavigationRow(props: NavigationRowProps) {\n const { label, value, description, href, external, as, disabled, className, ref, target, rel, download, hrefLang, ping, referrerPolicy, ...rest } = props\n // Only the link attributes given: an undefined `target` would override the new tab of an external link\n const linkAttributes = Object.fromEntries(\n Object.entries({ target, rel, download, hrefLang, ping, referrerPolicy }).filter(([, attribute]) => attribute !== undefined),\n )\n const hasValue = shown(value)\n const hasDescription = shown(description)\n\n const content = (\n <span className={s.Content}>\n <span className={s.Text}>\n <span className={s.Label}>{label}</span>\n {hasDescription && <span className={s.Description}>{description}</span>}\n </span>\n {hasValue && <span className={s.Value}>{value}</span>}\n <Disclosure className={s.Disclosure} aria-hidden=\"true\" data-no-autosize=\"\" />\n </span>\n )\n\n const shared = {\n className: clsx(s.Pressable, className),\n block: true,\n color: \"secondary\",\n variant: \"ghost\",\n \"data-navigation-row\": \"\",\n } as const\n\n return (\n <div\n className={s.NavigationRow}\n data-row=\"\"\n data-value={hasValue ? \"\" : undefined}\n data-description={hasDescription ? \"\" : undefined}\n >\n {href !== undefined && !disabled ? (\n <ButtonLink\n {...(rest as Record<string, unknown>)}\n {...shared}\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n external={external}\n as={as as PlexUI.LinkComponent}\n {...linkAttributes}\n >\n {content}\n </ButtonLink>\n ) : (\n <Button {...(rest as ButtonHTMLAttributes<HTMLButtonElement>)} {...shared} ref={ref as Ref<HTMLButtonElement>} disabled={disabled}>\n {content}\n </Button>\n )}\n </div>\n )\n}\n"]}
|
|
1
|
+
{"version":3,"file":"NavigationRow.js","sourceRoot":"","sources":["../../../../src/components/NavigationRow/NavigationRow.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAAsG,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC7J,OAAO,CAAC,MAAM,kEAAkE,CAAA;AAChF,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAkCpD,MAAM,KAAK,GAAG,CAAC,KAAgB,EAAE,EAAE,CAAC,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,EAAE,CAAA;AAE5G,wHAAwH;AACxH,MAAM,eAAe,GAAG,CAAC,GAAgB,EAAE,EAAE;IAC3C,MAAM,OAAO,GAAG,GAAG,CAAC,aAAa,CAAc,+BAA+B,CAAC,CAAA;IAC/E,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAA;IACzB,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAA;IAClD,GAAG,CAAC,eAAe,CAAC,kBAAkB,CAAC,CAAA;IACvC,GAAG,CAAC,YAAY,CAAC,gBAAgB,EA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AE,CAAC,CAAC,CAAC,SAAS,sBACnB,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,YAEhD,IAAI,KAAK,SAAS,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CACjC,KAAC,UAAU,OACJ,IAAgC,KACjC,MAAM,EACV,GAAG,EAAE,GAA6B,EAClC,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,EAAE,EAAE,EAA0B,KAC1B,cAAc,YAEjB,OAAO,GACG,CACd,CAAC,CAAC,CAAC,CACF,KAAC,MAAM,OAAM,IAAgD,KAAM,MAAM,EAAE,GAAG,EAAE,GAA6B,EAAE,QAAQ,EAAE,QAAQ,YAC9H,OAAO,GACD,CACV,GACG,CACP,CAAA;AACH,CAAC","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type ComponentType, type ReactNode, type Ref, useLayoutEffect, useRef, useState } from \"react\"\nimport s from \"@plexui/styles/components/NavigationRow/NavigationRow.module.css\"\nimport { Button, ButtonLink } from \"../Button\"\nimport { Disclosure } from \"../Icon\"\nimport { useFieldColumns } from \"../../lib/fieldRow\"\n\ntype LinkAttributes = Pick<\n AnchorHTMLAttributes<HTMLAnchorElement>,\n \"target\" | \"rel\" | \"download\" | \"hrefLang\" | \"ping\" | \"referrerPolicy\"\n>\n\n// Events come from a button or, with `href`, a link (a disabled link is a button again), so handlers see either\nexport type NavigationRowProps = Omit<ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, \"children\" | \"value\" | \"type\"> &\n LinkAttributes & {\n /** The row's name, where a row's label starts */\n label: ReactNode\n /** The current value, at the end of the row in the secondary label. `0` shows; `null`, `undefined` and `\"\"` do not. */\n value?: ReactNode\n /** A line under the label; the row grows from 52 to hold it */\n description?: ReactNode\n /** Where the row goes. With it the row is a link (through `PlexUIProvider`'s `linkComponent`, or `as`). */\n href?: string\n /** Force external-link behavior for `href` */\n external?: boolean\n /** Link component for `href`, e.g. a router's link. @default PlexUIProvider linkComponent */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n as?: ComponentType<any> | \"a\"\n /** The row can't be pressed. A disabled link renders as a disabled button, so it never navigates. */\n disabled?: boolean\n /**\n * Where the value stands: at the `end` of the row, `below` the label at the full width, or `auto`: at the end while\n * it fits beside the label on one line, otherwise below (as Calendar sets a long value). @default \"end\"\n */\n valuePlacement?: \"end\" | \"below\" | \"auto\"\n /** Ref for the row's pressable (a `button`, or the link's element) */\n ref?: Ref<HTMLButtonElement | HTMLAnchorElement | null>\n}\n\nconst shown = (value: ReactNode) => value !== null && value !== undefined && value !== false && value !== \"\"\n\n/** Whether the label and the value of a row fit beside each other on one line: measured in the end layout, unwrapped */\nconst valueFitsBeside = (row: HTMLElement) => {\n const content = row.querySelector<HTMLElement>(\"[data-navigation-row-content]\")\n if (!content) return true\n const below = row.hasAttribute(\"data-value-below\")\n row.removeAttribute(\"data-value-below\")\n row.setAttribute(\"data-measuring\", \"\")\n const fits = [content, ...content.querySelectorAll<HTMLElement>(\"[data-navigation-row-part]\")].every(\n (element) => element.scrollWidth <= element.clientWidth + 0.5,\n )\n row.removeAttribute(\"data-measuring\")\n if (below) row.setAttribute(\"data-value-below\", \"\")\n return fits\n}\n\n/**\n * A FieldGroup row that opens what it holds, as an iOS Settings drill-in: label, current value, chevron, one press.\n * Every other prop (id, events, ARIA, data attributes, className) goes to the pressable, so a caller states what\n * the row opens (`aria-haspopup`, `aria-expanded`) itself.\n */\nexport function NavigationRow(props: NavigationRowProps) {\n const { label, value, description, href, external, as, disabled, valuePlacement = \"end\", className, ref, target, rel, download, hrefLang, ping, referrerPolicy, ...rest } = props\n // Only the link attributes given: an undefined `target` would override the new tab of an external link\n const linkAttributes = Object.fromEntries(\n Object.entries({ target, rel, download, hrefLang, ping, referrerPolicy }).filter(([, attribute]) => attribute !== undefined),\n )\n const hasValue = shown(value)\n const hasDescription = shown(description)\n const rowRef = useRef<HTMLDivElement>(null)\n // FieldGroup columns give the label a column of its own: a change of them measures again\n const columns = useFieldColumns()\n const [fits, setFits] = useState(true)\n const auto = valuePlacement === \"auto\" && hasValue\n\n // \"auto\": measure on mount, when the label or value changes, and when the row's width changes\n useLayoutEffect(() => {\n const row = rowRef.current\n if (!auto || !row) return\n let live = true\n const check = () => {\n if (live) setFits(valueFitsBeside(row))\n }\n check()\n // A web font that arrives late (font-display: swap) changes the words' widths, not the row's\n const fonts = typeof document !== \"undefined\" ? document.fonts : undefined\n fonts?.ready.then(check)\n fonts?.addEventListener?.(\"loadingdone\", check)\n const stop = () => {\n live = false\n fonts?.removeEventListener?.(\"loadingdone\", check)\n }\n if (typeof ResizeObserver === \"undefined\") return stop\n let width = row.getBoundingClientRect().width\n const observer = new ResizeObserver(() => {\n const next = row.getBoundingClientRect().width\n if (next === width) return\n width = next\n check()\n })\n observer.observe(row)\n return () => {\n stop()\n observer.disconnect()\n }\n }, [auto, label, value, description, columns])\n\n const below = hasValue && (valuePlacement === \"below\" || (auto && !fits))\n\n const content = (\n <span className={s.Content} data-navigation-row-content=\"\">\n <span className={s.Text}>\n <span className={s.Label} data-navigation-row-part=\"\">{label}</span>\n {hasDescription && <span className={s.Description}>{description}</span>}\n </span>\n {hasValue && <span className={s.Value} data-navigation-row-part=\"\">{value}</span>}\n <Disclosure className={s.Disclosure} aria-hidden=\"true\" data-no-autosize=\"\" />\n </span>\n )\n\n const shared = {\n className: clsx(s.Pressable, className),\n block: true,\n color: \"secondary\",\n variant: \"ghost\",\n \"data-navigation-row\": \"\",\n } as const\n\n return (\n <div\n ref={rowRef}\n className={s.NavigationRow}\n data-row=\"\"\n data-value-below={below ? \"\" : undefined}\n data-value={hasValue ? \"\" : undefined}\n data-description={hasDescription ? \"\" : undefined}\n >\n {href !== undefined && !disabled ? (\n <ButtonLink\n {...(rest as Record<string, unknown>)}\n {...shared}\n ref={ref as Ref<HTMLAnchorElement>}\n href={href}\n external={external}\n as={as as PlexUI.LinkComponent}\n {...linkAttributes}\n >\n {content}\n </ButtonLink>\n ) : (\n <Button {...(rest as ButtonHTMLAttributes<HTMLButtonElement>)} {...shared} ref={ref as Ref<HTMLButtonElement>} disabled={disabled}>\n {content}\n </Button>\n )}\n </div>\n )\n}\n"]}
|
|
@@ -12,8 +12,8 @@ export type ColorWellProps = Omit<ColorPickerProps, "value" | "defaultValue" | "
|
|
|
12
12
|
title?: string;
|
|
13
13
|
/** Shows the eyedropper in the picker where the browser can pick a color from the screen (EyeDropper API). @default true */
|
|
14
14
|
supportsEyedropper?: boolean;
|
|
15
|
-
/** The kit's Picker Button sizes
|
|
16
|
-
size?: "sm" | "lg";
|
|
15
|
+
/** The kit's Picker Button sizes, `sm` 28px and `lg` 36px, and `xs` 24px for the start of a 32px field. @default "sm" */
|
|
16
|
+
size?: "xs" | "sm" | "lg";
|
|
17
17
|
/** When `true`, prevents the user from opening the picker. */
|
|
18
18
|
disabled?: boolean;
|
|
19
19
|
/** The name of the well. Submits its color with the owning form. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type AnchorHTMLAttributes, type ButtonHTMLAttributes, type ComponentType, type ReactNode, type Ref } from "react";
|
|
2
2
|
type LinkAttributes = Pick<AnchorHTMLAttributes<HTMLAnchorElement>, "target" | "rel" | "download" | "hrefLang" | "ping" | "referrerPolicy">;
|
|
3
3
|
export type NavigationRowProps = Omit<ButtonHTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, "children" | "value" | "type"> & LinkAttributes & {
|
|
4
4
|
/** The row's name, where a row's label starts */
|
|
@@ -15,6 +15,11 @@ export type NavigationRowProps = Omit<ButtonHTMLAttributes<HTMLButtonElement | H
|
|
|
15
15
|
as?: ComponentType<any> | "a";
|
|
16
16
|
/** The row can't be pressed. A disabled link renders as a disabled button, so it never navigates. */
|
|
17
17
|
disabled?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Where the value stands: at the `end` of the row, `below` the label at the full width, or `auto`: at the end while
|
|
20
|
+
* it fits beside the label on one line, otherwise below (as Calendar sets a long value). @default "end"
|
|
21
|
+
*/
|
|
22
|
+
valuePlacement?: "end" | "below" | "auto";
|
|
18
23
|
/** Ref for the row's pressable (a `button`, or the link's element) */
|
|
19
24
|
ref?: Ref<HTMLButtonElement | HTMLAnchorElement | null>;
|
|
20
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.0",
|
|
4
4
|
"description": "Modern design system for building high-quality applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@maskito/core": "^5.2.2",
|
|
100
100
|
"@maskito/kit": "^5.2.2",
|
|
101
101
|
"@maskito/react": "^5.2.2",
|
|
102
|
-
"@plexui/styles": "^0.
|
|
102
|
+
"@plexui/styles": "^0.13.0",
|
|
103
103
|
"@radix-ui/react-dismissable-layer": "1.2.1",
|
|
104
104
|
"@radix-ui/react-focus-guards": "1.2.0",
|
|
105
105
|
"@radix-ui/react-focus-scope": "1.3.1",
|