/* * Kyoo - A portable and vast media library solution. * Copyright (c) Kyoo. * * See AUTHORS.md and LICENSE file in the project root for full license information. * * Kyoo is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * any later version. * * Kyoo is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Kyoo. If not, see . */ import Check from "@material-symbols/svg-400/rounded/check-fill.svg"; import ExpandMore from "@material-symbols/svg-400/rounded/keyboard_arrow_down-fill.svg"; import ExpandLess from "@material-symbols/svg-400/rounded/keyboard_arrow_up-fill.svg"; import * as RSelect from "@radix-ui/react-select"; import { forwardRef } from "react"; import { View } from "react-native"; import { useYoshiki } from "yoshiki"; import { type Theme, px, useYoshiki as useNativeYoshiki } from "yoshiki/native"; import { Icon } from "./icons"; import { PressableFeedback } from "./links"; import { InternalTriger, YoshikiProvider } from "./menu.web"; import { P } from "./text"; import { ContrastArea, SwitchVariant } from "./themes"; import { focusReset, ts } from "./utils"; export const Select = ({ label, value, onValueChange, values, getLabel, }: { label: string; value: string; onValueChange: (v: string) => void; values: string[]; getLabel: (key: string) => string; }) => { const { css: wCss } = useYoshiki(); const { css } = useNativeYoshiki(); return ( theme.accent, borderWidth: ts(0.5), fover: { self: { bg: (theme: Theme) => theme.accent }, text: { color: (theme: Theme) => theme.colors.white }, }, })} >

{}

{({ css }) => ( theme.background, overflow: "auto", minWidth: "220px", borderRadius: "8px", boxShadow: "0px 10px 38px -10px rgba(22, 23, 24, 0.35), 0px 10px 20px -15px rgba(22, 23, 24, 0.2)", zIndex: 2, maxHeight: "calc(var(--radix-dropdown-menu-content-available-height) * 0.8)", })} > {values.map((x) => ( ))} )}
); }; const Item = forwardRef(function Item( { label, value, ...props }, ref, ) { const { css, theme } = useYoshiki(); const { css: nCss } = useNativeYoshiki(); return ( <> theme.paragraph, borderRadius: "4px", position: "relative", userSelect: "none", ...focusReset, }, props as any, )} > theme.paragraph })}>{label} ); });