@burdenoff/fe-libs 2026.1118.13 → 2026.1119.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/chrome/globalSearch/AdvancedFiltersPanel.js +128 -127
- package/dist/chrome/notificationCenter/NotificationFilters.js +45 -44
- package/dist/connections/CredentialStorageSelector.js +135 -134
- package/dist/connections/SharePanels.js +70 -69
- package/dist/credentials/AuthMethodSelector.js +33 -32
- package/dist/credentials/SchemaForm.js +96 -95
- package/dist/shared/assistant/avatar/live/LiveAvatarSettingsFields.js +74 -73
- package/dist/shared/assistant/ui/AssistantLanguageMenu.d.ts +2 -0
- package/dist/shared/assistant/ui/AssistantLanguageMenu.js +41 -40
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.d.ts +3 -1
- package/dist/shared/assistant/ui/AssistantReplyLanguageSelector.js +26 -25
- package/dist/shared/assistant/ui/composer/AssistantLanguageSelector.d.ts +3 -1
- package/dist/shared/assistant/ui/composer/AssistantLanguageSelector.js +22 -21
- package/dist/shared/assistant/ui/composer/AssistantVoiceGraceSelector.d.ts +2 -1
- package/dist/shared/assistant/ui/composer/AssistantVoiceGraceSelector.js +17 -16
- package/dist/shared/assistant/ui/composer/AssistantVoiceSelector.d.ts +3 -1
- package/dist/shared/assistant/ui/composer/AssistantVoiceSelector.js +22 -21
- package/dist/shared/pages/searchPage/FiltersPanel.js +129 -128
- package/dist/shared/pages/searchPage/SearchToolbar.js +24 -23
- package/dist/shared/providers/AppShellProvider.d.ts +8 -0
- package/dist/shared/providers/AppShellProvider.js +199 -193
- package/dist/shared/providers/shell/ThemeProvider.d.ts +6 -1
- package/dist/shared/providers/shell/ThemeProvider.js +65 -62
- package/dist/shared/providers/shell/themedNativeControls.d.ts +25 -0
- package/dist/shared/providers/shell/themedNativeControls.js +13 -0
- package/dist/sharing/ShareDialog.js +33 -32
- package/dist/storage/StorageFolderPicker.js +50 -49
- package/dist/ui/index.d.ts +2 -0
- package/dist/ui/themed-select-context.d.ts +9 -0
- package/dist/ui/themed-select-context.js +15 -0
- package/dist/ui/themed-select-options.d.ts +42 -0
- package/dist/ui/themed-select-options.js +88 -0
- package/dist/ui/themed-select.d.ts +7 -0
- package/dist/ui/themed-select.js +234 -0
- package/dist/ui.js +31 -29
- package/package.json +1 -1
- package/src/shared/tokens/tokens.css +100 -0
package/dist/ui/index.d.ts
CHANGED
|
@@ -31,6 +31,8 @@ export { Label } from './label';
|
|
|
31
31
|
export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor } from './popover';
|
|
32
32
|
export { ScrollArea, ScrollBar } from './scroll-area';
|
|
33
33
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, } from './select';
|
|
34
|
+
export { ThemedSelect, type ThemedSelectProps } from './themed-select';
|
|
35
|
+
export { ThemedSelectProvider, useThemedSelects, type ThemedSelectProviderProps, } from './themed-select-context';
|
|
34
36
|
export { Separator } from './separator';
|
|
35
37
|
export { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription, } from './sheet';
|
|
36
38
|
export { Skeleton } from './skeleton';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ThemedSelectProviderProps {
|
|
3
|
+
/** Open the app's styled menu instead of the system's. Default true. */
|
|
4
|
+
enabled?: boolean;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function ThemedSelectProvider({ enabled, children }: ThemedSelectProviderProps): import('react').JSX.Element;
|
|
8
|
+
/** True when the selects under this point open the app's styled menu. */
|
|
9
|
+
export declare function useThemedSelects(): boolean;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { createContext as e, use as t } from "react";
|
|
2
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
3
|
+
// src/ui/themed-select-context.tsx
|
|
4
|
+
var r = e(!1);
|
|
5
|
+
r.displayName = "ThemedSelectContext";
|
|
6
|
+
function i({ enabled: e = !0, children: t }) {
|
|
7
|
+
return /* @__PURE__ */ n(r.Provider, {
|
|
8
|
+
value: e,
|
|
9
|
+
children: t
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
function a() {
|
|
13
|
+
return t(r);
|
|
14
|
+
}
|
|
15
|
+
export { i as ThemedSelectProvider, a as useThemedSelects };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export interface ThemedSelectOption {
|
|
3
|
+
/** Position among every `<option>`, in document order (as in `select.options`). */
|
|
4
|
+
index: number;
|
|
5
|
+
/** The submitted value: the `value` prop, or the option's text when it has none. */
|
|
6
|
+
value: string;
|
|
7
|
+
/** What the option shows: its `label` prop, or its text. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** Disabled itself, or inside a disabled `<optgroup>`: shown, never chosen. */
|
|
10
|
+
disabled: boolean;
|
|
11
|
+
/** Its own `disabled` only: React's rule for the fallback choice reads just this. */
|
|
12
|
+
ownDisabled: boolean;
|
|
13
|
+
/** `hidden`: a placeholder the list never shows. */
|
|
14
|
+
hidden: boolean;
|
|
15
|
+
}
|
|
16
|
+
export type ThemedSelectEntry = {
|
|
17
|
+
kind: 'option';
|
|
18
|
+
option: ThemedSelectOption;
|
|
19
|
+
} | {
|
|
20
|
+
kind: 'group';
|
|
21
|
+
label: string;
|
|
22
|
+
options: ThemedSelectOption[];
|
|
23
|
+
};
|
|
24
|
+
export interface ThemedSelectModel {
|
|
25
|
+
/** What the menu lists, groups kept. */
|
|
26
|
+
entries: ThemedSelectEntry[];
|
|
27
|
+
/** Every option, flattened, in document order. */
|
|
28
|
+
options: ThemedSelectOption[];
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Reads `children` as a native `<select>` would see them. Returns null when they hold
|
|
32
|
+
* anything else (a component that renders its own `<option>`, stray text): the caller
|
|
33
|
+
* then keeps the native `<select>`, which still works, rather than guess.
|
|
34
|
+
*/
|
|
35
|
+
export declare function readThemedSelectChildren(children: ReactNode): ThemedSelectModel | null;
|
|
36
|
+
/**
|
|
37
|
+
* The option a native `<select>` shows for `value`, as React selects it: the first
|
|
38
|
+
* option with that value, else the first one not disabled itself. -1: no options.
|
|
39
|
+
*/
|
|
40
|
+
export declare function selectedOptionIndex(options: readonly ThemedSelectOption[], value: string | undefined): number;
|
|
41
|
+
/** `value` / `defaultValue` as React writes it to a single `<select>`. */
|
|
42
|
+
export declare function selectValueString(value: unknown): string | undefined;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Fragment as e, isValidElement as t } from "react";
|
|
2
|
+
// src/ui/themed-select-options.ts
|
|
3
|
+
function n(e) {
|
|
4
|
+
return e.replace(/[\t\n\f\r ]+/g, " ").trim();
|
|
5
|
+
}
|
|
6
|
+
function r(e) {
|
|
7
|
+
return typeof e == "object" && !!e && Symbol.iterator in e;
|
|
8
|
+
}
|
|
9
|
+
function i(e) {
|
|
10
|
+
if (e == null || typeof e == "boolean") return "";
|
|
11
|
+
if (typeof e == "string" || typeof e == "number" || typeof e == "bigint") return String(e);
|
|
12
|
+
if (r(e) && !t(e)) {
|
|
13
|
+
let t = "";
|
|
14
|
+
for (let n of e) {
|
|
15
|
+
let e = i(n);
|
|
16
|
+
if (e === null) return null;
|
|
17
|
+
t += e;
|
|
18
|
+
}
|
|
19
|
+
return t;
|
|
20
|
+
}
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function a(e, t) {
|
|
24
|
+
let n = e[t];
|
|
25
|
+
if (typeof n == "string") return n;
|
|
26
|
+
if (typeof n == "number" || typeof n == "bigint") return String(n);
|
|
27
|
+
}
|
|
28
|
+
function o(o) {
|
|
29
|
+
let s = [], c = [], l = (e, t) => {
|
|
30
|
+
let r = i(e.children);
|
|
31
|
+
if (r === null) return null;
|
|
32
|
+
let o = n(r), s = e.disabled === !0, l = {
|
|
33
|
+
index: c.length,
|
|
34
|
+
value: a(e, "value") ?? o,
|
|
35
|
+
label: n(a(e, "label") ?? "") || o,
|
|
36
|
+
disabled: s || t,
|
|
37
|
+
ownDisabled: s,
|
|
38
|
+
hidden: e.hidden === !0
|
|
39
|
+
};
|
|
40
|
+
return c.push(l), l;
|
|
41
|
+
}, u = (i, o) => {
|
|
42
|
+
if (i == null || typeof i == "boolean") return !0;
|
|
43
|
+
if (typeof i == "string") return i.trim() === "";
|
|
44
|
+
if (t(i)) {
|
|
45
|
+
if (i.type === e) return u(i.props.children, o);
|
|
46
|
+
if (i.type === "option") {
|
|
47
|
+
let e = l(i.props, o?.disabled ?? !1);
|
|
48
|
+
return e ? (o ? o.options.push(e) : s.push({
|
|
49
|
+
kind: "option",
|
|
50
|
+
option: e
|
|
51
|
+
}), !0) : !1;
|
|
52
|
+
}
|
|
53
|
+
if (i.type === "optgroup" && !o) {
|
|
54
|
+
let e = {
|
|
55
|
+
disabled: i.props.disabled === !0,
|
|
56
|
+
options: []
|
|
57
|
+
};
|
|
58
|
+
return u(i.props.children, e) ? (s.push({
|
|
59
|
+
kind: "group",
|
|
60
|
+
label: n(a(i.props, "label") ?? ""),
|
|
61
|
+
options: e.options
|
|
62
|
+
}), !0) : !1;
|
|
63
|
+
}
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
if (r(i)) {
|
|
67
|
+
for (let e of i) if (!u(e, o)) return !1;
|
|
68
|
+
return !0;
|
|
69
|
+
}
|
|
70
|
+
return !1;
|
|
71
|
+
};
|
|
72
|
+
return u(o, null) ? {
|
|
73
|
+
entries: s,
|
|
74
|
+
options: c
|
|
75
|
+
} : null;
|
|
76
|
+
}
|
|
77
|
+
function s(e, t) {
|
|
78
|
+
let n = -1;
|
|
79
|
+
for (let r of e) {
|
|
80
|
+
if (t !== void 0 && r.value === t) return r.index;
|
|
81
|
+
n === -1 && !r.ownDisabled && (n = r.index);
|
|
82
|
+
}
|
|
83
|
+
return n;
|
|
84
|
+
}
|
|
85
|
+
function c(e) {
|
|
86
|
+
if (e != null) return Array.isArray(e) ? e.length > 0 ? String(e[0]) : void 0 : String(e);
|
|
87
|
+
}
|
|
88
|
+
export { o as readThemedSelectChildren, c as selectValueString, s as selectedOptionIndex };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from 'react';
|
|
2
|
+
export type ThemedSelectProps = ComponentPropsWithRef<'select'>;
|
|
3
|
+
/**
|
|
4
|
+
* A `<select>` that opens the app's styled menu where the app opted in, and is the
|
|
5
|
+
* plain native `<select>` everywhere else. See the file header for what it keeps.
|
|
6
|
+
*/
|
|
7
|
+
export declare function ThemedSelect(props: ThemedSelectProps): import('react').JSX.Element;
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
import { cn as e } from "../shared-utils.js";
|
|
2
|
+
import { useThemedSelects as t } from "./themed-select-context.js";
|
|
3
|
+
import { readThemedSelectChildren as n, selectValueString as r, selectedOptionIndex as i } from "./themed-select-options.js";
|
|
4
|
+
import { Fragment as ee, useCallback as a, useEffect as te, useEffectEvent as ne, useLayoutEffect as re, useRef as o, useState as s } from "react";
|
|
5
|
+
import { Check as c, ChevronDown as ie } from "lucide-react";
|
|
6
|
+
import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
7
|
+
import * as f from "@radix-ui/react-select";
|
|
8
|
+
// src/ui/themed-select.tsx
|
|
9
|
+
var p = /* @__PURE__ */ new Set([
|
|
10
|
+
"onChange",
|
|
11
|
+
"onInput",
|
|
12
|
+
"onInvalid",
|
|
13
|
+
"onFocus",
|
|
14
|
+
"onBlur"
|
|
15
|
+
]);
|
|
16
|
+
function m(e) {
|
|
17
|
+
return Object.entries(e);
|
|
18
|
+
}
|
|
19
|
+
function h(e) {
|
|
20
|
+
return e.startsWith("aria-") || e.startsWith("data-");
|
|
21
|
+
}
|
|
22
|
+
function g(e) {
|
|
23
|
+
return m(e).some(([e, t]) => /^on[A-Z]/.test(e) && !p.has(e) && t !== void 0);
|
|
24
|
+
}
|
|
25
|
+
function ae(e) {
|
|
26
|
+
let t = {};
|
|
27
|
+
for (let [n, r] of m(e)) h(n) && (t[n] = r);
|
|
28
|
+
return t;
|
|
29
|
+
}
|
|
30
|
+
function _(e) {
|
|
31
|
+
return e.multiple || typeof e.size == "number" && e.size > 1 || e.ref && e.value === void 0 || g(e) ? null : n(e.children);
|
|
32
|
+
}
|
|
33
|
+
function v(e, t) {
|
|
34
|
+
if (typeof e == "function") {
|
|
35
|
+
let n = e(t);
|
|
36
|
+
return typeof n == "function" ? n : void 0;
|
|
37
|
+
}
|
|
38
|
+
e && (e.current = t);
|
|
39
|
+
}
|
|
40
|
+
function y(e) {
|
|
41
|
+
e.ctrlKey || e.metaKey || e.altKey || e.key !== "Escape" && e.key !== "Tab" && e.stopPropagation();
|
|
42
|
+
}
|
|
43
|
+
function b(e) {
|
|
44
|
+
e.stopPropagation();
|
|
45
|
+
}
|
|
46
|
+
function oe(e) {
|
|
47
|
+
e.stopPropagation();
|
|
48
|
+
}
|
|
49
|
+
function x(e, t, n) {
|
|
50
|
+
let r = n instanceof Element ? n : null;
|
|
51
|
+
e.dispatchEvent(new FocusEvent(t, {
|
|
52
|
+
bubbles: !0,
|
|
53
|
+
relatedTarget: r
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
var S = "inline-block cursor-default text-start disabled:cursor-not-allowed disabled:opacity-60", se = "relative z-50 max-h-[min(22.5rem,var(--radix-select-content-available-height))] min-w-[var(--radix-select-trigger-width)] max-w-[calc(100vw-1rem)] overflow-hidden rounded-card border border-border-subtle bg-bg-elevated text-text-primary shadow-elevation-3 motion-safe:data-[state=open]:animate-in motion-safe:data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2", ce = "scrollbar-slim scrollbar-box overscroll-contain p-1", C = "relative flex min-h-11 w-full cursor-default select-none items-center rounded-lg py-1.5 ps-8 pe-2 text-sm text-text-primary outline-none motion-safe:transition-colors focus:bg-[var(--color-accent-soft)] focus:text-text-primary data-[state=checked]:bg-action-primary-bg/10 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 sm:min-h-0", w = "-mx-1 my-1 h-px bg-border-subtle", T = "px-3 pb-1 pt-2 text-[11px] font-semibold uppercase tracking-wider text-text-muted";
|
|
57
|
+
function E(e) {
|
|
58
|
+
return /* @__PURE__ */ d(f.Item, {
|
|
59
|
+
value: String(e.index),
|
|
60
|
+
disabled: e.disabled,
|
|
61
|
+
textValue: e.label,
|
|
62
|
+
className: C,
|
|
63
|
+
"data-slot": "themed-select-item",
|
|
64
|
+
children: [/* @__PURE__ */ u("span", {
|
|
65
|
+
className: "absolute start-2 flex size-4 items-center justify-center",
|
|
66
|
+
children: /* @__PURE__ */ u(f.ItemIndicator, { children: /* @__PURE__ */ u(c, {
|
|
67
|
+
className: "size-4 text-action-primary-bg",
|
|
68
|
+
"aria-hidden": "true"
|
|
69
|
+
}) })
|
|
70
|
+
}), /* @__PURE__ */ u(f.ItemText, { children: e.label })]
|
|
71
|
+
}, e.index);
|
|
72
|
+
}
|
|
73
|
+
function D({ model: t, ref: n, id: c, className: p, style: m, title: h, hidden: g, lang: _, dir: C, tabIndex: D, autoFocus: O, name: le, form: k, required: A, autoComplete: ue, value: j, defaultValue: M, onChange: N, onInput: P, onInvalid: F, onFocus: I, onBlur: L, disabled: R, children: z, ...B }) {
|
|
74
|
+
let V = o(null), H = o(null), U = o(null), W = o(!1), G = o(!1), [de, fe] = s(!1), K = j !== void 0, [q, J] = s(() => {
|
|
75
|
+
let e = i(t.options, r(M));
|
|
76
|
+
return {
|
|
77
|
+
value: t.options[e]?.value,
|
|
78
|
+
index: e
|
|
79
|
+
};
|
|
80
|
+
}), Y = K ? i(t.options, r(j)) : q.value !== void 0 && t.options[q.index]?.value === q.value ? q.index : i(t.options, q.value), X = Y >= 0 ? t.options[Y] : void 0, pe = JSON.stringify(t.options.map((e) => e.value)), me = typeof p == "string" && /(^|\s)appearance-none(\s|$)/.test(p), he = t.options.filter((e) => !e.hidden), Z = t.entries.flatMap((e) => {
|
|
81
|
+
if (e.kind === "option") return e.option.hidden ? [] : [e];
|
|
82
|
+
let t = e.options.filter((e) => !e.hidden);
|
|
83
|
+
return t.length > 0 ? [{
|
|
84
|
+
...e,
|
|
85
|
+
options: t
|
|
86
|
+
}] : [];
|
|
87
|
+
}), ge = a((e) => {
|
|
88
|
+
V.current = e;
|
|
89
|
+
let t = v(n, e);
|
|
90
|
+
return () => {
|
|
91
|
+
V.current = null, t ? t() : v(n, null);
|
|
92
|
+
};
|
|
93
|
+
}, [n]);
|
|
94
|
+
re(() => {
|
|
95
|
+
let e = V.current;
|
|
96
|
+
!K && e && J((t) => t.index === e.selectedIndex && t.value === e.value ? t : {
|
|
97
|
+
value: e.value,
|
|
98
|
+
index: e.selectedIndex
|
|
99
|
+
});
|
|
100
|
+
}, [K, pe]);
|
|
101
|
+
let _e = (e) => {
|
|
102
|
+
if (G.current) return;
|
|
103
|
+
let n = t.options[Number(e)], r = V.current;
|
|
104
|
+
n && r && (K || J({
|
|
105
|
+
value: n.value,
|
|
106
|
+
index: n.index
|
|
107
|
+
}), r.selectedIndex !== n.index && (r.selectedIndex = n.index, r.dispatchEvent(new Event("input", { bubbles: !0 })), r.dispatchEvent(new Event("change", { bubbles: !0 }))));
|
|
108
|
+
}, ve = ne(() => {
|
|
109
|
+
G.current = !1;
|
|
110
|
+
let e = V.current;
|
|
111
|
+
e && (K ? Y >= 0 && e.selectedIndex !== Y && (e.selectedIndex = Y) : J({
|
|
112
|
+
value: e.value,
|
|
113
|
+
index: e.selectedIndex
|
|
114
|
+
}));
|
|
115
|
+
});
|
|
116
|
+
te(() => {
|
|
117
|
+
let e = V.current?.form;
|
|
118
|
+
if (!e) return;
|
|
119
|
+
let t, n = () => {
|
|
120
|
+
G.current = !0, clearTimeout(t), t = setTimeout(() => ve(), 0);
|
|
121
|
+
};
|
|
122
|
+
return e.addEventListener("reset", n, !0), () => {
|
|
123
|
+
e.removeEventListener("reset", n, !0), clearTimeout(t), G.current = !1;
|
|
124
|
+
};
|
|
125
|
+
}, [k]);
|
|
126
|
+
let ye = (e) => e instanceof Node && (!!H.current?.contains(e) || !!U.current?.contains(e)), Q = (e) => {
|
|
127
|
+
W.current || (W.current = !0, I && V.current && x(V.current, "focusin", e.relatedTarget));
|
|
128
|
+
}, $ = (e) => {
|
|
129
|
+
W.current && !ye(e.relatedTarget) && (W.current = !1, L && V.current && x(V.current, "focusout", e.relatedTarget));
|
|
130
|
+
};
|
|
131
|
+
return /* @__PURE__ */ d(l, { children: [/* @__PURE__ */ d(f.Root, {
|
|
132
|
+
value: X ? String(X.index) : "",
|
|
133
|
+
onValueChange: _e,
|
|
134
|
+
open: de,
|
|
135
|
+
onOpenChange: fe,
|
|
136
|
+
disabled: R,
|
|
137
|
+
dir: C === "rtl" || C === "ltr" ? C : void 0,
|
|
138
|
+
children: [/* @__PURE__ */ u(f.Trigger, {
|
|
139
|
+
ref: H,
|
|
140
|
+
id: c,
|
|
141
|
+
title: h,
|
|
142
|
+
hidden: g,
|
|
143
|
+
lang: _,
|
|
144
|
+
tabIndex: D,
|
|
145
|
+
autoFocus: O,
|
|
146
|
+
style: m,
|
|
147
|
+
"aria-required": A ? !0 : void 0,
|
|
148
|
+
...ae(B),
|
|
149
|
+
"data-slot": "themed-select-trigger",
|
|
150
|
+
className: e(S, p),
|
|
151
|
+
onFocus: Q,
|
|
152
|
+
onBlur: $,
|
|
153
|
+
onKeyDown: y,
|
|
154
|
+
children: /* @__PURE__ */ d("span", {
|
|
155
|
+
className: "flex w-full min-w-0 items-center gap-2",
|
|
156
|
+
children: [/* @__PURE__ */ d("span", {
|
|
157
|
+
className: "grid min-w-0 flex-1",
|
|
158
|
+
children: [/* @__PURE__ */ u("span", {
|
|
159
|
+
className: "col-start-1 row-start-1 min-w-0 truncate",
|
|
160
|
+
"data-slot": "themed-select-value",
|
|
161
|
+
children: /* @__PURE__ */ u(f.Value, { children: X?.label ?? "" })
|
|
162
|
+
}), he.map((e) => /* @__PURE__ */ u("span", {
|
|
163
|
+
"aria-hidden": "true",
|
|
164
|
+
className: "invisible col-start-1 row-start-1 h-0 min-w-0 overflow-hidden whitespace-nowrap",
|
|
165
|
+
children: e.label
|
|
166
|
+
}, e.index))]
|
|
167
|
+
}), me ? null : /* @__PURE__ */ u(f.Icon, {
|
|
168
|
+
asChild: !0,
|
|
169
|
+
children: /* @__PURE__ */ u(ie, {
|
|
170
|
+
className: "size-4 shrink-0 text-text-muted",
|
|
171
|
+
"aria-hidden": "true"
|
|
172
|
+
})
|
|
173
|
+
})]
|
|
174
|
+
})
|
|
175
|
+
}), /* @__PURE__ */ u(f.Portal, { children: /* @__PURE__ */ u(f.Content, {
|
|
176
|
+
ref: U,
|
|
177
|
+
position: "popper",
|
|
178
|
+
side: "bottom",
|
|
179
|
+
align: "start",
|
|
180
|
+
sideOffset: 6,
|
|
181
|
+
collisionPadding: 8,
|
|
182
|
+
className: se,
|
|
183
|
+
"data-slot": "themed-select-content",
|
|
184
|
+
onFocus: Q,
|
|
185
|
+
onBlur: $,
|
|
186
|
+
onKeyDown: b,
|
|
187
|
+
onEscapeKeyDown: oe,
|
|
188
|
+
children: /* @__PURE__ */ u(f.Viewport, {
|
|
189
|
+
className: ce,
|
|
190
|
+
children: Z.map((e, t) => {
|
|
191
|
+
let n = t > 0 && (e.kind === "group" || Z[t - 1]?.kind === "group") ? /* @__PURE__ */ u(f.Separator, { className: w }) : null;
|
|
192
|
+
return e.kind === "option" ? n ? /* @__PURE__ */ d(ee, { children: [n, E(e.option)] }, e.option.index) : E(e.option) : /* @__PURE__ */ d(f.Group, { children: [
|
|
193
|
+
n,
|
|
194
|
+
e.label ? /* @__PURE__ */ u(f.Label, {
|
|
195
|
+
className: T,
|
|
196
|
+
children: e.label
|
|
197
|
+
}) : null,
|
|
198
|
+
e.options.map(E)
|
|
199
|
+
] }, `group-${e.options[0]?.index ?? t}`);
|
|
200
|
+
})
|
|
201
|
+
})
|
|
202
|
+
}) })]
|
|
203
|
+
}), /* @__PURE__ */ u("select", {
|
|
204
|
+
ref: ge,
|
|
205
|
+
"aria-hidden": "true",
|
|
206
|
+
tabIndex: -1,
|
|
207
|
+
className: "sr-only pointer-events-none",
|
|
208
|
+
"data-slot": "themed-select-native",
|
|
209
|
+
name: le,
|
|
210
|
+
form: k,
|
|
211
|
+
required: A,
|
|
212
|
+
autoComplete: ue,
|
|
213
|
+
disabled: R,
|
|
214
|
+
...K ? { value: j } : { defaultValue: M },
|
|
215
|
+
onChange: N,
|
|
216
|
+
onInput: P,
|
|
217
|
+
onInvalid: F,
|
|
218
|
+
onFocus: (e) => {
|
|
219
|
+
e.nativeEvent.isTrusted ? H.current?.focus() : (e.stopPropagation(), I?.(e));
|
|
220
|
+
},
|
|
221
|
+
onBlur: (e) => {
|
|
222
|
+
e.nativeEvent.isTrusted || (e.stopPropagation(), L?.(e));
|
|
223
|
+
},
|
|
224
|
+
children: z
|
|
225
|
+
})] });
|
|
226
|
+
}
|
|
227
|
+
function O(e) {
|
|
228
|
+
let n = t() ? _(e) : null;
|
|
229
|
+
return n ? /* @__PURE__ */ u(D, {
|
|
230
|
+
...e,
|
|
231
|
+
model: n
|
|
232
|
+
}) : /* @__PURE__ */ u("select", { ...e });
|
|
233
|
+
}
|
|
234
|
+
export { O as ThemedSelect };
|
package/dist/ui.js
CHANGED
|
@@ -31,32 +31,34 @@ import { Label as et } from "./ui/label.js";
|
|
|
31
31
|
import { Popover as tt, PopoverAnchor as nt, PopoverContent as rt, PopoverTrigger as it } from "./ui/popover.js";
|
|
32
32
|
import { ScrollArea as at, ScrollBar as ot } from "./ui/scroll-area.js";
|
|
33
33
|
import { NativeSelect as st, Select as ct, SelectContent as lt, SelectGroup as ut, SelectItem as dt, SelectLabel as ft, SelectScrollDownButton as pt, SelectScrollUpButton as mt, SelectSeparator as ht, SelectTrigger as gt, SelectValue as _t } from "./ui/select.js";
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import {
|
|
44
|
-
import {
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import {
|
|
48
|
-
import {
|
|
49
|
-
import {
|
|
50
|
-
import {
|
|
51
|
-
import {
|
|
52
|
-
import {
|
|
53
|
-
import {
|
|
54
|
-
import {
|
|
55
|
-
import {
|
|
56
|
-
import {
|
|
57
|
-
import {
|
|
58
|
-
import {
|
|
59
|
-
import {
|
|
60
|
-
import {
|
|
61
|
-
import {
|
|
62
|
-
|
|
34
|
+
import { ThemedSelect as vt } from "./ui/themed-select.js";
|
|
35
|
+
import { ThemedSelectProvider as yt, useThemedSelects as bt } from "./ui/themed-select-context.js";
|
|
36
|
+
import { Separator as xt } from "./ui/separator.js";
|
|
37
|
+
import { Sheet as St, SheetClose as Ct, SheetContent as wt, SheetDescription as Tt, SheetFooter as Et, SheetHeader as Dt, SheetTitle as Ot, SheetTrigger as kt } from "./ui/sheet.js";
|
|
38
|
+
import { Skeleton as At } from "./ui/skeleton.js";
|
|
39
|
+
import { Toaster as jt } from "./ui/sonner.js";
|
|
40
|
+
import { Spinner as Mt } from "./ui/spinner.js";
|
|
41
|
+
import { Switch as Nt } from "./ui/switch.js";
|
|
42
|
+
import { Table as Pt, TableBody as Ft, TableCaption as It, TableCell as Lt, TableFooter as Rt, TableHead as zt, TableHeader as Bt, TableRow as Vt } from "./ui/table.js";
|
|
43
|
+
import { Tabs as Ht, TabsContent as Ut, TabsList as Wt, TabsTrigger as Gt } from "./ui/tabs.js";
|
|
44
|
+
import { Textarea as Kt } from "./ui/textarea.js";
|
|
45
|
+
import { Tooltip as qt, TooltipContent as Jt, TooltipProvider as Yt, TooltipTrigger as Xt } from "./ui/tooltip.js";
|
|
46
|
+
import { PageContainer as Zt } from "./ui/page-container.js";
|
|
47
|
+
import { GlassCard as Qt, glassCardVariants as $t } from "./ui/glass-card.js";
|
|
48
|
+
import { EmphasisPanel as en } from "./ui/emphasis-panel.js";
|
|
49
|
+
import { IconTile as tn } from "./ui/icon-tile.js";
|
|
50
|
+
import { ShowMore as nn } from "./ui/show-more.js";
|
|
51
|
+
import { CTAOverflowMenu as rn } from "./ui/cta-overflow-menu.js";
|
|
52
|
+
import { BrandedSplash as an } from "./ui/branded-splash.js";
|
|
53
|
+
import { ModernLanding as on } from "./ui/modern-landing.js";
|
|
54
|
+
import { AuroraBackground as sn } from "./ui/aurora-background.js";
|
|
55
|
+
import { IllustratedEmptyState as cn, Illustration as ln } from "./ui/illustration.js";
|
|
56
|
+
import { GradientText as un } from "./ui/gradient-text.js";
|
|
57
|
+
import { NextSteps as dn, PagePurpose as fn } from "./ui/guidance.js";
|
|
58
|
+
import { NativeWelcome as pn } from "./ui/native-welcome.js";
|
|
59
|
+
import { ActionSheet as mn } from "./ui/action-sheet.js";
|
|
60
|
+
import { OfflineBanner as hn } from "./ui/offline-banner.js";
|
|
61
|
+
import { PullToRefresh as gn } from "./ui/pull-to-refresh.js";
|
|
62
|
+
import { PWAUpdateToast as _n } from "./ui/pwa-update-toast.js";
|
|
63
|
+
import { ModalShell as vn } from "./ui/modal-shell.js";
|
|
64
|
+
export { f as AccessGate, p as AccessNeededChip, e as Accordion, t as AccordionContent, n as AccordionItem, r as AccordionTrigger, mn as ActionSheet, Z as AlertDialog, Q as AlertDialogAction, $ as AlertDialogCancel, ee as AlertDialogContent, te as AlertDialogDescription, ne as AlertDialogFooter, re as AlertDialogHeader, ie as AlertDialogOverlay, ae as AlertDialogPortal, oe as AlertDialogTitle, se as AlertDialogTrigger, sn as AuroraBackground, ce as Badge, h as BottomSheet, g as BottomSheetClose, _ as BottomSheetContent, v as BottomSheetDescription, y as BottomSheetFooter, b as BottomSheetHeader, x as BottomSheetTitle, S as BottomSheetTrigger, an as BrandedSplash, ue as Button, rn as CTAOverflowMenu, fe as Card, pe as CardContent, me as CardDescription, he as CardFooter, ge as CardHeader, _e as CardTitle, ve as Checkbox, ye as Command, be as CommandDialog, xe as CommandEmpty, Se as CommandGroup, Ce as CommandInput, we as CommandItem, Te as CommandList, Ee as CommandSeparator, De as CommandShortcut, P as DEFAULT_GALLERY_PAGER_LABELS, Oe as Dialog, ke as DialogClose, Ae as DialogContent, je as DialogDescription, Me as DialogFooter, Ne as DialogHeader, Pe as DialogOverlay, Fe as DialogPortal, Ie as DialogTitle, Le as DialogTrigger, Re as DropdownMenu, ze as DropdownMenuCheckboxItem, Be as DropdownMenuContent, Ve as DropdownMenuGroup, He as DropdownMenuItem, Ue as DropdownMenuLabel, We as DropdownMenuPortal, Ge as DropdownMenuRadioGroup, Ke as DropdownMenuRadioItem, qe as DropdownMenuSeparator, Je as DropdownMenuShortcut, Ye as DropdownMenuSub, Xe as DropdownMenuSubContent, Ze as DropdownMenuSubTrigger, Qe as DropdownMenuTrigger, en as EmphasisPanel, X as EmptyState, i as EntityIdModal, F as GALLERY_PAGE_SIZE, G as GalleryCategoryRail, K as GalleryChip, N as GalleryPager, q as GalleryPanel, Qt as GlassCard, un as GradientText, tn as IconTile, cn as IllustratedEmptyState, ln as Illustration, $e as Input, et as Label, vn as ModalShell, on as ModernLanding, st as NativeSelect, pn as NativeWelcome, dn as NextSteps, hn as OfflineBanner, o as OptionalFields, _n as PWAUpdateToast, Zt as PageContainer, fn as PagePurpose, l as PageTabs, M as Pagination, tt as Popover, nt as PopoverAnchor, rt as PopoverContent, it as PopoverTrigger, gn as PullToRefresh, C as ResponsiveDialog, w as ResponsiveDialogClose, T as ResponsiveDialogContent, E as ResponsiveDialogDescription, D as ResponsiveDialogFooter, O as ResponsiveDialogHeader, k as ResponsiveDialogTitle, A as ResponsiveDialogTrigger, Y as ResponsiveStack, j as ResponsiveTable, at as ScrollArea, ot as ScrollBar, ct as Select, lt as SelectContent, ut as SelectGroup, dt as SelectItem, ft as SelectLabel, pt as SelectScrollDownButton, mt as SelectScrollUpButton, ht as SelectSeparator, gt as SelectTrigger, _t as SelectValue, xt as Separator, St as Sheet, Ct as SheetClose, wt as SheetContent, Tt as SheetDescription, Et as SheetFooter, Dt as SheetHeader, Ot as SheetTitle, kt as SheetTrigger, nn as ShowMore, c as ShowTechnicalDetails, At as Skeleton, Mt as Spinner, J as Stepper, Nt as Switch, I as TOP_CATEGORY_COUNT, Pt as Table, Ft as TableBody, It as TableCaption, Lt as TableCell, Rt as TableFooter, zt as TableHead, Bt as TableHeader, Vt as TableRow, Ht as Tabs, Ut as TabsContent, Wt as TabsList, Gt as TabsTrigger, Kt as Textarea, vt as ThemedSelect, yt as ThemedSelectProvider, jt as Toaster, qt as Tooltip, Jt as TooltipContent, Yt as TooltipProvider, Xt as TooltipTrigger, le as badgeVariants, de as buttonVariants, L as clampPage, $t as glassCardVariants, u as matchActiveTab, R as offsetForPage, z as pageItems, B as pageRange, V as parsePageParam, H as splitCategories, d as splitTabs, U as totalPagesFor, a as useEntityIdModal, m as useHeadingDocumentTitle, s as useRememberedOpen, bt as useThemedSelects, W as withPageParam };
|
package/package.json
CHANGED
|
@@ -148,6 +148,106 @@
|
|
|
148
148
|
background-color: var(--color-action-primary-bg);
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
+
/* BOFF-15413 — native controls follow the app's theme, not the OS. Opt-in: inert unless
|
|
152
|
+
* the app sets `AppShellConfig.themedNativeControls`, which puts
|
|
153
|
+
* <html data-native-controls="themed"> (ThemeProvider, themedNativeControls.ts); FluidGrids
|
|
154
|
+
* only, today. Another product turns the same look on with that one option.
|
|
155
|
+
*
|
|
156
|
+
* 1. color-scheme. The app's index.html says `color-scheme: dark light` and nothing said
|
|
157
|
+
* which of the two the page is in, so what the browser draws itself (scrollbars, the
|
|
158
|
+
* select menu, date pickers) followed the OS: on a Mac in Dark mode a page in Light got
|
|
159
|
+
* dark scrollbar tracks and a dark system menu. `<html>` now carries the theme's scheme
|
|
160
|
+
* (every element inherits it, portals and popovers included); ThemeProvider also narrows
|
|
161
|
+
* the meta, which is what `color-scheme: normal` (`scheme-normal`) controls read. */
|
|
162
|
+
:root[data-native-controls='themed'] {
|
|
163
|
+
color-scheme: light;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
:root[data-native-controls='themed'].dark {
|
|
167
|
+
color-scheme: dark;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* 2. One scrollbar for every scroll container, in the page and in every portal, popover and
|
|
171
|
+
* menu: the `.scrollbar-slim` + `.scrollbar-box` look the assistant got in BOFF-13461 — a
|
|
172
|
+
* 6px pill thumb mixed from the text colour (it inverts with the theme) on a transparent
|
|
173
|
+
* track, the action colour under the pointer. `:where()` keeps it at the lowest
|
|
174
|
+
* specificity, so `.scrollbar-slim`, `.scrollbar-hover-only`, `.platform-native` and the
|
|
175
|
+
* hidden-scrollbar rails still decide where they are used. The Firefox path stays behind
|
|
176
|
+
* @supports for the reason given above `.scrollbar-slim`. `scrollbar-color` is inherited,
|
|
177
|
+
* so setting it on the root reaches every element that does not set its own;
|
|
178
|
+
* `scrollbar-width` is not, so the thin width goes on every element. That rule sits in the
|
|
179
|
+
* `base` layer, below Tailwind's utilities: a `[scrollbar-width:none]` rail, `.scrollbar-slim`
|
|
180
|
+
* and `.platform-native *` (both unlayered) still win over it. */
|
|
181
|
+
@supports not selector(::-webkit-scrollbar) {
|
|
182
|
+
:root[data-native-controls='themed'] {
|
|
183
|
+
scrollbar-color: color-mix(in oklab, var(--color-text-primary) 52%, transparent) transparent;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
@layer base {
|
|
187
|
+
:root[data-native-controls='themed'],
|
|
188
|
+
:root[data-native-controls='themed'] * {
|
|
189
|
+
scrollbar-width: thin;
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
:where(:root[data-native-controls='themed'], :root[data-native-controls='themed'] *)::-webkit-scrollbar {
|
|
195
|
+
width: 6px;
|
|
196
|
+
height: 6px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
:where(
|
|
200
|
+
:root[data-native-controls='themed'],
|
|
201
|
+
:root[data-native-controls='themed'] *
|
|
202
|
+
)::-webkit-scrollbar-track {
|
|
203
|
+
background: transparent;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
:where(
|
|
207
|
+
:root[data-native-controls='themed'],
|
|
208
|
+
:root[data-native-controls='themed'] *
|
|
209
|
+
)::-webkit-scrollbar-thumb {
|
|
210
|
+
background-color: color-mix(in oklab, var(--color-text-primary) 52%, transparent);
|
|
211
|
+
border-radius: var(--radius-pill);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
:where(
|
|
215
|
+
:root[data-native-controls='themed'],
|
|
216
|
+
:root[data-native-controls='themed'] *
|
|
217
|
+
)::-webkit-scrollbar-thumb:hover {
|
|
218
|
+
background-color: var(--color-action-primary-bg);
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
:where(
|
|
222
|
+
:root[data-native-controls='themed'],
|
|
223
|
+
:root[data-native-controls='themed'] *
|
|
224
|
+
)::-webkit-scrollbar-corner {
|
|
225
|
+
background: transparent;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
/* Inside a floating surface (a menu, popover, select or tooltip), the vertical track keeps
|
|
229
|
+
* clear of the rounded corners, as `.scrollbar-box` does. */
|
|
230
|
+
:where(:root[data-native-controls='themed'] [data-radix-popper-content-wrapper] *)::-webkit-scrollbar-track:vertical {
|
|
231
|
+
margin-block: 10px;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/* 3. The ThemedSelect menu scrolls with the same slim bar as every other menu. Radix Select
|
|
235
|
+
* hides its viewport's scrollbar with an injected `[data-radix-select-viewport]` style;
|
|
236
|
+
* only a viewport that also carries `.scrollbar-slim` (ThemedSelect's) shows it again. */
|
|
237
|
+
[data-radix-select-viewport].scrollbar-slim {
|
|
238
|
+
scrollbar-width: auto;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
@supports not selector(::-webkit-scrollbar) {
|
|
242
|
+
[data-radix-select-viewport].scrollbar-slim {
|
|
243
|
+
scrollbar-width: thin;
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
[data-radix-select-viewport].scrollbar-slim::-webkit-scrollbar {
|
|
248
|
+
display: block;
|
|
249
|
+
}
|
|
250
|
+
|
|
151
251
|
/* Boff UI 2.0 — hover-reveal modifier for .scrollbar-slim.
|
|
152
252
|
*
|
|
153
253
|
* Composes with .scrollbar-slim: the thumb is transparent until the pointer is
|