@uselets/ui 2.0.1 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/{as-child-Dxg3Xo1G.d.ts → as-child-T9W73ZYU.d.ts} +1 -3
- package/dist/{chart-B_6nC_ih.d.ts → chart-8rgtsk95.d.ts} +1 -3
- package/dist/checkbox-group-context-HDVxTNPi.js +2 -0
- package/dist/checkbox-group-context-HDVxTNPi.js.map +1 -0
- package/dist/cli/uselets.mjs.map +1 -1
- package/dist/combobox-styles-CZ0aJayc.js +2 -0
- package/dist/combobox-styles-CZ0aJayc.js.map +1 -0
- package/dist/components/accordion.d.ts +1 -3
- package/dist/components/accordion.js.map +1 -1
- package/dist/components/alert-dialog.d.ts +1 -3
- package/dist/components/alert-dialog.js.map +1 -1
- package/dist/components/alert.d.ts +0 -2
- package/dist/components/alert.js.map +1 -1
- package/dist/components/anchor.d.ts +1 -3
- package/dist/components/anchor.js.map +1 -1
- package/dist/components/area-chart.d.ts +1 -3
- package/dist/components/area-chart.js.map +1 -1
- package/dist/components/autocomplete.d.ts +46 -0
- package/dist/components/autocomplete.js +2 -0
- package/dist/components/autocomplete.js.map +1 -0
- package/dist/components/avatar.d.ts +1 -3
- package/dist/components/avatar.js.map +1 -1
- package/dist/components/badge.d.ts +1 -3
- package/dist/components/badge.js +1 -1
- package/dist/components/badge.js.map +1 -1
- package/dist/components/bar-chart.d.ts +1 -3
- package/dist/components/bar-chart.js.map +1 -1
- package/dist/components/bottom-nav.d.ts +1 -3
- package/dist/components/bottom-nav.js.map +1 -1
- package/dist/components/breadcrumb.d.ts +1 -3
- package/dist/components/breadcrumb.js.map +1 -1
- package/dist/components/button-group.d.ts +1 -3
- package/dist/components/button-group.js.map +1 -1
- package/dist/components/button.d.ts +1 -3
- package/dist/components/button.js +1 -1
- package/dist/components/button.js.map +1 -1
- package/dist/components/calendar.d.ts +0 -2
- package/dist/components/calendar.js +1 -1
- package/dist/components/calendar.js.map +1 -1
- package/dist/components/card.d.ts +0 -2
- package/dist/components/card.js.map +1 -1
- package/dist/components/carousel.d.ts +0 -2
- package/dist/components/carousel.js.map +1 -1
- package/dist/components/center.d.ts +0 -2
- package/dist/components/center.js.map +1 -1
- package/dist/components/chart.d.ts +1 -1
- package/dist/components/chart.js.map +1 -1
- package/dist/components/checkbox-group.d.ts +19 -0
- package/dist/components/checkbox-group.js +2 -0
- package/dist/components/checkbox-group.js.map +1 -0
- package/dist/components/checkbox.d.ts +2 -4
- package/dist/components/checkbox.js +1 -1
- package/dist/components/checkbox.js.map +1 -1
- package/dist/components/code.d.ts +0 -2
- package/dist/components/code.js.map +1 -1
- package/dist/components/collapsible.d.ts +1 -3
- package/dist/components/collapsible.js.map +1 -1
- package/dist/components/combobox.d.ts +1 -3
- package/dist/components/combobox.js +1 -1
- package/dist/components/combobox.js.map +1 -1
- package/dist/components/command.d.ts +0 -2
- package/dist/components/command.js +1 -1
- package/dist/components/command.js.map +1 -1
- package/dist/components/container.d.ts +0 -2
- package/dist/components/container.js.map +1 -1
- package/dist/components/data-table.d.ts +0 -2
- package/dist/components/data-table.js +1 -1
- package/dist/components/data-table.js.map +1 -1
- package/dist/components/date-range-picker.d.ts +0 -2
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/dialog.d.ts +1 -3
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/direction.d.ts +0 -2
- package/dist/components/donut-chart.d.ts +0 -2
- package/dist/components/donut-chart.js.map +1 -1
- package/dist/components/drawer.d.ts +1 -3
- package/dist/components/drawer.js.map +1 -1
- package/dist/components/dropdown-menu.d.ts +1 -3
- package/dist/components/dropdown-menu.js.map +1 -1
- package/dist/components/dropzone.d.ts +0 -2
- package/dist/components/dropzone.js +1 -1
- package/dist/components/dropzone.js.map +1 -1
- package/dist/components/empty.d.ts +0 -2
- package/dist/components/empty.js.map +1 -1
- package/dist/components/field.d.ts +0 -2
- package/dist/components/field.js +1 -1
- package/dist/components/field.js.map +1 -1
- package/dist/components/flex.d.ts +0 -2
- package/dist/components/flex.js.map +1 -1
- package/dist/components/grid.d.ts +0 -2
- package/dist/components/grid.js.map +1 -1
- package/dist/components/group.d.ts +0 -2
- package/dist/components/group.js.map +1 -1
- package/dist/components/heading.d.ts +1 -3
- package/dist/components/heading.js.map +1 -1
- package/dist/components/hover-card.d.ts +1 -3
- package/dist/components/hover-card.js.map +1 -1
- package/dist/components/input-group.d.ts +0 -2
- package/dist/components/input-group.js.map +1 -1
- package/dist/components/input-otp.d.ts +0 -2
- package/dist/components/input-otp.js.map +1 -1
- package/dist/components/input.d.ts +0 -2
- package/dist/components/input.js.map +1 -1
- package/dist/components/kbd.d.ts +0 -2
- package/dist/components/kbd.js.map +1 -1
- package/dist/components/label.d.ts +1 -3
- package/dist/components/label.js.map +1 -1
- package/dist/components/list.d.ts +1 -3
- package/dist/components/list.js.map +1 -1
- package/dist/components/logo.d.ts +0 -2
- package/dist/components/marker.d.ts +1 -3
- package/dist/components/marker.js.map +1 -1
- package/dist/components/mask-input.d.ts +1 -3
- package/dist/components/mask-input.js +1 -1
- package/dist/components/mask-input.js.map +1 -1
- package/dist/components/meter.d.ts +21 -0
- package/dist/components/meter.js +2 -0
- package/dist/components/meter.js.map +1 -0
- package/dist/components/native-select.d.ts +0 -2
- package/dist/components/native-select.js.map +1 -1
- package/dist/components/navigation-menu.d.ts +1 -3
- package/dist/components/navigation-menu.js.map +1 -1
- package/dist/components/number-field.d.ts +1 -3
- package/dist/components/number-field.js +1 -1
- package/dist/components/number-field.js.map +1 -1
- package/dist/components/pagination.d.ts +0 -2
- package/dist/components/pagination.js.map +1 -1
- package/dist/components/phone-input.d.ts +0 -2
- package/dist/components/phone-input.js +1 -1
- package/dist/components/phone-input.js.map +1 -1
- package/dist/components/pie-chart.d.ts +1 -3
- package/dist/components/pie-chart.js.map +1 -1
- package/dist/components/popover.d.ts +1 -3
- package/dist/components/popover.js.map +1 -1
- package/dist/components/progress.d.ts +0 -2
- package/dist/components/progress.js +1 -1
- package/dist/components/progress.js.map +1 -1
- package/dist/components/radio-group.d.ts +0 -2
- package/dist/components/radio-group.js +1 -1
- package/dist/components/radio-group.js.map +1 -1
- package/dist/components/resizable.d.ts +0 -2
- package/dist/components/resizable.js.map +1 -1
- package/dist/components/ring-progress.d.ts +0 -2
- package/dist/components/ring-progress.js +1 -1
- package/dist/components/ring-progress.js.map +1 -1
- package/dist/components/scroll-area.d.ts +0 -2
- package/dist/components/scroll-area.js.map +1 -1
- package/dist/components/select.d.ts +1 -3
- package/dist/components/select.js.map +1 -1
- package/dist/components/separator.d.ts +1 -3
- package/dist/components/separator.js.map +1 -1
- package/dist/components/sidebar.d.ts +2 -4
- package/dist/components/sidebar.js +1 -1
- package/dist/components/sidebar.js.map +1 -1
- package/dist/components/simple-grid.d.ts +0 -2
- package/dist/components/simple-grid.js.map +1 -1
- package/dist/components/skeleton.d.ts +0 -2
- package/dist/components/skeleton.js.map +1 -1
- package/dist/components/slider.d.ts +0 -2
- package/dist/components/slider.js.map +1 -1
- package/dist/components/sonner.d.ts +0 -2
- package/dist/components/sonner.js.map +1 -1
- package/dist/components/spinner.d.ts +0 -2
- package/dist/components/spinner.js.map +1 -1
- package/dist/components/stack.d.ts +0 -2
- package/dist/components/stack.js.map +1 -1
- package/dist/components/stepper.d.ts +1 -3
- package/dist/components/stepper.js +1 -1
- package/dist/components/stepper.js.map +1 -1
- package/dist/components/switch.d.ts +0 -2
- package/dist/components/switch.js +1 -1
- package/dist/components/switch.js.map +1 -1
- package/dist/components/table.d.ts +0 -2
- package/dist/components/table.js.map +1 -1
- package/dist/components/tabs.d.ts +1 -3
- package/dist/components/tabs.js.map +1 -1
- package/dist/components/text.d.ts +1 -3
- package/dist/components/text.js.map +1 -1
- package/dist/components/textarea.d.ts +0 -2
- package/dist/components/textarea.js.map +1 -1
- package/dist/components/theme.d.ts +0 -2
- package/dist/components/theme.js.map +1 -1
- package/dist/components/timeline.d.ts +0 -2
- package/dist/components/timeline.js.map +1 -1
- package/dist/components/toggle-group.d.ts +1 -3
- package/dist/components/toggle-group.js.map +1 -1
- package/dist/components/toggle.d.ts +1 -3
- package/dist/components/toggle.js +1 -1
- package/dist/components/toggle.js.map +1 -1
- package/dist/components/toolbar.d.ts +30 -0
- package/dist/components/toolbar.js +2 -0
- package/dist/components/toolbar.js.map +1 -0
- package/dist/components/tooltip.d.ts +1 -3
- package/dist/components/tooltip.js.map +1 -1
- package/dist/components/unstyled-button.d.ts +1 -3
- package/dist/components/unstyled-button.js.map +1 -1
- package/dist/components/visibility.d.ts +0 -2
- package/dist/components/visibility.js.map +1 -1
- package/dist/hooks/use-breakpoint-value.d.ts +0 -2
- package/dist/hooks/use-breakpoint-value.js.map +1 -1
- package/dist/hooks/use-breakpoint.d.ts +0 -2
- package/dist/hooks/use-breakpoint.js.map +1 -1
- package/dist/hooks/use-disclosure.d.ts +0 -2
- package/dist/hooks/use-disclosure.js.map +1 -1
- package/dist/hooks/use-document-visibility.d.ts +0 -2
- package/dist/hooks/use-document-visibility.js.map +1 -1
- package/dist/hooks/use-hotkeys.d.ts +1 -1
- package/dist/hooks/use-idle.d.ts +0 -2
- package/dist/hooks/use-idle.js.map +1 -1
- package/dist/hooks/use-interval.d.ts +0 -2
- package/dist/hooks/use-interval.js.map +1 -1
- package/dist/hooks/use-local-storage.d.ts +0 -2
- package/dist/hooks/use-local-storage.js.map +1 -1
- package/dist/hooks/use-mask.d.ts +0 -2
- package/dist/hooks/use-mask.js.map +1 -1
- package/dist/hooks/use-mobile.d.ts +0 -2
- package/dist/hooks/use-mobile.js.map +1 -1
- package/dist/index.d.ts +21 -17
- package/dist/index.js +1 -1
- package/dist/lib/as-child.d.ts +1 -1
- package/dist/lib/as-child.js.map +1 -1
- package/dist/lib/badge.d.ts +0 -2
- package/dist/lib/badge.js.map +1 -1
- package/dist/lib/button.d.ts +0 -2
- package/dist/lib/button.js.map +1 -1
- package/dist/lib/color.d.ts +0 -2
- package/dist/lib/color.js.map +1 -1
- package/dist/lib/compose-refs.d.ts +0 -2
- package/dist/lib/compose-refs.js.map +1 -1
- package/dist/lib/progress.d.ts +0 -2
- package/dist/lib/progress.js.map +1 -1
- package/dist/lib/utils.d.ts +0 -2
- package/dist/lib/utils.js.map +1 -1
- package/dist/logo--R3_XDgA.js.map +1 -1
- package/dist/postcss.config.js.map +1 -1
- package/dist/resolve-class-name-BurP8ngI.js.map +1 -1
- package/dist/skills/uselets-ui/SKILL.md +3 -3
- package/dist/skills/uselets-ui/references/component-catalog.md +14 -2
- package/dist/skills/uselets-ui/references/package-guide.md +3 -3
- package/dist/{use-hotkeys-D1_TEIwN.d.ts → use-hotkeys-BVm0IGb8.d.ts} +1 -5
- package/dist/use-hotkeys-YDJmGWX6.js.map +1 -1
- package/package.json +14 -14
- package/skills/uselets-ui/SKILL.md +3 -3
- package/skills/uselets-ui/references/component-catalog.md +14 -2
- package/skills/uselets-ui/references/package-guide.md +3 -3
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{Combobox as n,ComboboxContent as r,ComboboxEmpty as i,ComboboxInput as a,ComboboxItem as o,ComboboxList as s,ComboboxSeparator as c,ComboboxTrigger as l,ComboboxValue as u}from"./combobox.js";import{useFieldInvalid as d}from"./field.js";import{Input as f}from"./input.js";import{ScrollArea as p}from"./scroll-area.js";import{IconWorld as m}from"@tabler/icons-react";import{createContext as h,useContext as g,useMemo as _,useState as v}from"react";import{jsx as y,jsxs as b}from"react/jsx-runtime";import*as x from"react-phone-number-input";import S from"react-phone-number-input/flags";const C=h({popupClassName:void 0,scrollAreaClassName:void 0});function PhoneInput({className:t,popupClassName:n,scrollAreaClassName:r,onChange:i,value:a,...o}){let s=d(o[`aria-invalid`]);return/* @__PURE__ */ y(C.Provider,{value:{popupClassName:n,scrollAreaClassName:r},children:/* @__PURE__ */ y(x.default,{className:e(`flex`,s&&s!==`false`&&`[&_*[data-slot=combobox-trigger]]:border-destructive [&_*[data-slot=combobox-trigger]]:ring-destructive/50`,t),flagComponent:FlagComponent,countrySelectComponent:CountrySelect,inputComponent:InputComponent,smartCaret:!1,defaultCountry:`BR`,value:a||void 0,onChange:e=>i?.(e||``),...o})})}function InputComponent({className:t,...n}){return/* @__PURE__ */ y(f,{className:e(`rounded-s-none focus:z-1`,t),...n})}function CountrySelect({disabled:d,value:f,options:m,onChange:h}){let{popupClassName:S}=g(C),[w,T]=v(``),E=_(()=>w?m.filter(({label:e})=>e.toLowerCase().includes(w.toLowerCase())):m,[m,w]);return/* @__PURE__ */ b(n,{items:E,value:f||``,onValueChange:e=>{e&&h(e)},children:[/* @__PURE__ */ y(l,{asChild:!0,children:/* @__PURE__ */ b(t,{variant:`outline`,color:`zinc`,className:e(`flex h-8 items-center gap-1 rounded-s-lg rounded-e-none border-e-0 border-input px-2.5 py-0 leading-none dark:bg-input/30`,`hover:bg-transparent focus:z-10 data-pressed:bg-transparent`,d&&`opacity-50`),disabled:d,children:[/* @__PURE__ */ y(`span`,{className:`sr-only`,children:/* @__PURE__ */ y(u,{})}),/* @__PURE__ */ y(FlagComponent,{country:f,countryName:f})]})}),/* @__PURE__ */ b(r,{className:e(`w-xs *:data-[slot=input-group]:bg-transparent`,S),children:[/* @__PURE__ */ y(a,{placeholder:`e.g. United States`,value:w,onChange:e=>T(e.target.value),showTrigger:!1,className:`border-input focus-visible:border-border rounded-none border-0 px-0 py-2.5 shadow-none ring-0! outline-none! focus-visible:ring-0 focus-visible:ring-offset-0`}),/* @__PURE__ */ y(c,{}),/* @__PURE__ */ y(i,{className:`px-4 py-2.5 text-sm`,children:`Nenhum país encontrado.`}),/* @__PURE__ */ y(s,{className:`max-h-none overflow-visible`,children:/* @__PURE__ */ y(`div`,{className:`relative flex max-h-full`,children:/* @__PURE__ */ y(`div`,{className:`flex max-h-[min(calc(var(--available-height)-(--spacing(9))),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain`,children:/* @__PURE__ */ y(p,{className:`size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain`,children:E.map(e=>e.value?/* @__PURE__ */ b(o,{value:e.value,className:`flex items-center gap-2`,children:[/* @__PURE__ */ y(FlagComponent,{country:e.value,countryName:e.label}),/* @__PURE__ */ y(`span`,{className:`flex-1 text-sm`,children:e.label}),/* @__PURE__ */ y(`span`,{className:`text-foreground/50 text-sm`,children:`+${x.getCountryCallingCode(e.value)}`})]},e.value):null)})})})})]})]})}function FlagComponent({country:e,countryName:t}){let n=S[e];return/* @__PURE__ */ y(`span`,{className:`flex h-4 w-4 items-center justify-center [&_svg:not([class*='size-'])]:size-full! [&_svg:not([class*='size-'])]:rounded-[5px]`,children:n?/* @__PURE__ */ y(n,{title:t}):/* @__PURE__ */ y(m,{className:`size-4 opacity-60`})})}export{PhoneInput};
|
|
2
2
|
//# sourceMappingURL=phone-input.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"phone-input.js","names":["BasePhoneInput","flags","PhoneInputContext","createContext","props","invalid","useFieldInvalid","cn","className","value","onChange","Input","selectedCountry","countryList","useContext","searchValue","setSearchValue","useState","filteredCountries","useMemo","label","Combobox","country","ComboboxTrigger","Button","disabled","ComboboxValue","ComboboxContent","popupClassName","ComboboxInput","ComboboxSeparator","ComboboxEmpty","ComboboxList","ScrollArea","item","ComboboxItem","Flag","countryName","IconWorld"],"sources":["../../src/components/phone-input.tsx"],"sourcesContent":["import { type ComponentProps, createContext, useContext, useMemo, useState } from 'react'\nimport * as BasePhoneInput from 'react-phone-number-input'\nimport flags from 'react-phone-number-input/flags'\n\nimport { IconWorld } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport {\n Combobox,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue\n} from './combobox'\nimport { useFieldInvalid } from './field'\nimport { Input } from './input'\nimport { ScrollArea } from './scroll-area'\n\nconst PhoneInputContext = createContext<{\n popupClassName?: string\n scrollAreaClassName?: string\n}>({\n popupClassName: undefined,\n scrollAreaClassName: undefined\n})\n\nexport type PhoneInputProps = Omit<ComponentProps<'input'>, 'onChange' | 'value' | 'ref'> &\n Omit<BasePhoneInput.Props<typeof BasePhoneInput.default>, 'onChange' | 'popupClassName' | 'scrollAreaClassName'> & {\n /** Called with the number in E.164 format, or an empty string when the input is cleared. */\n onChange?: (value: BasePhoneInput.Value) => void\n /** Classes for the country list popup. */\n popupClassName?: string\n /** Classes for the scrollable area of the country list. */\n scrollAreaClassName?: string\n }\n\nexport type PhoneInputValue = BasePhoneInput.Value\nexport type PhoneInputCountry = BasePhoneInput.Country\nexport type PhoneInputLabels = BasePhoneInput.Labels\n\nfunction PhoneInput({ className, popupClassName, scrollAreaClassName, onChange, value, ...props }: PhoneInputProps) {\n const invalid = useFieldInvalid(props['aria-invalid'])\n\n return (\n <PhoneInputContext.Provider value={{ popupClassName, scrollAreaClassName }}>\n <BasePhoneInput.default\n className={cn(\n 'flex',\n invalid &&\n invalid !== 'false' &&\n '[&_*[data-slot=combobox-trigger]]:border-destructive [&_*[data-slot=combobox-trigger]]:ring-destructive/50',\n className\n )}\n flagComponent={FlagComponent}\n countrySelectComponent={CountrySelect}\n inputComponent={InputComponent}\n smartCaret={false}\n defaultCountry=\"BR\"\n value={value || undefined}\n onChange={(value) => onChange?.(value || ('' as BasePhoneInput.Value))}\n {...props}\n />\n </PhoneInputContext.Provider>\n )\n}\n\nfunction InputComponent({ className, ...props }: ComponentProps<typeof Input>) {\n return <Input className={cn('rounded-s-none focus:z-1', className)} {...props} />\n}\n\ntype CountryEntry = { label: string; value: BasePhoneInput.Country | undefined }\n\ntype CountrySelectProps = {\n disabled?: boolean\n value: BasePhoneInput.Country\n options: CountryEntry[]\n onChange: (country: BasePhoneInput.Country) => void\n}\n\nfunction CountrySelect({ disabled, value: selectedCountry, options: countryList, onChange }: CountrySelectProps) {\n const { popupClassName } = useContext(PhoneInputContext)\n const [searchValue, setSearchValue] = useState('')\n\n const filteredCountries = useMemo(() => {\n if (!searchValue) return countryList\n return countryList.filter(({ label }) => label.toLowerCase().includes(searchValue.toLowerCase()))\n }, [countryList, searchValue])\n\n return (\n <Combobox\n items={filteredCountries}\n value={selectedCountry || ''}\n onValueChange={(country: BasePhoneInput.Country | null) => {\n if (country) {\n onChange(country)\n }\n }}\n >\n <ComboboxTrigger asChild>\n <Button\n variant=\"outline\"\n color=\"zinc\"\n className={cn(\n 'flex h-8 items-center gap-1 rounded-s-lg rounded-e-none border-e-0 border-input px-2.5 py-0 leading-none dark:bg-input/30',\n 'hover:bg-transparent focus:z-10 data-pressed:bg-transparent',\n disabled && 'opacity-50'\n )}\n disabled={disabled}\n >\n <span className=\"sr-only\">\n <ComboboxValue />\n </span>\n <FlagComponent country={selectedCountry} countryName={selectedCountry} />\n </Button>\n </ComboboxTrigger>\n <ComboboxContent className={cn('w-xs *:data-[slot=input-group]:bg-transparent', popupClassName)}>\n <ComboboxInput\n placeholder=\"e.g. United States\"\n value={searchValue}\n onChange={(e) => setSearchValue(e.target.value)}\n showTrigger={false}\n className=\"border-input focus-visible:border-border rounded-none border-0 px-0 py-2.5 shadow-none ring-0! outline-none! focus-visible:ring-0 focus-visible:ring-offset-0\"\n />\n <ComboboxSeparator />\n <ComboboxEmpty className=\"px-4 py-2.5 text-sm\">Nenhum país encontrado.</ComboboxEmpty>\n <ComboboxList className=\"max-h-none overflow-visible\">\n <div className=\"relative flex max-h-full\">\n <div className=\"flex max-h-[min(calc(var(--available-height)-(--spacing(9))),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain\">\n <ScrollArea className=\"size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain\">\n {filteredCountries.map((item: CountryEntry) =>\n item.value ? (\n <ComboboxItem key={item.value} value={item.value} className=\"flex items-center gap-2\">\n <FlagComponent country={item.value} countryName={item.label} />\n <span className=\"flex-1 text-sm\">{item.label}</span>\n <span className=\"text-foreground/50 text-sm\">\n {`+${BasePhoneInput.getCountryCallingCode(item.value)}`}\n </span>\n </ComboboxItem>\n ) : null\n )}\n </ScrollArea>\n </div>\n </div>\n </ComboboxList>\n </ComboboxContent>\n </Combobox>\n )\n}\n\nfunction FlagComponent({ country, countryName }: BasePhoneInput.FlagProps) {\n const Flag = flags[country]\n\n return (\n <span className=\"flex h-4 w-4 items-center justify-center [&_svg:not([class*='size-'])]:size-full! [&_svg:not([class*='size-'])]:rounded-[5px]\">\n {Flag ? <Flag title={countryName} /> : <IconWorld className=\"size-4 opacity-60\" />}\n </span>\n )\n}\n\nexport { PhoneInput }\n"],"mappings":"msBAuBA,MAAME,EAAoBC,EAGvB,CACD,eAAgB,IAAA,GAChB,oBAAqB,IAAA,EACvB,CAAC,EAgBD,SAAS,WAAW,CAAE,YAAW,iBAAgB,sBAAqB,WAAU,QAAO,GAAGC,GAA0B,CAClH,IAAMC,EAAUC,EAAgBF,EAAM,eAAe,EAErD,MACE,kBAACF,EAAkB,SAAnB,CAA4B,MAAO,CAAE,iBAAgB,qBAAoB,EACvE,SAAA,kBAACF,EAAe,QAAhB,CACE,UAAWO,EACT,OACAF,GACEA,IAAY,SACZ,6GACFG,CACF,EACA,cAAe,cACf,uBAAwB,cACxB,eAAgB,eAChB,WAAY,GACZ,eAAe,KACf,MAAOC,GAAS,IAAA,GAChB,SAAW,GAAUC,IAAWD,GAAU,EAA2B,EACrE,GAAIL,CACL,CAAA,CACyB,CAAA,CAEhC,CAEA,SAAS,eAAe,CAAE,YAAW,GAAGA,GAAuC,CAC7E,MAAO,kBAACO,EAAD,CAAO,UAAWJ,EAAG,2BAA4BC,CAAS,EAAG,GAAIJ,CAAQ,CAAA,CAClF,CAWA,SAAS,cAAc,CAAE,WAAU,MAAOQ,EAAiB,QAASC,EAAa,YAAgC,CAC/G,GAAM,CAAE,kBAAmBC,EAAWZ,CAAiB,EACjD,CAACa,EAAaC,GAAkBC,EAAS,EAAE,EAE3CC,EAAoBC,MACnBJ,EACEF,EAAY,QAAQ,CAAE,WAAYO,EAAM,YAAY,CAAC,CAAC,SAASL,EAAY,YAAY,CAAC,CAAC,EADvEF,EAExB,CAACA,EAAaE,CAAW,CAAC,EAE7B,MACE,kBAACM,EAAD,CACE,MAAOH,EACP,MAAON,GAAmB,GAC1B,cAAgB,GAA2C,CACrDU,GACFZ,EAASY,CAAO,CAEpB,EAPF,SAAA,CASE,kBAACC,EAAD,CAAiB,QAAA,GACf,SAAA,kBAACC,EAAD,CACE,QAAQ,UACR,MAAM,OACN,UAAWjB,EACT,4HACA,8DACAkB,GAAY,YACd,EACU,WARZ,SAAA,CAUE,kBAAC,OAAD,CAAM,UAAU,UACd,SAAA,kBAACC,EAAD,CAAgB,CAAA,CACZ,CAAA,EACN,kBAAC,cAAD,CAAe,QAASd,EAAiB,YAAaA,CAAkB,CAAA,CAClE,
|
|
1
|
+
{"version":3,"file":"phone-input.js","names":["BasePhoneInput","flags","PhoneInputContext","createContext","props","invalid","useFieldInvalid","cn","className","value","onChange","Input","selectedCountry","countryList","useContext","searchValue","setSearchValue","useState","filteredCountries","useMemo","label","Combobox","country","ComboboxTrigger","Button","disabled","ComboboxValue","ComboboxContent","popupClassName","ComboboxInput","ComboboxSeparator","ComboboxEmpty","ComboboxList","ScrollArea","item","ComboboxItem","Flag","countryName","IconWorld"],"sources":["../../src/components/phone-input.tsx"],"sourcesContent":["import { type ComponentProps, createContext, useContext, useMemo, useState } from 'react'\nimport * as BasePhoneInput from 'react-phone-number-input'\nimport flags from 'react-phone-number-input/flags'\n\nimport { IconWorld } from '@tabler/icons-react'\n\nimport { cn } from '../lib/utils'\nimport { Button } from './button'\nimport {\n Combobox,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxSeparator,\n ComboboxTrigger,\n ComboboxValue\n} from './combobox'\nimport { useFieldInvalid } from './field'\nimport { Input } from './input'\nimport { ScrollArea } from './scroll-area'\n\nconst PhoneInputContext = createContext<{\n popupClassName?: string\n scrollAreaClassName?: string\n}>({\n popupClassName: undefined,\n scrollAreaClassName: undefined\n})\n\nexport type PhoneInputProps = Omit<ComponentProps<'input'>, 'onChange' | 'value' | 'ref'> &\n Omit<BasePhoneInput.Props<typeof BasePhoneInput.default>, 'onChange' | 'popupClassName' | 'scrollAreaClassName'> & {\n /** Called with the number in E.164 format, or an empty string when the input is cleared. */\n onChange?: (value: BasePhoneInput.Value) => void\n /** Classes for the country list popup. */\n popupClassName?: string\n /** Classes for the scrollable area of the country list. */\n scrollAreaClassName?: string\n }\n\nexport type PhoneInputValue = BasePhoneInput.Value\nexport type PhoneInputCountry = BasePhoneInput.Country\nexport type PhoneInputLabels = BasePhoneInput.Labels\n\nfunction PhoneInput({ className, popupClassName, scrollAreaClassName, onChange, value, ...props }: PhoneInputProps) {\n const invalid = useFieldInvalid(props['aria-invalid'])\n\n return (\n <PhoneInputContext.Provider value={{ popupClassName, scrollAreaClassName }}>\n <BasePhoneInput.default\n className={cn(\n 'flex',\n invalid &&\n invalid !== 'false' &&\n '[&_*[data-slot=combobox-trigger]]:border-destructive [&_*[data-slot=combobox-trigger]]:ring-destructive/50',\n className\n )}\n flagComponent={FlagComponent}\n countrySelectComponent={CountrySelect}\n inputComponent={InputComponent}\n smartCaret={false}\n defaultCountry=\"BR\"\n value={value || undefined}\n onChange={(value) => onChange?.(value || ('' as BasePhoneInput.Value))}\n {...props}\n />\n </PhoneInputContext.Provider>\n )\n}\n\nfunction InputComponent({ className, ...props }: ComponentProps<typeof Input>) {\n return <Input className={cn('rounded-s-none focus:z-1', className)} {...props} />\n}\n\ntype CountryEntry = { label: string; value: BasePhoneInput.Country | undefined }\n\ntype CountrySelectProps = {\n disabled?: boolean\n value: BasePhoneInput.Country\n options: CountryEntry[]\n onChange: (country: BasePhoneInput.Country) => void\n}\n\nfunction CountrySelect({ disabled, value: selectedCountry, options: countryList, onChange }: CountrySelectProps) {\n const { popupClassName } = useContext(PhoneInputContext)\n const [searchValue, setSearchValue] = useState('')\n\n const filteredCountries = useMemo(() => {\n if (!searchValue) return countryList\n return countryList.filter(({ label }) => label.toLowerCase().includes(searchValue.toLowerCase()))\n }, [countryList, searchValue])\n\n return (\n <Combobox\n items={filteredCountries}\n value={selectedCountry || ''}\n onValueChange={(country: BasePhoneInput.Country | null) => {\n if (country) {\n onChange(country)\n }\n }}\n >\n <ComboboxTrigger asChild>\n <Button\n variant=\"outline\"\n color=\"zinc\"\n className={cn(\n 'flex h-8 items-center gap-1 rounded-s-lg rounded-e-none border-e-0 border-input px-2.5 py-0 leading-none dark:bg-input/30',\n 'hover:bg-transparent focus:z-10 data-pressed:bg-transparent',\n disabled && 'opacity-50'\n )}\n disabled={disabled}\n >\n <span className=\"sr-only\">\n <ComboboxValue />\n </span>\n <FlagComponent country={selectedCountry} countryName={selectedCountry} />\n </Button>\n </ComboboxTrigger>\n <ComboboxContent className={cn('w-xs *:data-[slot=input-group]:bg-transparent', popupClassName)}>\n <ComboboxInput\n placeholder=\"e.g. United States\"\n value={searchValue}\n onChange={(e) => setSearchValue(e.target.value)}\n showTrigger={false}\n className=\"border-input focus-visible:border-border rounded-none border-0 px-0 py-2.5 shadow-none ring-0! outline-none! focus-visible:ring-0 focus-visible:ring-offset-0\"\n />\n <ComboboxSeparator />\n <ComboboxEmpty className=\"px-4 py-2.5 text-sm\">Nenhum país encontrado.</ComboboxEmpty>\n <ComboboxList className=\"max-h-none overflow-visible\">\n <div className=\"relative flex max-h-full\">\n <div className=\"flex max-h-[min(calc(var(--available-height)-(--spacing(9))),24rem)] w-full scroll-pt-2 scroll-pb-2 flex-col overscroll-contain\">\n <ScrollArea className=\"size-full min-h-0 **:data-[slot=scroll-area-scrollbar]:m-0 **:data-[slot=scroll-area-viewport]:h-full **:data-[slot=scroll-area-viewport]:overscroll-contain\">\n {filteredCountries.map((item: CountryEntry) =>\n item.value ? (\n <ComboboxItem key={item.value} value={item.value} className=\"flex items-center gap-2\">\n <FlagComponent country={item.value} countryName={item.label} />\n <span className=\"flex-1 text-sm\">{item.label}</span>\n <span className=\"text-foreground/50 text-sm\">\n {`+${BasePhoneInput.getCountryCallingCode(item.value)}`}\n </span>\n </ComboboxItem>\n ) : null\n )}\n </ScrollArea>\n </div>\n </div>\n </ComboboxList>\n </ComboboxContent>\n </Combobox>\n )\n}\n\nfunction FlagComponent({ country, countryName }: BasePhoneInput.FlagProps) {\n const Flag = flags[country]\n\n return (\n <span className=\"flex h-4 w-4 items-center justify-center [&_svg:not([class*='size-'])]:size-full! [&_svg:not([class*='size-'])]:rounded-[5px]\">\n {Flag ? <Flag title={countryName} /> : <IconWorld className=\"size-4 opacity-60\" />}\n </span>\n )\n}\n\nexport { PhoneInput }\n"],"mappings":"A,msBAuBA,MAAME,EAAoBC,EAGvB,CACD,eAAgB,IAAA,GAChB,oBAAqB,IAAA,EACvB,CAAC,EAgBD,SAAS,WAAW,CAAE,YAAW,iBAAgB,sBAAqB,WAAU,QAAO,GAAGC,GAA0B,CAClH,IAAMC,EAAUC,EAAgBF,EAAM,eAAe,EAErD,MACE,kBAACF,EAAkB,SAAnB,CAA4B,MAAO,CAAE,iBAAgB,qBAAoB,EACvE,SAAA,kBAACF,EAAe,QAAhB,CACE,UAAWO,EACT,OACAF,GACEA,IAAY,SACZ,6GACFG,CACF,EACA,cAAe,cACf,uBAAwB,cACxB,eAAgB,eAChB,WAAY,GACZ,eAAe,KACf,MAAOC,GAAS,IAAA,GAChB,SAAW,GAAUC,IAAWD,GAAU,EAA2B,EACrE,GAAIL,CACL,CAAA,CACyB,CAAA,CAEhC,CAEA,SAAS,eAAe,CAAE,YAAW,GAAG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C,EAAD,CAAY,UAAU,+JACnB,SAAAf,EAAkB,IAAK,GACtBgB,EAAK,MACH,kBAACC,EAAD,CAA+B,MAAOD,EAAK,MAAO,UAAU,0BAA5D,SAAA,CACE,kBAAC,cAAD,CAAe,QAASA,EAAK,MAAO,YAAaA,EAAK,KAAQ,CAAA,EAC9D,kBAAC,OAAD,CAAM,UAAU,iBAAkB,SAAAA,EAAK,KAAY,CAAA,EACnD,kBAAC,OAAD,CAAM,UAAU,6BACb,SAAA,IAAIlC,EAAe,sBAAsBkC,EAAK,KAAK,GAChD,CAAA,CACM,CANK,EAAAA,EAAK,KAMV,EACZ,IACN,CACU,CAAA,CACT,CAAA,CACF,CAAA,CACO,CAAA,CACC,CACT,CAAA,CAAA,C,EAEd,CAEA,SAAS,cAAc,CAAE,UAAS,eAAyC,CACzE,IAAME,EAAOnC,EAAMqB,GAEnB,MACE,kBAAC,OAAD,CAAM,UAAU,gIACb,SAAAc,EAAO,kBAACA,EAAD,CAAM,MAAOC,CAAc,CAAA,EAAI,kBAACC,EAAD,CAAW,UAAU,mBAAqB,CAAA,CAC7E,CAAA,CAEV,C"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
-
import { c as ChartLegendContentProps, m as ChartTooltipContentProps, n as ChartColorKey, r as ChartConfig } from "../chart-
|
|
2
|
+
import { c as ChartLegendContentProps, m as ChartTooltipContentProps, n as ChartColorKey, r as ChartConfig } from "../chart-8rgtsk95.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Pie } from "recharts";
|
|
5
|
-
//#region src/components/pie-chart.d.ts
|
|
6
5
|
export type PieChartDatum = {
|
|
7
6
|
/** Slice name, shown in the tooltip and legend. */
|
|
8
7
|
name: string;
|
|
@@ -90,6 +89,5 @@ export type PieChartBaseProps = Omit<PieChartProps, 'children'> & {
|
|
|
90
89
|
};
|
|
91
90
|
declare function PieChartBase({ className, data, withTooltip, withLegend, withLabels, labelsPosition, startAngle, endAngle, paddingAngle, strokeWidth, strokeColor, innerRadius, outerRadius, animationDuration, tooltipProps, legendProps, pieProps, dataSlot, centerSlot, ...props }: PieChartBaseProps): React.JSX.Element;
|
|
92
91
|
declare function PieChart(props: PieChartProps): React.JSX.Element;
|
|
93
|
-
//#endregion
|
|
94
92
|
export { PieChart, PieChartBase };
|
|
95
93
|
//# sourceMappingURL=pie-chart.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pie-chart.js","names":["RechartsPieChart","React","PieChart$1","data","item","resolveChartColor","DEFAULT_CHART_PALETTE","index","acc","props","config","resolvedStroke","strokeColor","styledData","ChartContainer","dataSlot","cn","className","withTooltip","Tooltip","ChartTooltipContent","tooltipProps","withLegend","Legend","ChartLegendContent","legendProps","Pie","withLabels","labelsPosition","animationDuration","pieProps","centerSlot"],"sources":["../../src/components/pie-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Legend, Pie, PieChart as RechartsPieChart, Tooltip } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport {\n type ChartColorKey,\n type ChartConfig,\n ChartContainer,\n ChartLegendContent,\n type ChartLegendContentProps,\n ChartTooltipContent,\n type ChartTooltipContentProps,\n DEFAULT_CHART_PALETTE,\n resolveChartColor\n} from './chart'\n\nexport type PieChartDatum = {\n /** Slice name, shown in the tooltip and legend. */\n name: string\n /** Slice value. */\n value: number\n /** Any CSS color. Wins over `colorKey`. */\n color?: string\n /** Palette family, resolved to its semantic color `var(--{key})`. */\n colorKey?: ChartColorKey\n}\n\nexport type PieChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n /** Slices to draw. */\n data: PieChartDatum[]\n /**\n * Shows a tooltip on hover.\n * @default true\n */\n withTooltip?: boolean\n /**\n * Shows the legend.\n * @default false\n */\n withLegend?: boolean\n /**\n * Shows the value of each slice.\n * @default false\n */\n withLabels?: boolean\n /**\n * Where the labels go.\n * @default 'outside'\n */\n labelsPosition?: 'inside' | 'outside'\n /**\n * Angle where the first slice starts.\n * @default 90\n */\n startAngle?: number\n /**\n * Angle where the last slice ends.\n * @default -270\n */\n endAngle?: number\n /**\n * Space between slices, in degrees.\n * @default 0\n */\n paddingAngle?: number\n /**\n * Width of the gap between slices.\n * @default 1\n */\n strokeWidth?: number\n /**\n * Color of the gap between slices (palette family or CSS color).\n * @default 'var(--background)'\n */\n strokeColor?: ChartColorKey | string\n /**\n * Inner radius; above `0` it becomes a ring.\n * @default 0\n */\n innerRadius?: number | string\n /**\n * Outer radius (px or %).\n * @default '80%'\n */\n outerRadius?: number | string\n /** Animation length in ms. */\n animationDuration?: number\n /** Props for the tooltip content. */\n tooltipProps?: ChartTooltipContentProps\n /** Props for the legend content. */\n legendProps?: ChartLegendContentProps\n /** Props for the Recharts `<Pie>`. */\n pieProps?: Partial<React.ComponentProps<typeof Pie>>\n children?: React.ReactNode\n}\n\nexport function buildPieConfig(data: PieChartDatum[]): ChartConfig {\n return data.reduce<ChartConfig>((acc, item, index) => {\n acc[item.name] = {\n label: item.name,\n color:\n item.color ?? resolveChartColor(item.colorKey) ?? DEFAULT_CHART_PALETTE[index % DEFAULT_CHART_PALETTE.length]\n }\n return acc\n }, {})\n}\n\nexport type PieChartBaseProps = Omit<PieChartProps, 'children'> & {\n dataSlot: string\n innerRadius?: number | string\n outerRadius?: number | string\n centerSlot?: React.ReactNode\n}\n\nfunction PieChartBase({\n className,\n data,\n withTooltip = true,\n withLegend = false,\n withLabels = false,\n labelsPosition = 'outside',\n startAngle = 90,\n endAngle = -270,\n paddingAngle = 0,\n strokeWidth = 1,\n strokeColor = 'var(--background)',\n innerRadius = 0,\n outerRadius = '80%',\n animationDuration,\n tooltipProps,\n legendProps,\n pieProps,\n dataSlot,\n centerSlot,\n ...props\n}: PieChartBaseProps) {\n const config = React.useMemo(() => buildPieConfig(data), [data])\n const resolvedStroke = resolveChartColor(strokeColor) ?? strokeColor\n const styledData = React.useMemo(\n () => data.map((item) => ({ ...item, fill: config[item.name]?.color, stroke: resolvedStroke })),\n [data, resolvedStroke, config]\n )\n\n return (\n <ChartContainer\n data-slot={dataSlot}\n className={cn('relative aspect-square w-full', className)}\n config={config}\n {...props}\n >\n <RechartsPieChart>\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent hideLabel {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent nameKey=\"name\" {...legendProps} />} />}\n <Pie\n data={styledData}\n dataKey=\"value\"\n nameKey=\"name\"\n startAngle={startAngle}\n endAngle={endAngle}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n paddingAngle={paddingAngle}\n strokeWidth={strokeWidth}\n label={\n withLabels\n ? labelsPosition === 'inside'\n ? { position: 'inside', fontSize: 12, fontWeight: 500, fill: 'var(--background)' }\n : { fontSize: 12 }\n : undefined\n }\n labelLine={withLabels && labelsPosition === 'outside'}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...pieProps}\n >\n {centerSlot}\n </Pie>\n </RechartsPieChart>\n </ChartContainer>\n )\n}\n\nfunction PieChart(props: PieChartProps) {\n return <PieChartBase {...props} dataSlot=\"pie-chart\" />\n}\n\nexport { PieChart, PieChartBase }\n"],"mappings":"4WAiGA,SAAgB,eAAe,EAAoC,CACjE,OAAOG,EAAK,QAAqB,EAAK,EAAM,KAC1C,EAAIC,EAAK,MAAQ,CACf,MAAOA,EAAK,KACZ,MACEA,EAAK,OAASC,EAAkBD,EAAK,QAAQ,GAAKE,EAAsBC,EAAQD,EAAsB,OAC1G,EACOE,GACN,CAAC,CAAC,CACP,CASA,SAAS,aAAa,CACpB,YACA,OACA,cAAc,GACd,aAAa,GACb,aAAa,GACb,iBAAiB,UACjB,aAAa,GACb,WAAW,KACX,eAAe,EACf,cAAc,EACd,cAAc,oBACd,cAAc,EACd,cAAc,MACd,oBACA,eACA,cACA,WACA,WACA,aACA,GAAGC,GACiB,CACpB,IAAMC,EAAST,EAAM,YAAc,eAAeE,CAAI,EAAG,CAACA,CAAI,CAAC,EACzDQ,EAAiBN,EAAkBO,CAAW,GAAKA,EACnDC,EAAaZ,EAAM,YACjBE,EAAK,IAAK,IAAU,CAAE,GAAGC,EAAM,KAAMM,EAAON,EAAK,KAAK,EAAE,MAAO,OAAQO,CAAe,EAAE,EAC9F,CAACR,EAAMQ,EAAgBD,CAAM,CAC/B,EAEA,MACE,kBAACI,EAAD,CACE,YAAWC,EACX,UAAWC,EAAG,gCAAiCC,CAAS,EAChD,SACR,GAAIR,EAEJ,SAAA,kBAACT,EAAD,CAAA,SAAA,CACGkB,GAAe,kBAACC,EAAD,CAAS,OAAQ,GAAO,QAAS,kBAACC,EAAD,CAAqB,UAAA,GAAU,GAAIC,CAAe,CAAA,CAAI,CAAA,EACtGC,GAAc,kBAACC,EAAD,CAAQ,QAAS,kBAACC,EAAD,CAAoB,QAAQ,OAAO,GAAIC,CAAc,CAAA,CAAI,CAAA,EACzF,kBAACC,EAAD,CACE,KAAMb,EACN,QAAQ,QACR,QAAQ,OACI,aACF,WACG,cACA,cACC,eACD,cACb,MACEc,EACIC,IAAmB,SACjB,CAAE,SAAU,SAAU,SAAU,GAAI,WAAY,IAAK,KAAM,mBAAoB,EAC/E,CAAE,SAAU,EAAG,EACjB,IAAA,GAEN,UAAWD,GAAcC,IAAmB,UACzB,oBACnB,kBAAmBC,IAAsB,EACzC,GAAIC,EAEH,SAAAC,CACE,CAAA,CACW,CAAA,CAAA,CACJ,CAAA,CAEpB,CAEA,SAAS,SAAS,EAAsB,CACtC,MAAO,kBAAC,aAAD,CAAc,GAAItB,EAAO,SAAS,WAAa,CAAA,CACxD"}
|
|
1
|
+
{"version":3,"file":"pie-chart.js","names":["RechartsPieChart","React","PieChart$1","data","item","resolveChartColor","DEFAULT_CHART_PALETTE","index","acc","props","config","resolvedStroke","strokeColor","styledData","ChartContainer","dataSlot","cn","className","withTooltip","Tooltip","ChartTooltipContent","tooltipProps","withLegend","Legend","ChartLegendContent","legendProps","Pie","withLabels","labelsPosition","animationDuration","pieProps","centerSlot"],"sources":["../../src/components/pie-chart.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport { Legend, Pie, PieChart as RechartsPieChart, Tooltip } from 'recharts'\n\nimport { cn } from '../lib/utils'\nimport {\n type ChartColorKey,\n type ChartConfig,\n ChartContainer,\n ChartLegendContent,\n type ChartLegendContentProps,\n ChartTooltipContent,\n type ChartTooltipContentProps,\n DEFAULT_CHART_PALETTE,\n resolveChartColor\n} from './chart'\n\nexport type PieChartDatum = {\n /** Slice name, shown in the tooltip and legend. */\n name: string\n /** Slice value. */\n value: number\n /** Any CSS color. Wins over `colorKey`. */\n color?: string\n /** Palette family, resolved to its semantic color `var(--{key})`. */\n colorKey?: ChartColorKey\n}\n\nexport type PieChartProps = Omit<React.ComponentProps<'div'>, 'children'> & {\n /** Slices to draw. */\n data: PieChartDatum[]\n /**\n * Shows a tooltip on hover.\n * @default true\n */\n withTooltip?: boolean\n /**\n * Shows the legend.\n * @default false\n */\n withLegend?: boolean\n /**\n * Shows the value of each slice.\n * @default false\n */\n withLabels?: boolean\n /**\n * Where the labels go.\n * @default 'outside'\n */\n labelsPosition?: 'inside' | 'outside'\n /**\n * Angle where the first slice starts.\n * @default 90\n */\n startAngle?: number\n /**\n * Angle where the last slice ends.\n * @default -270\n */\n endAngle?: number\n /**\n * Space between slices, in degrees.\n * @default 0\n */\n paddingAngle?: number\n /**\n * Width of the gap between slices.\n * @default 1\n */\n strokeWidth?: number\n /**\n * Color of the gap between slices (palette family or CSS color).\n * @default 'var(--background)'\n */\n strokeColor?: ChartColorKey | string\n /**\n * Inner radius; above `0` it becomes a ring.\n * @default 0\n */\n innerRadius?: number | string\n /**\n * Outer radius (px or %).\n * @default '80%'\n */\n outerRadius?: number | string\n /** Animation length in ms. */\n animationDuration?: number\n /** Props for the tooltip content. */\n tooltipProps?: ChartTooltipContentProps\n /** Props for the legend content. */\n legendProps?: ChartLegendContentProps\n /** Props for the Recharts `<Pie>`. */\n pieProps?: Partial<React.ComponentProps<typeof Pie>>\n children?: React.ReactNode\n}\n\nexport function buildPieConfig(data: PieChartDatum[]): ChartConfig {\n return data.reduce<ChartConfig>((acc, item, index) => {\n acc[item.name] = {\n label: item.name,\n color:\n item.color ?? resolveChartColor(item.colorKey) ?? DEFAULT_CHART_PALETTE[index % DEFAULT_CHART_PALETTE.length]\n }\n return acc\n }, {})\n}\n\nexport type PieChartBaseProps = Omit<PieChartProps, 'children'> & {\n dataSlot: string\n innerRadius?: number | string\n outerRadius?: number | string\n centerSlot?: React.ReactNode\n}\n\nfunction PieChartBase({\n className,\n data,\n withTooltip = true,\n withLegend = false,\n withLabels = false,\n labelsPosition = 'outside',\n startAngle = 90,\n endAngle = -270,\n paddingAngle = 0,\n strokeWidth = 1,\n strokeColor = 'var(--background)',\n innerRadius = 0,\n outerRadius = '80%',\n animationDuration,\n tooltipProps,\n legendProps,\n pieProps,\n dataSlot,\n centerSlot,\n ...props\n}: PieChartBaseProps) {\n const config = React.useMemo(() => buildPieConfig(data), [data])\n const resolvedStroke = resolveChartColor(strokeColor) ?? strokeColor\n const styledData = React.useMemo(\n () => data.map((item) => ({ ...item, fill: config[item.name]?.color, stroke: resolvedStroke })),\n [data, resolvedStroke, config]\n )\n\n return (\n <ChartContainer\n data-slot={dataSlot}\n className={cn('relative aspect-square w-full', className)}\n config={config}\n {...props}\n >\n <RechartsPieChart>\n {withTooltip && <Tooltip cursor={false} content={<ChartTooltipContent hideLabel {...tooltipProps} />} />}\n {withLegend && <Legend content={<ChartLegendContent nameKey=\"name\" {...legendProps} />} />}\n <Pie\n data={styledData}\n dataKey=\"value\"\n nameKey=\"name\"\n startAngle={startAngle}\n endAngle={endAngle}\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n paddingAngle={paddingAngle}\n strokeWidth={strokeWidth}\n label={\n withLabels\n ? labelsPosition === 'inside'\n ? { position: 'inside', fontSize: 12, fontWeight: 500, fill: 'var(--background)' }\n : { fontSize: 12 }\n : undefined\n }\n labelLine={withLabels && labelsPosition === 'outside'}\n animationDuration={animationDuration}\n isAnimationActive={animationDuration !== 0}\n {...pieProps}\n >\n {centerSlot}\n </Pie>\n </RechartsPieChart>\n </ChartContainer>\n )\n}\n\nfunction PieChart(props: PieChartProps) {\n return <PieChartBase {...props} dataSlot=\"pie-chart\" />\n}\n\nexport { PieChart, PieChartBase }\n"],"mappings":"A,4WAiGA,SAAgB,eAAe,EAAoC,CACjE,OAAOG,EAAK,QAAqB,EAAK,EAAM,KAC1C,EAAIC,EAAK,MAAQ,CACf,MAAOA,EAAK,KACZ,MACEA,EAAK,OAASC,EAAkBD,EAAK,QAAQ,GAAKE,EAAsBC,EAAQD,EAAsB,OAC1G,EACOE,GACN,CAAC,CAAC,CACP,CASA,SAAS,aAAa,CACpB,YACA,OACA,cAAc,GACd,aAAa,GACb,aAAa,GACb,iBAAiB,UACjB,aAAa,GACb,WAAW,KACX,eAAe,EACf,cAAc,EACd,cAAc,oBACd,cAAc,EACd,cAAc,MACd,oBACA,eACA,cACA,WACA,WACA,aACA,GAAGC,GACiB,CACpB,IAAMC,EAAST,EAAM,YAAc,eAAeE,CAAI,EAAG,CAACA,CAAI,CAAC,EACzDQ,EAAiBN,EAAkBO,CAAW,GAAKA,EACnDC,EAAaZ,EAAM,YACjBE,EAAK,IAAK,IAAU,CAAE,GAAGC,EAAM,KAAMM,EAAON,EAAK,KAAK,EAAE,MAAO,OAAQO,CAAe,EAAE,EAC9F,CAACR,EAAMQ,EAAgBD,CAAM,CAC/B,EAEA,MACE,kBAACI,EAAD,CACE,YAAWC,EACX,UAAWC,EAAG,gCAAiCC,CAAS,EAChD,SACR,GAAIR,EAEJ,SAAA,kBAACT,EAAD,CAAA,SAAA,CACGkB,GAAe,kBAACC,EAAD,CAAS,OAAQ,GAAO,QAAS,kBAACC,EAAD,CAAqB,UAAA,GAAU,GAAIC,CAAe,CAAA,CAAI,CAAA,EACtGC,GAAc,kBAACC,EAAD,CAAQ,QAAS,kBAACC,EAAD,CAAoB,QAAQ,OAAO,GAAIC,CAAc,CAAA,CAAI,CAAA,EACzF,kBAACC,EAAD,CACE,KAAMb,EACN,QAAQ,QACR,QAAQ,OACI,aACF,WACG,cACA,cACC,eACD,cACb,MACEc,EACIC,IAAmB,SACjB,CAAE,SAAU,SAAU,SAAU,GAAI,WAAY,IAAK,KAAM,mBAAoB,EAC/E,CAAE,SAAU,EAAG,EACjB,IAAA,GAEN,UAAWD,GAAcC,IAAmB,UACzB,oBACnB,kBAAmBC,IAAsB,EACzC,GAAIC,EAEH,SAAAC,CACE,CAAA,CACW,CAAA,CAAA,CACJ,CAAA,CAEpB,CAEA,SAAS,SAAS,EAAsB,CACtC,MAAO,kBAAC,aAAD,CAAc,GAAItB,EAAO,SAAS,WAAa,CAAA,CACxD,C"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
-
import { t as AsChildPrimitiveProps } from "../as-child-
|
|
2
|
+
import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Popover as Popover$1 } from "@base-ui/react/popover";
|
|
5
|
-
//#region src/components/popover.d.ts
|
|
6
5
|
export type PopoverProps = React.ComponentProps<typeof Popover$1.Root>;
|
|
7
6
|
export type PopoverTriggerProps = AsChildPrimitiveProps<typeof Popover$1.Trigger>;
|
|
8
7
|
export type PopoverContentProps = AsChildPrimitiveProps<typeof Popover$1.Popup> & Pick<React.ComponentProps<typeof Popover$1.Positioner>, 'anchor' | 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'sticky'> & Pick<React.ComponentProps<typeof Popover$1.Portal>, 'keepMounted'>;
|
|
@@ -17,6 +16,5 @@ declare function PopoverContent({ className, anchor, side, sideOffset, align, al
|
|
|
17
16
|
declare function PopoverHeader({ className, ...props }: PopoverHeaderProps): React.JSX.Element;
|
|
18
17
|
declare function PopoverTitle({ className, asChild, children, ...props }: PopoverTitleProps): React.JSX.Element;
|
|
19
18
|
declare function PopoverDescription({ className, asChild, children, ...props }: PopoverDescriptionProps): React.JSX.Element;
|
|
20
|
-
//#endregion
|
|
21
19
|
export { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger };
|
|
22
20
|
//# sourceMappingURL=popover.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popover.js","names":["PopoverPrimitive","resolveClassName","Popover$1","props","toAsChildRenderProps","asChild","children","cn","className","state"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type PopoverProps = React.ComponentProps<typeof PopoverPrimitive.Root>\n\nexport type PopoverTriggerProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Trigger>\n\nexport type PopoverContentProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Popup> &\n Pick<\n React.ComponentProps<typeof PopoverPrimitive.Positioner>,\n 'anchor' | 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'sticky'\n > &\n Pick<React.ComponentProps<typeof PopoverPrimitive.Portal>, 'keepMounted'>\n\nexport type PopoverCloseProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Close>\n\nexport type PopoverHeaderProps = React.ComponentProps<'div'>\n\nexport type PopoverTitleProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Title>\n\nexport type PopoverDescriptionProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Description>\n\nfunction Popover({ ...props }: PopoverProps) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({ asChild, children, ...props }: PopoverTriggerProps) {\n return (\n <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} {...toAsChildRenderProps(asChild, children)} />\n )\n}\n\nfunction PopoverClose({ asChild, children, ...props }: PopoverCloseProps) {\n return <PopoverPrimitive.Close data-slot=\"popover-close\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction PopoverContent({\n className,\n anchor,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 0,\n sticky,\n keepMounted,\n asChild,\n children,\n ...props\n}: PopoverContentProps) {\n return (\n <PopoverPrimitive.Portal keepMounted={keepMounted}>\n <PopoverPrimitive.Positioner\n anchor={anchor}\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n sticky={sticky}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={(state) =>\n cn(\n 'bg-popover text-popover-foreground ring-foreground/10 z-50 w-72 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100 origin-(--transform-origin) flex flex-col gap-2.5 outline-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n )\n}\n\nfunction PopoverHeader({ className, ...props }: PopoverHeaderProps) {\n return <div data-slot=\"popover-header\" className={cn('flex flex-col gap-0.5 text-sm', className)} {...props} />\n}\n\nfunction PopoverTitle({ className, asChild, children, ...props }: PopoverTitleProps) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={(state) => cn('font-medium', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction PopoverDescription({ className, asChild, children, ...props }: PopoverDescriptionProps) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={(state) => cn('text-muted-foreground', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger }\n"],"mappings":"sRA2BA,SAAS,QAAQ,CAAE,GAAGG,GAAuB,CAC3C,MAAO,kBAACH,EAAiB,KAAlB,CAAuB,YAAU,UAAU,GAAIG,CAAQ,CAAA,CAChE,CAEA,SAAS,eAAe,CAAE,UAAS,WAAU,GAAGA,GAA8B,CAC5E,MACE,kBAACH,EAAiB,QAAlB,CAA0B,YAAU,kBAAkB,GAAIG,EAAO,GAAIC,EAAqBC,EAASC,CAAQ,CAAI,CAAA,CAEnH,CAEA,SAAS,aAAa,CAAE,UAAS,WAAU,GAAGH,GAA4B,CACxE,MAAO,kBAACH,EAAiB,MAAlB,CAAwB,YAAU,gBAAgB,GAAIG,EAAO,GAAIC,EAAqBC,EAASC,CAAQ,CAAI,CAAA,CACpH,CAEA,SAAS,eAAe,CACtB,YACA,SACA,OAAO,SACP,aAAa,EACb,QAAQ,SACR,cAAc,EACd,SACA,cACA,UACA,WACA,GAAGH,GACmB,CACtB,MACE,kBAACH,EAAiB,OAAlB,CAAsC,cACpC,SAAA,kBAACA,EAAiB,WAAlB,CACU,SACF,OACM,aACL,QACM,cACL,SACR,UAAU,eAEV,SAAA,kBAACA,EAAiB,MAAlB,CACE,YAAU,kBACV,UAAY,GACVO,EACE,0LACA,uIACA,8JACAN,EAAiBO,EAAWC,CAAK,CACnC,EAEF,GAAIN,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAC0B,CAAA,CACN,CAAA,CAE7B,CAEA,SAAS,cAAc,CAAE,YAAW,GAAGH,GAA6B,CAClE,MAAO,kBAAC,MAAD,CAAK,YAAU,iBAAiB,UAAWI,EAAG,gCAAiCC,CAAS,EAAG,GAAIL,CAAQ,CAAA,CAChH,CAEA,SAAS,aAAa,CAAE,YAAW,UAAS,WAAU,GAAGA,GAA4B,CACnF,MACE,kBAACH,EAAiB,MAAlB,CACE,YAAU,gBACV,UAAY,GAAUO,EAAG,cAAeN,EAAiBO,EAAWC,CAAK,CAAC,EAC1E,GAAIN,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,mBAAmB,CAAE,YAAW,UAAS,WAAU,GAAGH,GAAkC,CAC/F,MACE,kBAACH,EAAiB,YAAlB,CACE,YAAU,sBACV,UAAY,GAAUO,EAAG,wBAAyBN,EAAiBO,EAAWC,CAAK,CAAC,EACpF,GAAIN,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL"}
|
|
1
|
+
{"version":3,"file":"popover.js","names":["PopoverPrimitive","resolveClassName","Popover$1","props","toAsChildRenderProps","asChild","children","cn","className","state"],"sources":["../../src/components/popover.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Popover as PopoverPrimitive } from '@base-ui/react/popover'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type PopoverProps = React.ComponentProps<typeof PopoverPrimitive.Root>\n\nexport type PopoverTriggerProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Trigger>\n\nexport type PopoverContentProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Popup> &\n Pick<\n React.ComponentProps<typeof PopoverPrimitive.Positioner>,\n 'anchor' | 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'sticky'\n > &\n Pick<React.ComponentProps<typeof PopoverPrimitive.Portal>, 'keepMounted'>\n\nexport type PopoverCloseProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Close>\n\nexport type PopoverHeaderProps = React.ComponentProps<'div'>\n\nexport type PopoverTitleProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Title>\n\nexport type PopoverDescriptionProps = AsChildPrimitiveProps<typeof PopoverPrimitive.Description>\n\nfunction Popover({ ...props }: PopoverProps) {\n return <PopoverPrimitive.Root data-slot=\"popover\" {...props} />\n}\n\nfunction PopoverTrigger({ asChild, children, ...props }: PopoverTriggerProps) {\n return (\n <PopoverPrimitive.Trigger data-slot=\"popover-trigger\" {...props} {...toAsChildRenderProps(asChild, children)} />\n )\n}\n\nfunction PopoverClose({ asChild, children, ...props }: PopoverCloseProps) {\n return <PopoverPrimitive.Close data-slot=\"popover-close\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction PopoverContent({\n className,\n anchor,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 0,\n sticky,\n keepMounted,\n asChild,\n children,\n ...props\n}: PopoverContentProps) {\n return (\n <PopoverPrimitive.Portal keepMounted={keepMounted}>\n <PopoverPrimitive.Positioner\n anchor={anchor}\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n sticky={sticky}\n className=\"isolate z-50\"\n >\n <PopoverPrimitive.Popup\n data-slot=\"popover-content\"\n className={(state) =>\n cn(\n 'bg-popover text-popover-foreground ring-foreground/10 z-50 w-72 rounded-lg p-2.5 text-sm shadow-md ring-1 duration-100 origin-(--transform-origin) flex flex-col gap-2.5 outline-hidden',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </PopoverPrimitive.Positioner>\n </PopoverPrimitive.Portal>\n )\n}\n\nfunction PopoverHeader({ className, ...props }: PopoverHeaderProps) {\n return <div data-slot=\"popover-header\" className={cn('flex flex-col gap-0.5 text-sm', className)} {...props} />\n}\n\nfunction PopoverTitle({ className, asChild, children, ...props }: PopoverTitleProps) {\n return (\n <PopoverPrimitive.Title\n data-slot=\"popover-title\"\n className={(state) => cn('font-medium', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction PopoverDescription({ className, asChild, children, ...props }: PopoverDescriptionProps) {\n return (\n <PopoverPrimitive.Description\n data-slot=\"popover-description\"\n className={(state) => cn('text-muted-foreground', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport { Popover, PopoverClose, PopoverContent, PopoverDescription, PopoverHeader, PopoverTitle, PopoverTrigger }\n"],"mappings":"A,sRA2BA,SAAS,QAAQ,CAAE,GAAGG,GAAuB,CAC3C,MAAO,kBAACH,EAAiB,KAAlB,CAAuB,YAAU,UAAU,GAAIG,CAAQ,CAAA,CAChE,CAEA,SAAS,eAAe,CAAE,UAAS,WAAU,GAAGA,GAA8B,CAC5E,MACE,kBAACH,EAAiB,QAAlB,CAA0B,YAAU,kBAAkB,GAAIG,EAAO,GAAIC,EAAqBC,EAASC,CAAQ,CAAI,CAAA,CAEnH,CAEA,SAAS,aAAa,CAAE,UAAS,WAAU,GAAGH,GAA4B,CACxE,MAAO,kBAACH,EAAiB,MAAlB,CAAwB,YAAU,gBAAgB,GAAIG,EAAO,GAAIC,EAAqBC,EAASC,CAAQ,CAAI,CAAA,CACpH,CAEA,SAAS,eAAe,CACtB,YACA,SACA,OAAO,SACP,aAAa,EACb,QAAQ,SACR,cAAc,EACd,SACA,cACA,UACA,WACA,GAAGH,GACmB,CACtB,MACE,kBAACH,EAAiB,OAAlB,CAAsC,cACpC,SAAA,kBAACA,EAAiB,WAAlB,CACU,SACF,OACM,aACL,QACM,cACL,SACR,UAAU,eAEV,SAAA,kBAACA,EAAiB,MAAlB,CACE,YAAU,kBACV,UAAY,GACVO,EACE,0LACA,uIACA,8JACAN,EAAiBO,EAAWC,CAAK,CACnC,EAEF,GAAIN,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAC0B,CAAA,CACN,CAAA,CAE7B,CAEA,SAAS,cAAc,CAAE,YAAW,GAAGH,GAA6B,CAClE,MAAO,kBAAC,MAAD,CAAK,YAAU,iBAAiB,UAAWI,EAAG,gCAAiCC,CAAS,EAAG,GAAIL,CAAQ,CAAA,CAChH,CAEA,SAAS,aAAa,CAAE,YAAW,UAAS,WAAU,GAAGA,GAA4B,CACnF,MACE,kBAACH,EAAiB,MAAlB,CACE,YAAU,gBACV,UAAY,GAAUO,EAAG,cAAeN,EAAiBO,EAAWC,CAAK,CAAC,EAC1E,GAAIN,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,mBAAmB,CAAE,YAAW,UAAS,WAAU,GAAGH,GAAkC,CAC/F,MACE,kBAACH,EAAiB,YAAlB,CACE,YAAU,sBACV,UAAY,GAAUO,EAAG,wBAAyBN,EAAiBO,EAAWC,CAAK,CAAC,EACpF,GAAIN,EACJ,GAAIC,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,C"}
|
|
@@ -2,7 +2,6 @@ import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
4
|
import { Progress as Progress$1 } from "@base-ui/react/progress";
|
|
5
|
-
//#region src/components/progress.d.ts
|
|
6
5
|
declare const progressVariants: (props?: ({
|
|
7
6
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
8
7
|
color?: "blue" | "brand" | "gray" | "green" | "indigo" | "pink" | "primary" | "red" | "yellow" | "zinc" | null | undefined;
|
|
@@ -15,6 +14,5 @@ export type ProgressProps = Omit<React.ComponentProps<typeof Progress$1.Root>, '
|
|
|
15
14
|
value?: number | null;
|
|
16
15
|
};
|
|
17
16
|
declare function Progress({ className, value, size, color, ...props }: ProgressProps): React.JSX.Element;
|
|
18
|
-
//#endregion
|
|
19
17
|
export { Progress, progressVariants };
|
|
20
18
|
//# sourceMappingURL=progress.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../rolldown-runtime-BhWHdk3m.js";import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{progressColorVariants as e}from"../lib/progress.js";import{cn as t}from"../lib/utils.js";import{t as n}from"../resolve-class-name-BurP8ngI.js";import{jsx as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";import{Progress as a}from"@base-ui/react/progress";const o=i(`relative flex w-full items-center overflow-x-hidden rounded-full bg-muted`,{variants:{size:{sm:`h-0.5`,md:`h-1`,lg:`h-1.5`},color:e},defaultVariants:{size:`md`,color:`primary`}});function Progress({className:e,value:i=null,size:s=`md`,color:c=`primary`,...l}){return/* @__PURE__ */ r(a.Root,{"data-slot":`progress`,"data-size":s,"data-color":c,value:i,...l,children:/* @__PURE__ */ r(a.Track,{"data-slot":`progress-track`,className:r=>t(o({size:s,color:c}),n(e,r)),children:/* @__PURE__ */ r(a.Indicator,{"data-slot":`progress-indicator`,className:`h-full bg-(--progress-color) transition-all`})})})}export{Progress,o as progressVariants};
|
|
2
2
|
//# sourceMappingURL=progress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.js","names":["ProgressPrimitive","Progress$1","progressVariants","cva","progressColorVariants","props","size","color","cn","
|
|
1
|
+
{"version":3,"file":"progress.js","names":["ProgressPrimitive","resolveClassName","Progress$1","progressVariants","cva","progressColorVariants","props","size","color","cn","className","state"],"sources":["../../src/components/progress.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Progress as ProgressPrimitive } from '@base-ui/react/progress'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { progressColorVariants } from '../lib/progress'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nconst progressVariants = cva('relative flex w-full items-center overflow-x-hidden rounded-full bg-muted', {\n variants: {\n size: {\n sm: 'h-0.5',\n md: 'h-1',\n lg: 'h-1.5'\n },\n color: progressColorVariants\n },\n defaultVariants: {\n size: 'md',\n color: 'primary'\n }\n})\n\nexport type ProgressProps = Omit<React.ComponentProps<typeof ProgressPrimitive.Root>, 'render' | 'value'> &\n VariantProps<typeof progressVariants> & {\n /**\n * Progress from `0` to `100`. `null` renders an indeterminate bar.\n * @default null\n */\n value?: number | null\n }\n\nfunction Progress({ className, value = null, size = 'md', color = 'primary', ...props }: ProgressProps) {\n return (\n <ProgressPrimitive.Root data-slot=\"progress\" data-size={size} data-color={color} value={value} {...props}>\n <ProgressPrimitive.Track\n data-slot=\"progress-track\"\n className={(state) => cn(progressVariants({ size, color }), resolveClassName(className, state))}\n >\n <ProgressPrimitive.Indicator\n data-slot=\"progress-indicator\"\n className=\"h-full bg-(--progress-color) transition-all\"\n />\n </ProgressPrimitive.Track>\n </ProgressPrimitive.Root>\n )\n}\n\nexport { Progress, progressVariants }\n"],"mappings":"A,wUASA,MAAMG,EAAmBC,EAAI,4EAA6E,CACxG,SAAU,CACR,KAAM,CACJ,GAAI,QACJ,GAAI,MACJ,GAAI,OACN,EACA,MAAOC,CACT,EACA,gBAAiB,CACf,KAAM,KACN,MAAO,SACT,CACF,CAAC,EAWD,SAAS,SAAS,CAAE,YAAW,QAAQ,KAAM,OAAO,KAAM,QAAQ,UAAW,GAAGC,GAAwB,CACtG,MACE,kBAACN,EAAkB,KAAnB,CAAwB,YAAU,WAAW,YAAWO,EAAM,aAAYC,EAAc,QAAO,GAAIF,EACjG,SAAA,kBAACN,EAAkB,MAAnB,CACE,YAAU,iBACV,UAAY,GAAUS,EAAGN,EAAiB,CAAE,OAAM,OAAM,CAAC,EAAGF,EAAiBS,EAAWC,CAAK,CAAC,EAE9F,SAAA,kBAACX,EAAkB,UAAnB,CACE,YAAU,qBACV,UAAU,6CACX,CAAA,CACsB,CAAA,CACH,CAAA,CAE5B,C"}
|
|
@@ -6,7 +6,6 @@ import { ReactNode } from "react";
|
|
|
6
6
|
import { VariantProps } from "class-variance-authority";
|
|
7
7
|
import { Radio } from "@base-ui/react/radio";
|
|
8
8
|
import { RadioGroup as RadioGroup$1 } from "@base-ui/react/radio-group";
|
|
9
|
-
//#region src/components/radio-group.d.ts
|
|
10
9
|
export type RadioGroupProps<Value = string> = Omit<RadioGroup$1.Props<Value>, 'render'> & {
|
|
11
10
|
asChild?: boolean;
|
|
12
11
|
} & {
|
|
@@ -34,6 +33,5 @@ export type RadioGroupItemProps = Omit<React.ComponentProps<typeof Radio.Root>,
|
|
|
34
33
|
};
|
|
35
34
|
declare function RadioGroup<Value = string>({ className, color, asChild, children, 'aria-invalid': ariaInvalid, ...props }: RadioGroupProps<Value>): React.JSX.Element;
|
|
36
35
|
declare function RadioGroupItem({ className, color, id, label, labelProps, description, descriptionProps, size, ...props }: RadioGroupItemProps): React.JSX.Element;
|
|
37
|
-
//#endregion
|
|
38
36
|
export { RadioGroup, RadioGroupItem };
|
|
39
37
|
//# sourceMappingURL=radio-group.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../rolldown-runtime-BhWHdk3m.js";import{toAsChildRenderProps as e}from"../lib/as-child.js";import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{toAsChildRenderProps as e}from"../lib/as-child.js";import{selectionControlColorVariants as t}from"../lib/color.js";import{cn as n}from"../lib/utils.js";import{t as r}from"../resolve-class-name-BurP8ngI.js";import{useFieldControlId as i,useFieldInvalid as a,useFieldLabelId as o}from"./field.js";import{Label as s}from"./label.js";import{createContext as c,useContext as l,useId as u}from"react";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{cva as p}from"class-variance-authority";import{Radio as m}from"@base-ui/react/radio";import{RadioGroup as h}from"@base-ui/react/radio-group";const g=p([`group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border border-input outline-none`,`after:absolute after:-inset-x-3 after:-inset-y-2`,`focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50`,`data-disabled:cursor-not-allowed data-disabled:opacity-50`,`dark:data-unchecked:bg-input/30`,`data-checked:border-(--selection-control) data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground)`],{variants:{color:t,size:{sm:`size-4`,md:`size-4.5`,lg:`size-5.5`}},defaultVariants:{size:`md`}}),_=p(`flex items-center justify-center`,{variants:{size:{sm:`size-4`,md:`size-4.5`,lg:`size-5.5`}},defaultVariants:{size:`md`}}),v=p(`absolute top-1/2 left-1/2 rounded-full bg-primary-foreground`,{variants:{size:{sm:`size-1.5`,md:`size-2`,lg:`size-2.5`}},defaultVariants:{size:`md`}}),y=p(``,{variants:{size:{sm:`text-xs`,md:`text-sm`,lg:`text-lg`}},defaultVariants:{size:`md`}}),b=p(`text-muted-foreground text-left leading-normal font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,{variants:{size:{sm:`text-xs`,md:`text-xs`,lg:`text-sm`}},defaultVariants:{size:`md`}}),x=c(void 0);function RadioGroup({className:s,color:c=`primary`,asChild:l,children:u,"aria-invalid":f,...p}){let m=i(),g=o(),_=a(f);return/* @__PURE__ */ d(x.Provider,{value:m,children:/* @__PURE__ */ d(h,{"data-slot":`radio-group`,"data-color":c,"aria-labelledby":g,"aria-invalid":_,className:e=>n(`grid w-full gap-2`,t[c],r(s,e)),...p,...e(l,u)})})}function RadioGroupItem({className:e,color:t,id:a,label:o,labelProps:c,description:p,descriptionProps:h,size:S=`md`,...C}){let w=u(),T=i(a),E=l(x),D=o!==void 0,O=(a===void 0&&T===E?void 0:T)??(D?w:void 0),{className:k,...A}=c??{},j=u(),M=p!==void 0,{className:N,...P}=h??{},F=M?P.id??j:void 0,I=/* @__PURE__ */ d(m.Root,{"data-slot":`radio-group-item`,"data-color":t,"data-size":S,id:O,"aria-describedby":F,className:i=>n(g({color:t,size:S}),r(e,i)),...C,children:/* @__PURE__ */ d(m.Indicator,{"data-slot":`radio-group-indicator`,className:n(_({size:S})),children:/* @__PURE__ */ d(`span`,{className:n(v({size:S}),`-translate-x-1/2 -translate-y-1/2`)})})});return!D&&!M?I:/* @__PURE__ */ f(`div`,{"data-slot":`radio-group-item-field`,className:`grid grid-cols-[auto_1fr] items-center justify-items-start gap-x-2 gap-y-0.5`,children:[I,D&&/* @__PURE__ */ d(s,{...A,htmlFor:O,className:n(y({size:S}),k),children:o}),M&&/* @__PURE__ */ d(`p`,{"data-slot":`radio-group-item-description`,...P,id:F,className:n(`col-start-2`,b({size:S}),N),children:p})]})}export{RadioGroup,RadioGroupItem};
|
|
2
2
|
//# sourceMappingURL=radio-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radio-group.js","names":["RadioGroupPrimitive","RadioPrimitive","resolveClassName","RadioGroup$1","radioGroupItemVariants","cva","selectionControlColorVariants","radioGroupIndicatorVariants","radioGroupIndicatorDotVariants","radioGroupItemLabelVariants","radioGroupItemDescriptionVariants","RadioGroupFieldControlIdContext","createContext","ariaInvalid","props","fieldControlId","useFieldControlId","fieldLabelId","useFieldLabelId","invalid","useFieldInvalid","color","cn","className","state","toAsChildRenderProps","asChild","children","generatedId","useId","id","groupFieldControlId","useContext","hasLabel","label","resolvedId","labelClassName","labelRootProps","labelProps","descriptionId","hasDescription","description","descriptionClassName","descriptionRootProps","descriptionProps","resolvedDescriptionId","item","Radio","size","Label"],"sources":["../../src/components/radio-group.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { createContext, type ReactNode, useContext, useId } from 'react'\n\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio'\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { toAsChildRenderProps } from '../lib/as-child'\nimport type { UIColor } from '../lib/color'\nimport { selectionControlColorVariants } from '../lib/color'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { useFieldControlId, useFieldInvalid, useFieldLabelId } from './field'\nimport { Label, type LabelProps } from './label'\n\nexport type RadioGroupProps<Value = string> = Omit<RadioGroupPrimitive.Props<Value>, 'render'> & {\n asChild?: boolean\n} & {\n /**\n * Palette family for every item in the group.\n * @default 'primary'\n */\n color?: UIColor\n}\n\nconst radioGroupItemVariants = cva(\n [\n 'group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border border-input outline-none',\n 'after:absolute after:-inset-x-3 after:-inset-y-2',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n 'dark:data-unchecked:bg-input/30',\n 'data-checked:border-(--selection-control) data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground)'\n ],\n {\n variants: {\n color: selectionControlColorVariants,\n size: {\n sm: 'size-4',\n md: 'size-4.5',\n lg: 'size-5.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nconst radioGroupIndicatorVariants = cva('flex items-center justify-center', {\n variants: {\n size: {\n sm: 'size-4',\n md: 'size-4.5',\n lg: 'size-5.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupIndicatorDotVariants = cva('absolute top-1/2 left-1/2 rounded-full bg-primary-foreground', {\n variants: {\n size: {\n sm: 'size-1.5',\n md: 'size-2',\n lg: 'size-2.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupItemLabelVariants = cva('', {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-lg'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupItemDescriptionVariants = cva(\n 'text-muted-foreground text-left leading-normal font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-xs',\n lg: 'text-sm'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioPrimitive.Root>, 'render'> &\n VariantProps<typeof radioGroupItemVariants> & {\n /** Overrides the group color for this item. */\n color?: UIColor\n /** Label rendered next to the radio and linked to it. */\n label?: ReactNode\n /** Props for the rendered label. */\n labelProps?: Omit<LabelProps, 'children' | 'htmlFor'>\n /** Helper text rendered below the label. */\n description?: ReactNode\n /** Props for the rendered description. */\n descriptionProps?: Omit<React.ComponentProps<'p'>, 'children'>\n }\n\n// The `Field` control id claimed by the enclosing `RadioGroup`. Items must not reuse it (every item would share\n// one id); an item only takes a Field control id when it sits in its own nested `Field`.\nconst RadioGroupFieldControlIdContext = createContext<string | undefined>(undefined)\n\nfunction RadioGroup<Value = string>({\n className,\n color = 'primary',\n asChild,\n children,\n 'aria-invalid': ariaInvalid,\n ...props\n}: RadioGroupProps<Value>) {\n const fieldControlId = useFieldControlId()\n const fieldLabelId = useFieldLabelId()\n const invalid = useFieldInvalid(ariaInvalid)\n\n return (\n <RadioGroupFieldControlIdContext.Provider value={fieldControlId}>\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n data-color={color}\n aria-labelledby={fieldLabelId}\n aria-invalid={invalid}\n className={(state) =>\n cn('grid w-full gap-2', selectionControlColorVariants[color], resolveClassName(className, state))\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </RadioGroupFieldControlIdContext.Provider>\n )\n}\n\nfunction RadioGroupItem({\n className,\n color,\n id,\n label,\n labelProps,\n description,\n descriptionProps,\n size = 'md',\n ...props\n}: RadioGroupItemProps) {\n const generatedId = useId()\n const fieldControlId = useFieldControlId(id)\n const groupFieldControlId = useContext(RadioGroupFieldControlIdContext)\n const hasLabel = label !== undefined\n const ownFieldControlId = id === undefined && fieldControlId === groupFieldControlId ? undefined : fieldControlId\n const resolvedId = ownFieldControlId ?? (hasLabel ? generatedId : undefined)\n const { className: labelClassName, ...labelRootProps } = labelProps ?? {}\n const descriptionId = useId()\n const hasDescription = description !== undefined\n const { className: descriptionClassName, ...descriptionRootProps } = descriptionProps ?? {}\n const resolvedDescriptionId = hasDescription ? (descriptionRootProps.id ?? descriptionId) : undefined\n\n const item = (\n <RadioPrimitive.Root\n data-slot=\"radio-group-item\"\n data-color={color}\n data-size={size}\n id={resolvedId}\n aria-describedby={resolvedDescriptionId}\n className={(state) => cn(radioGroupItemVariants({ color, size }), resolveClassName(className, state))}\n {...props}\n >\n <RadioPrimitive.Indicator data-slot=\"radio-group-indicator\" className={cn(radioGroupIndicatorVariants({ size }))}>\n <span className={cn(radioGroupIndicatorDotVariants({ size }), '-translate-x-1/2 -translate-y-1/2')} />\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n )\n\n if (!hasLabel && !hasDescription) {\n return item\n }\n\n return (\n <div\n data-slot=\"radio-group-item-field\"\n className=\"grid grid-cols-[auto_1fr] items-center justify-items-start gap-x-2 gap-y-0.5\"\n >\n {item}\n {hasLabel && (\n <Label\n {...labelRootProps}\n htmlFor={resolvedId}\n className={cn(radioGroupItemLabelVariants({ size }), labelClassName)}\n >\n {label}\n </Label>\n )}\n {hasDescription && (\n <p\n data-slot=\"radio-group-item-description\"\n {...descriptionRootProps}\n id={resolvedDescriptionId}\n className={cn('col-start-2', radioGroupItemDescriptionVariants({ size }), descriptionClassName)}\n >\n {description}\n </p>\n )}\n </div>\n )\n}\n\nexport { RadioGroup, RadioGroupItem }\n"],"mappings":"goBAyBA,MAAMI,EAAyBC,EAC7B,CACE,iHACA,mDACA,4EACA,4DACA,kCACA,oIACF,EACA,CACE,SAAU,CACR,MAAOC,EACP,KAAM,CACJ,GAAI,SACJ,GAAI,WACJ,GAAI,UACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CACF,EAEMC,EAA8BF,EAAI,mCAAoC,CAC1E,SAAU,CACR,KAAM,CACJ,GAAI,SACJ,GAAI,WACJ,GAAI,UACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EAEKG,EAAiCH,EAAI,+DAAgE,CACzG,SAAU,CACR,KAAM,CACJ,GAAI,WACJ,GAAI,SACJ,GAAI,UACN,CACF,EACA,gBAAiB,CACf,KAAM,IACR,CACF,CAAC,EAEKI,EAA8BJ,EAAI,GAAI,CAC1C,SAAU,CACR,KAAM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AC7C,EAAe,KAAhB,CACE,YAAU,mBACV,aAAYoB,EACZ,YAAW2B,EACX,GAAIb,EACJ,mBAAkBU,EAClB,UAAY,GAAUvB,EAAGlB,EAAuB,CAAE,QAAO,MAAK,CAAC,EAAGF,EAAiBqB,EAAWC,CAAK,CAAC,EACpG,GAAIV,EAEJ,SAAA,kBAACb,EAAe,UAAhB,CAA0B,YAAU,wBAAwB,UAAWqB,EAAGf,EAA4B,CAAE,MAAK,CAAC,CAAC,EAC7G,SAAA,kBAAC,OAAD,CAAM,UAAWe,EAAGd,EAA+B,CAAE,MAAK,CAAC,EAAG,mCAAmC,CAAI,CAAA,CAC7E,CAAA,CACP,CAAA,EAOvB,MAJI,CAACyB,GAAY,CAACO,EACTM,EAIP,kBAAC,MAAD,CACE,YAAU,yBACV,UAAU,+EAFZ,SAAA,CAIGA,EACAb,GACC,kBAACgB,EAAD,CACE,GAAIZ,EACJ,QAASF,EACT,UAAWb,EAAGb,EAA4B,CAAE,MAAK,CAAC,EAAG2B,CAAc,EAElE,SAAAF,CACI,CAAA,EAERM,GACC,kBAAC,IAAD,CACE,YAAU,+BACV,GAAIG,EACJ,GAAIE,EACJ,UAAWvB,EAAG,cAAeZ,EAAkC,CAAE,MAAK,CAAC,EAAGgC,CAAoB,EAE7F,SAAAD,CACA,CAAA,CAEF,GAET"}
|
|
1
|
+
{"version":3,"file":"radio-group.js","names":["RadioGroupPrimitive","RadioPrimitive","resolveClassName","RadioGroup$1","radioGroupItemVariants","cva","selectionControlColorVariants","radioGroupIndicatorVariants","radioGroupIndicatorDotVariants","radioGroupItemLabelVariants","radioGroupItemDescriptionVariants","RadioGroupFieldControlIdContext","createContext","ariaInvalid","props","fieldControlId","useFieldControlId","fieldLabelId","useFieldLabelId","invalid","useFieldInvalid","color","cn","className","state","toAsChildRenderProps","asChild","children","generatedId","useId","id","groupFieldControlId","useContext","hasLabel","label","resolvedId","labelClassName","labelRootProps","labelProps","descriptionId","hasDescription","description","descriptionClassName","descriptionRootProps","descriptionProps","resolvedDescriptionId","item","Radio","size","Label"],"sources":["../../src/components/radio-group.tsx"],"sourcesContent":["import type * as React from 'react'\nimport { createContext, type ReactNode, useContext, useId } from 'react'\n\nimport { Radio as RadioPrimitive } from '@base-ui/react/radio'\nimport { RadioGroup as RadioGroupPrimitive } from '@base-ui/react/radio-group'\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { toAsChildRenderProps } from '../lib/as-child'\nimport type { UIColor } from '../lib/color'\nimport { selectionControlColorVariants } from '../lib/color'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { useFieldControlId, useFieldInvalid, useFieldLabelId } from './field'\nimport { Label, type LabelProps } from './label'\n\nexport type RadioGroupProps<Value = string> = Omit<RadioGroupPrimitive.Props<Value>, 'render'> & {\n asChild?: boolean\n} & {\n /**\n * Palette family for every item in the group.\n * @default 'primary'\n */\n color?: UIColor\n}\n\nconst radioGroupItemVariants = cva(\n [\n 'group/radio-group-item peer relative flex aspect-square shrink-0 rounded-full border border-input outline-none',\n 'after:absolute after:-inset-x-3 after:-inset-y-2',\n 'focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50',\n 'data-disabled:cursor-not-allowed data-disabled:opacity-50',\n 'dark:data-unchecked:bg-input/30',\n 'data-checked:border-(--selection-control) data-checked:bg-(--selection-control) data-checked:text-(--selection-control-foreground)'\n ],\n {\n variants: {\n color: selectionControlColorVariants,\n size: {\n sm: 'size-4',\n md: 'size-4.5',\n lg: 'size-5.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nconst radioGroupIndicatorVariants = cva('flex items-center justify-center', {\n variants: {\n size: {\n sm: 'size-4',\n md: 'size-4.5',\n lg: 'size-5.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupIndicatorDotVariants = cva('absolute top-1/2 left-1/2 rounded-full bg-primary-foreground', {\n variants: {\n size: {\n sm: 'size-1.5',\n md: 'size-2',\n lg: 'size-2.5'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupItemLabelVariants = cva('', {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-sm',\n lg: 'text-lg'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n})\n\nconst radioGroupItemDescriptionVariants = cva(\n 'text-muted-foreground text-left leading-normal font-normal [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary',\n {\n variants: {\n size: {\n sm: 'text-xs',\n md: 'text-xs',\n lg: 'text-sm'\n }\n },\n defaultVariants: {\n size: 'md'\n }\n }\n)\n\nexport type RadioGroupItemProps = Omit<React.ComponentProps<typeof RadioPrimitive.Root>, 'render'> &\n VariantProps<typeof radioGroupItemVariants> & {\n /** Overrides the group color for this item. */\n color?: UIColor\n /** Label rendered next to the radio and linked to it. */\n label?: ReactNode\n /** Props for the rendered label. */\n labelProps?: Omit<LabelProps, 'children' | 'htmlFor'>\n /** Helper text rendered below the label. */\n description?: ReactNode\n /** Props for the rendered description. */\n descriptionProps?: Omit<React.ComponentProps<'p'>, 'children'>\n }\n\n// The `Field` control id claimed by the enclosing `RadioGroup`. Items must not reuse it (every item would share\n// one id); an item only takes a Field control id when it sits in its own nested `Field`.\nconst RadioGroupFieldControlIdContext = createContext<string | undefined>(undefined)\n\nfunction RadioGroup<Value = string>({\n className,\n color = 'primary',\n asChild,\n children,\n 'aria-invalid': ariaInvalid,\n ...props\n}: RadioGroupProps<Value>) {\n const fieldControlId = useFieldControlId()\n const fieldLabelId = useFieldLabelId()\n const invalid = useFieldInvalid(ariaInvalid)\n\n return (\n <RadioGroupFieldControlIdContext.Provider value={fieldControlId}>\n <RadioGroupPrimitive\n data-slot=\"radio-group\"\n data-color={color}\n aria-labelledby={fieldLabelId}\n aria-invalid={invalid}\n className={(state) =>\n cn('grid w-full gap-2', selectionControlColorVariants[color], resolveClassName(className, state))\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n </RadioGroupFieldControlIdContext.Provider>\n )\n}\n\nfunction RadioGroupItem({\n className,\n color,\n id,\n label,\n labelProps,\n description,\n descriptionProps,\n size = 'md',\n ...props\n}: RadioGroupItemProps) {\n const generatedId = useId()\n const fieldControlId = useFieldControlId(id)\n const groupFieldControlId = useContext(RadioGroupFieldControlIdContext)\n const hasLabel = label !== undefined\n const ownFieldControlId = id === undefined && fieldControlId === groupFieldControlId ? undefined : fieldControlId\n const resolvedId = ownFieldControlId ?? (hasLabel ? generatedId : undefined)\n const { className: labelClassName, ...labelRootProps } = labelProps ?? {}\n const descriptionId = useId()\n const hasDescription = description !== undefined\n const { className: descriptionClassName, ...descriptionRootProps } = descriptionProps ?? {}\n const resolvedDescriptionId = hasDescription ? (descriptionRootProps.id ?? descriptionId) : undefined\n\n const item = (\n <RadioPrimitive.Root\n data-slot=\"radio-group-item\"\n data-color={color}\n data-size={size}\n id={resolvedId}\n aria-describedby={resolvedDescriptionId}\n className={(state) => cn(radioGroupItemVariants({ color, size }), resolveClassName(className, state))}\n {...props}\n >\n <RadioPrimitive.Indicator data-slot=\"radio-group-indicator\" className={cn(radioGroupIndicatorVariants({ size }))}>\n <span className={cn(radioGroupIndicatorDotVariants({ size }), '-translate-x-1/2 -translate-y-1/2')} />\n </RadioPrimitive.Indicator>\n </RadioPrimitive.Root>\n )\n\n if (!hasLabel && !hasDescription) {\n return item\n }\n\n return (\n <div\n data-slot=\"radio-group-item-field\"\n className=\"grid grid-cols-[auto_1fr] items-center justify-items-start gap-x-2 gap-y-0.5\"\n >\n {item}\n {hasLabel && (\n <Label\n {...labelRootProps}\n htmlFor={resolvedId}\n className={cn(radioGroupItemLabelVariants({ size }), labelClassName)}\n >\n {label}\n </Label>\n )}\n {hasDescription && (\n <p\n data-slot=\"radio-group-item-description\"\n {...descriptionRootProps}\n id={resolvedDescriptionId}\n className={cn('col-start-2', radioGroupItemDescriptionVariants({ size }), descriptionClassName)}\n >\n {description}\n </p>\n )}\n </div>\n )\n}\n\nexport { RadioGroup, RadioGroupItem }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BACV,GAAIG,EACJ,GAAIE,EACJ,UAAWvB,EAAG,cAAeZ,EAAkC,CAAE,MAAK,CAAC,EAAGgC,CAAoB,EAE7F,SAAAD,CACA,CAAA,CAEF,C,EAET,C"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
2
|
import * as ResizablePrimitive from "react-resizable-panels";
|
|
3
|
-
//#region src/components/resizable.d.ts
|
|
4
3
|
export type ResizablePanelGroupProps = ResizablePrimitive.GroupProps;
|
|
5
4
|
export type ResizablePanelProps = ResizablePrimitive.PanelProps;
|
|
6
5
|
export type ResizableHandleProps = ResizablePrimitive.SeparatorProps & {
|
|
@@ -10,6 +9,5 @@ export type ResizableHandleProps = ResizablePrimitive.SeparatorProps & {
|
|
|
10
9
|
declare function ResizablePanelGroup({ className, ...props }: ResizablePanelGroupProps): import("react").JSX.Element;
|
|
11
10
|
declare function ResizablePanel({ ...props }: ResizablePanelProps): import("react").JSX.Element;
|
|
12
11
|
declare function ResizableHandle({ withHandle, className, ...props }: ResizableHandleProps): import("react").JSX.Element;
|
|
13
|
-
//#endregion
|
|
14
12
|
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
15
13
|
//# sourceMappingURL=resizable.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resizable.js","names":["ResizablePrimitive","props","cn","className","withHandle"],"sources":["../../src/components/resizable.tsx"],"sourcesContent":["import * as ResizablePrimitive from 'react-resizable-panels'\n\nimport { cn } from '../lib/utils'\n\nexport type ResizablePanelGroupProps = ResizablePrimitive.GroupProps\n\nexport type ResizablePanelProps = ResizablePrimitive.PanelProps\n\nexport type ResizableHandleProps = ResizablePrimitive.SeparatorProps & {\n /** Shows a visible grip on the handle. */\n withHandle?: boolean\n}\n\nfunction ResizablePanelGroup({ className, ...props }: ResizablePanelGroupProps) {\n return (\n <ResizablePrimitive.Group\n data-slot=\"resizable-panel-group\"\n className={cn('flex h-full w-full aria-[orientation=vertical]:flex-col', className)}\n {...props}\n />\n )\n}\n\nfunction ResizablePanel({ ...props }: ResizablePanelProps) {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />\n}\n\nfunction ResizableHandle({ withHandle, className, ...props }: ResizableHandleProps) {\n return (\n <ResizablePrimitive.Separator\n data-slot=\"resizable-handle\"\n className={cn(\n 'relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90',\n className\n )}\n {...props}\n >\n {withHandle && <div className=\"z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border\" />}\n </ResizablePrimitive.Separator>\n )\n}\n\nexport { ResizableHandle, ResizablePanel, ResizablePanelGroup }\n"],"mappings":"8JAaA,SAAS,oBAAoB,CAAE,YAAW,GAAGC,GAAmC,CAC9E,MACE,kBAACD,EAAmB,MAApB,CACE,YAAU,wBACV,UAAWE,EAAG,0DAA2DC,CAAS,EAClF,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,eAAe,CAAE,GAAGA,GAA8B,CACzD,MAAO,kBAACD,EAAmB,MAApB,CAA0B,YAAU,kBAAkB,GAAIC,CAAQ,CAAA,CAC3E,CAEA,SAAS,gBAAgB,CAAE,aAAY,YAAW,GAAGA,GAA+B,CAClF,MACE,kBAACD,EAAmB,UAApB,CACE,YAAU,mBACV,UAAWE,EACT,ukBACAC,CACF,EACA,GAAIF,EAEH,SAAAG,GAAc,kBAAC,MAAD,CAAK,UAAU,iDAAmD,CAAA,CACrD,CAAA,CAElC"}
|
|
1
|
+
{"version":3,"file":"resizable.js","names":["ResizablePrimitive","props","cn","className","withHandle"],"sources":["../../src/components/resizable.tsx"],"sourcesContent":["import * as ResizablePrimitive from 'react-resizable-panels'\n\nimport { cn } from '../lib/utils'\n\nexport type ResizablePanelGroupProps = ResizablePrimitive.GroupProps\n\nexport type ResizablePanelProps = ResizablePrimitive.PanelProps\n\nexport type ResizableHandleProps = ResizablePrimitive.SeparatorProps & {\n /** Shows a visible grip on the handle. */\n withHandle?: boolean\n}\n\nfunction ResizablePanelGroup({ className, ...props }: ResizablePanelGroupProps) {\n return (\n <ResizablePrimitive.Group\n data-slot=\"resizable-panel-group\"\n className={cn('flex h-full w-full aria-[orientation=vertical]:flex-col', className)}\n {...props}\n />\n )\n}\n\nfunction ResizablePanel({ ...props }: ResizablePanelProps) {\n return <ResizablePrimitive.Panel data-slot=\"resizable-panel\" {...props} />\n}\n\nfunction ResizableHandle({ withHandle, className, ...props }: ResizableHandleProps) {\n return (\n <ResizablePrimitive.Separator\n data-slot=\"resizable-handle\"\n className={cn(\n 'relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90',\n className\n )}\n {...props}\n >\n {withHandle && <div className=\"z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border\" />}\n </ResizablePrimitive.Separator>\n )\n}\n\nexport { ResizableHandle, ResizablePanel, ResizablePanelGroup }\n"],"mappings":"A,8JAaA,SAAS,oBAAoB,CAAE,YAAW,GAAGC,GAAmC,CAC9E,MACE,kBAACD,EAAmB,MAApB,CACE,YAAU,wBACV,UAAWE,EAAG,0DAA2DC,CAAS,EAClF,GAAIF,CACL,CAAA,CAEL,CAEA,SAAS,eAAe,CAAE,GAAGA,GAA8B,CACzD,MAAO,kBAACD,EAAmB,MAApB,CAA0B,YAAU,kBAAkB,GAAIC,CAAQ,CAAA,CAC3E,CAEA,SAAS,gBAAgB,CAAE,aAAY,YAAW,GAAGA,GAA+B,CAClF,MACE,kBAACD,EAAmB,UAApB,CACE,YAAU,mBACV,UAAWE,EACT,ukBACAC,CACF,EACA,GAAIF,EAEH,SAAAG,GAAc,kBAAC,MAAD,CAAK,UAAU,iDAAmD,CAAA,CACrD,CAAA,CAElC,C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { VariantProps } from "class-variance-authority";
|
|
4
|
-
//#region src/components/ring-progress.d.ts
|
|
5
4
|
declare const ringProgressVariants: (props?: ({
|
|
6
5
|
size?: "lg" | "md" | "sm" | null | undefined;
|
|
7
6
|
color?: "blue" | "brand" | "gray" | "green" | "indigo" | "pink" | "primary" | "red" | "yellow" | "zinc" | null | undefined;
|
|
@@ -20,6 +19,5 @@ export type RingProgressProps = React.ComponentProps<'svg'> & VariantProps<typeo
|
|
|
20
19
|
thickness?: RingProgressThickness;
|
|
21
20
|
};
|
|
22
21
|
declare function RingProgress({ className, value, size, color, thickness, ...props }: RingProgressProps): React.JSX.Element;
|
|
23
|
-
//#endregion
|
|
24
22
|
export { RingProgress, ringProgressVariants };
|
|
25
23
|
//# sourceMappingURL=ring-progress.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"../rolldown-runtime-BhWHdk3m.js";import{
|
|
1
|
+
import"../rolldown-runtime-BhWHdk3m.js";import{progressColorVariants as e}from"../lib/progress.js";import{cn as t}from"../lib/utils.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import{cva as i}from"class-variance-authority";const a=i(`shrink-0`,{variants:{size:{sm:`size-8`,md:`size-10`,lg:`size-12`},color:e},defaultVariants:{size:`md`,color:`primary`}}),o={thin:8,md:12,thick:16};function RingProgress({className:e,value:i=0,size:s=`md`,color:c=`primary`,thickness:l=`md`,...u}){let d=o[l],f=(100-d)/2,p=2*Math.PI*f,m=Math.min(100,Math.max(0,i)),h=p*(1-m/100);return/* @__PURE__ */ r(`svg`,{"data-slot":`ring-progress`,"data-size":s,"data-color":c,"data-thickness":l,role:`progressbar`,"aria-valuenow":m,"aria-valuemin":0,"aria-valuemax":100,viewBox:`0 0 100 100`,className:t(a({size:s,color:c}),e),...u,children:[/* @__PURE__ */ n(`circle`,{cx:`50`,cy:`50`,r:f,fill:`none`,strokeWidth:d,className:`stroke-muted`}),/* @__PURE__ */ n(`circle`,{cx:`50`,cy:`50`,r:f,fill:`none`,strokeWidth:d,strokeLinecap:`round`,strokeDasharray:p,strokeDashoffset:h,transform:`rotate(-90 50 50)`,className:`stroke-(--progress-color) transition-all`})]})}export{RingProgress,a as ringProgressVariants};
|
|
2
2
|
//# sourceMappingURL=ring-progress.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ring-progress.js","names":["ringProgressVariants","cva","progressColorVariants","ringThickness","props","strokeWidth","thickness","radius","circumference","clamped","value","strokeDashoffset","size","color","cn","className"],"sources":["../../src/components/ring-progress.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { progressColorVariants } from '../lib/progress'\nimport { cn } from '../lib/utils'\n\nconst ringProgressVariants = cva('shrink-0', {\n variants: {\n size: {\n sm: 'size-8',\n md: 'size-10',\n lg: 'size-12'\n },\n color: progressColorVariants\n },\n defaultVariants: {\n size: 'md',\n color: 'primary'\n }\n})\n\nexport type RingProgressThickness = 'thin' | 'md' | 'thick'\n\nconst ringThickness = {\n thin: 8,\n md: 12,\n thick: 16\n} as const satisfies Record<RingProgressThickness, number>\n\nexport type RingProgressProps = React.ComponentProps<'svg'> &\n VariantProps<typeof ringProgressVariants> & {\n /**\n * Progress from `0` to `100`.\n * @default 0\n */\n value?: number\n /**\n * Stroke width of the ring.\n * @default 'md'\n */\n thickness?: RingProgressThickness\n }\n\nfunction RingProgress({\n className,\n value = 0,\n size = 'md',\n color = 'primary',\n thickness = 'md',\n ...props\n}: RingProgressProps) {\n const strokeWidth = ringThickness[thickness]\n const radius = (100 - strokeWidth) / 2\n const circumference = 2 * Math.PI * radius\n const clamped = Math.min(100, Math.max(0, value))\n const strokeDashoffset = circumference * (1 - clamped / 100)\n\n return (\n <svg\n data-slot=\"ring-progress\"\n data-size={size}\n data-color={color}\n data-thickness={thickness}\n role=\"progressbar\"\n aria-valuenow={clamped}\n aria-valuemin={0}\n aria-valuemax={100}\n viewBox=\"0 0 100 100\"\n className={cn(ringProgressVariants({ size, color }), className)}\n {...props}\n >\n <circle cx=\"50\" cy=\"50\" r={radius} fill=\"none\" strokeWidth={strokeWidth} className=\"stroke-muted\" />\n <circle\n cx=\"50\"\n cy=\"50\"\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={strokeDashoffset}\n transform=\"rotate(-90 50 50)\"\n className=\"stroke-(--progress-color) transition-all\"\n />\n </svg>\n )\n}\n\nexport { RingProgress, ringProgressVariants }\n"],"mappings":"yOAOA,MAAMA,EAAuBC,EAAI,WAAY,CAC3C,SAAU,CACR,KAAM,CACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACN,EACA,MAAOC,CACT,EACA,gBAAiB,CACf,KAAM,KACN,MAAO,SACT,CACF,CAAC,EAIKC,EAAgB,CACpB,KAAM,EACN,GAAI,GACJ,MAAO,EACT,EAgBA,SAAS,aAAa,CACpB,YACA,QAAQ,EACR,OAAO,KACP,QAAQ,UACR,YAAY,KACZ,GAAGC,GACiB,CACpB,IAAMC,EAAcF,EAAcG,GAC5BC,GAAU,IAAMF,GAAe,EAC/BG,EAAgB,EAAI,KAAK,GAAKD,EAC9BE,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAGC,CAAK,CAAC,EAC1CC,EAAmBH,GAAiB,EAAIC,EAAU,KAExD,MACE,kBAAC,MAAD,CACE,YAAU,gBACV,YAAWG,EACX,aAAYC,EACZ,iBAAgBP,EAChB,KAAK,cACL,gBAAeG,EACf,gBAAe,EACf,gBAAe,IACf,QAAQ,cACR,UAAWK,EAAGd,EAAqB,CAAE,OAAM,OAAM,CAAC,EAAGe,CAAS,EAC9D,GAAIX,EAXN,SAAA,CAaE,kBAAC,SAAD,CAAQ,GAAG,KAAK,GAAG,KAAK,EAAGG,EAAQ,KAAK,OAAoB,cAAa,UAAU,cAAgB,CAAA,EACnG,kBAAC,SAAD,CACE,GAAG,KACH,GAAG,KACH,EAAGA,EACH,KAAK,OACQ,cACb,cAAc,QACd,gBAAiBC,EACC,mBAClB,UAAU,oBACV,UAAU,0CACX,CAAA,CACE,
|
|
1
|
+
{"version":3,"file":"ring-progress.js","names":["ringProgressVariants","cva","progressColorVariants","ringThickness","props","strokeWidth","thickness","radius","circumference","clamped","value","strokeDashoffset","size","color","cn","className"],"sources":["../../src/components/ring-progress.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { cva, type VariantProps } from 'class-variance-authority'\n\nimport { progressColorVariants } from '../lib/progress'\nimport { cn } from '../lib/utils'\n\nconst ringProgressVariants = cva('shrink-0', {\n variants: {\n size: {\n sm: 'size-8',\n md: 'size-10',\n lg: 'size-12'\n },\n color: progressColorVariants\n },\n defaultVariants: {\n size: 'md',\n color: 'primary'\n }\n})\n\nexport type RingProgressThickness = 'thin' | 'md' | 'thick'\n\nconst ringThickness = {\n thin: 8,\n md: 12,\n thick: 16\n} as const satisfies Record<RingProgressThickness, number>\n\nexport type RingProgressProps = React.ComponentProps<'svg'> &\n VariantProps<typeof ringProgressVariants> & {\n /**\n * Progress from `0` to `100`.\n * @default 0\n */\n value?: number\n /**\n * Stroke width of the ring.\n * @default 'md'\n */\n thickness?: RingProgressThickness\n }\n\nfunction RingProgress({\n className,\n value = 0,\n size = 'md',\n color = 'primary',\n thickness = 'md',\n ...props\n}: RingProgressProps) {\n const strokeWidth = ringThickness[thickness]\n const radius = (100 - strokeWidth) / 2\n const circumference = 2 * Math.PI * radius\n const clamped = Math.min(100, Math.max(0, value))\n const strokeDashoffset = circumference * (1 - clamped / 100)\n\n return (\n <svg\n data-slot=\"ring-progress\"\n data-size={size}\n data-color={color}\n data-thickness={thickness}\n role=\"progressbar\"\n aria-valuenow={clamped}\n aria-valuemin={0}\n aria-valuemax={100}\n viewBox=\"0 0 100 100\"\n className={cn(ringProgressVariants({ size, color }), className)}\n {...props}\n >\n <circle cx=\"50\" cy=\"50\" r={radius} fill=\"none\" strokeWidth={strokeWidth} className=\"stroke-muted\" />\n <circle\n cx=\"50\"\n cy=\"50\"\n r={radius}\n fill=\"none\"\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={circumference}\n strokeDashoffset={strokeDashoffset}\n transform=\"rotate(-90 50 50)\"\n className=\"stroke-(--progress-color) transition-all\"\n />\n </svg>\n )\n}\n\nexport { RingProgress, ringProgressVariants }\n"],"mappings":"A,yOAOA,MAAMA,EAAuBC,EAAI,WAAY,CAC3C,SAAU,CACR,KAAM,CACJ,GAAI,SACJ,GAAI,UACJ,GAAI,SACN,EACA,MAAOC,CACT,EACA,gBAAiB,CACf,KAAM,KACN,MAAO,SACT,CACF,CAAC,EAIKC,EAAgB,CACpB,KAAM,EACN,GAAI,GACJ,MAAO,EACT,EAgBA,SAAS,aAAa,CACpB,YACA,QAAQ,EACR,OAAO,KACP,QAAQ,UACR,YAAY,KACZ,GAAGC,GACiB,CACpB,IAAMC,EAAcF,EAAcG,GAC5BC,GAAU,IAAMF,GAAe,EAC/BG,EAAgB,EAAI,KAAK,GAAKD,EAC9BE,EAAU,KAAK,IAAI,IAAK,KAAK,IAAI,EAAGC,CAAK,CAAC,EAC1CC,EAAmBH,GAAiB,EAAIC,EAAU,KAExD,MACE,kBAAC,MAAD,CACE,YAAU,gBACV,YAAWG,EACX,aAAYC,EACZ,iBAAgBP,EAChB,KAAK,cACL,gBAAeG,EACf,gBAAe,EACf,gBAAe,IACf,QAAQ,cACR,UAAWK,EAAGd,EAAqB,CAAE,OAAM,OAAM,CAAC,EAAGe,CAAS,EAC9D,GAAIX,EAXN,SAAA,CAaE,kBAAC,SAAD,CAAQ,GAAG,KAAK,GAAG,KAAK,EAAGG,EAAQ,KAAK,OAAoB,cAAa,UAAU,cAAgB,CAAA,EACnG,kBAAC,SAAD,CACE,GAAG,KACH,GAAG,KACH,EAAGA,EACH,KAAK,OACQ,cACb,cAAc,QACd,gBAAiBC,EACC,mBAClB,UAAU,oBACV,UAAU,0CACX,CAAA,CACE,C,EAET,C"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { ScrollArea as ScrollArea$1 } from "@base-ui/react/scroll-area";
|
|
4
|
-
//#region src/components/scroll-area.d.ts
|
|
5
4
|
export type ScrollAreaProps = Omit<React.ComponentProps<typeof ScrollArea$1.Root>, 'render'>;
|
|
6
5
|
export type ScrollBarProps = Omit<React.ComponentProps<typeof ScrollArea$1.Scrollbar>, 'render'>;
|
|
7
6
|
declare function ScrollArea({ className, children, ...props }: ScrollAreaProps): React.JSX.Element;
|
|
8
7
|
declare function ScrollBar({ className, orientation, ...props }: ScrollBarProps): React.JSX.Element;
|
|
9
|
-
//#endregion
|
|
10
8
|
export { ScrollArea, ScrollBar };
|
|
11
9
|
//# sourceMappingURL=scroll-area.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scroll-area.js","names":["ScrollAreaPrimitive","ScrollArea$1","props","cn","resolveClassName","className","state","orientation"],"sources":["../../src/components/scroll-area.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area'\n\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type ScrollAreaProps = Omit<React.ComponentProps<typeof ScrollAreaPrimitive.Root>, 'render'>\n\nexport type ScrollBarProps = Omit<React.ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>, 'render'>\n\nfunction ScrollArea({ className, children, ...props }: ScrollAreaProps) {\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n className={(state) => cn('relative', resolveClassName(className, state))}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className={cn(\n 'size-full rounded-[inherit] transition-[color,box-shadow] outline-none',\n 'focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1'\n )}\n >\n <ScrollAreaPrimitive.Content data-slot=\"scroll-area-content\">{children}</ScrollAreaPrimitive.Content>\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n )\n}\n\nfunction ScrollBar({ className, orientation = 'vertical', ...props }: ScrollBarProps) {\n return (\n <ScrollAreaPrimitive.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n data-orientation={orientation}\n orientation={orientation}\n className={(state) =>\n cn(\n 'flex touch-none p-px transition-opacity select-none',\n 'opacity-0 delay-600 data-hovering:opacity-100 data-hovering:delay-0 data-scrolling:opacity-100 data-scrolling:delay-0',\n 'data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent',\n 'data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent',\n resolveClassName(className, state)\n )\n }\n {...props}\n >\n <ScrollAreaPrimitive.Thumb data-slot=\"scroll-area-thumb\" className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.Scrollbar>\n )\n}\n\nexport { ScrollArea, ScrollBar }\n"],"mappings":"wOAWA,SAAS,WAAW,CAAE,YAAW,WAAU,GAAGE,GAA0B,CACtE,MACE,kBAACF,EAAoB,KAArB,CACE,YAAU,cACV,UAAY,GAAUG,EAAG,WAAYC,EAAiBC,EAAWC,CAAK,CAAC,EACvE,GAAIJ,EAHN,SAAA,CAKE,kBAACF,EAAoB,SAArB,CACE,YAAU,uBACV,UAAWG,EACT,yEACA,6EACF,EAEA,SAAA,kBAACH,EAAoB,QAArB,CAA6B,YAAU,sBAAuB,UAAsC,CAAA,CACxE,CAAA,EAC9B,kBAAC,UAAD,CAAY,CAAA,EACZ,kBAACA,EAAoB,OAArB,CAA6B,CAAA,CACL,
|
|
1
|
+
{"version":3,"file":"scroll-area.js","names":["ScrollAreaPrimitive","ScrollArea$1","props","cn","resolveClassName","className","state","orientation"],"sources":["../../src/components/scroll-area.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { ScrollArea as ScrollAreaPrimitive } from '@base-ui/react/scroll-area'\n\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type ScrollAreaProps = Omit<React.ComponentProps<typeof ScrollAreaPrimitive.Root>, 'render'>\n\nexport type ScrollBarProps = Omit<React.ComponentProps<typeof ScrollAreaPrimitive.Scrollbar>, 'render'>\n\nfunction ScrollArea({ className, children, ...props }: ScrollAreaProps) {\n return (\n <ScrollAreaPrimitive.Root\n data-slot=\"scroll-area\"\n className={(state) => cn('relative', resolveClassName(className, state))}\n {...props}\n >\n <ScrollAreaPrimitive.Viewport\n data-slot=\"scroll-area-viewport\"\n className={cn(\n 'size-full rounded-[inherit] transition-[color,box-shadow] outline-none',\n 'focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1'\n )}\n >\n <ScrollAreaPrimitive.Content data-slot=\"scroll-area-content\">{children}</ScrollAreaPrimitive.Content>\n </ScrollAreaPrimitive.Viewport>\n <ScrollBar />\n <ScrollAreaPrimitive.Corner />\n </ScrollAreaPrimitive.Root>\n )\n}\n\nfunction ScrollBar({ className, orientation = 'vertical', ...props }: ScrollBarProps) {\n return (\n <ScrollAreaPrimitive.Scrollbar\n data-slot=\"scroll-area-scrollbar\"\n data-orientation={orientation}\n orientation={orientation}\n className={(state) =>\n cn(\n 'flex touch-none p-px transition-opacity select-none',\n 'opacity-0 delay-600 data-hovering:opacity-100 data-hovering:delay-0 data-scrolling:opacity-100 data-scrolling:delay-0',\n 'data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent',\n 'data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent',\n resolveClassName(className, state)\n )\n }\n {...props}\n >\n <ScrollAreaPrimitive.Thumb data-slot=\"scroll-area-thumb\" className=\"relative flex-1 rounded-full bg-border\" />\n </ScrollAreaPrimitive.Scrollbar>\n )\n}\n\nexport { ScrollArea, ScrollBar }\n"],"mappings":"A,wOAWA,SAAS,WAAW,CAAE,YAAW,WAAU,GAAGE,GAA0B,CACtE,MACE,kBAACF,EAAoB,KAArB,CACE,YAAU,cACV,UAAY,GAAUG,EAAG,WAAYC,EAAiBC,EAAWC,CAAK,CAAC,EACvE,GAAIJ,EAHN,SAAA,CAKE,kBAACF,EAAoB,SAArB,CACE,YAAU,uBACV,UAAWG,EACT,yEACA,6EACF,EAEA,SAAA,kBAACH,EAAoB,QAArB,CAA6B,YAAU,sBAAuB,UAAsC,CAAA,CACxE,CAAA,EAC9B,kBAAC,UAAD,CAAY,CAAA,EACZ,kBAACA,EAAoB,OAArB,CAA6B,CAAA,CACL,C,EAE9B,CAEA,SAAS,UAAU,CAAE,YAAW,cAAc,WAAY,GAAGE,GAAyB,CACpF,MACE,kBAACF,EAAoB,UAArB,CACE,YAAU,wBACV,mBAAkBO,EACL,cACb,UAAY,GACVJ,EACE,sDACA,wHACA,+GACA,qGACAC,EAAiBC,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EAEJ,SAAA,kBAACF,EAAoB,MAArB,CAA2B,YAAU,oBAAoB,UAAU,wCAA0C,CAAA,CAChF,CAAA,CAEnC,C"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
-
import { t as AsChildPrimitiveProps } from "../as-child-
|
|
2
|
+
import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Select as Select$1 } from "@base-ui/react/select";
|
|
5
|
-
//#region src/components/select.d.ts
|
|
6
5
|
export type SelectProps<Value = string, Multiple extends boolean | undefined = false> = Select$1.Root.Props<Value, Multiple>;
|
|
7
6
|
export type SelectGroupProps = AsChildPrimitiveProps<typeof Select$1.Group>;
|
|
8
7
|
export type SelectValueProps = AsChildPrimitiveProps<typeof Select$1.Value>;
|
|
@@ -29,6 +28,5 @@ declare function SelectItem({ className, children, ...props }: SelectItemProps):
|
|
|
29
28
|
declare function SelectSeparator({ className, asChild, children, ...props }: SelectSeparatorProps): React.JSX.Element;
|
|
30
29
|
declare function SelectScrollUpButton({ className, asChild, children, ...props }: SelectScrollUpButtonProps): React.JSX.Element;
|
|
31
30
|
declare function SelectScrollDownButton({ className, asChild, children, ...props }: SelectScrollDownButtonProps): React.JSX.Element;
|
|
32
|
-
//#endregion
|
|
33
31
|
export { Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue };
|
|
34
32
|
//# sourceMappingURL=select.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","names":["SelectPrimitive","resolveClassName","Select$1","props","cn","className","state","toAsChildRenderProps","asChild","children","ariaInvalid","fieldControlId","useFieldControlId","id","invalid","useFieldInvalid","size","IconSelector","alignItemWithTrigger","IconCheck","IconChevronUp","IconChevronDown"],"sources":["../../src/components/select.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Select as SelectPrimitive } from '@base-ui/react/select'\nimport { IconCheck, IconChevronDown, IconChevronUp, IconSelector } from '@tabler/icons-react'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { useFieldControlId, useFieldInvalid } from './field'\n\nexport type SelectProps<Value = string, Multiple extends boolean | undefined = false> = SelectPrimitive.Root.Props<\n Value,\n Multiple\n>\n\nexport type SelectGroupProps = AsChildPrimitiveProps<typeof SelectPrimitive.Group>\n\nexport type SelectValueProps = AsChildPrimitiveProps<typeof SelectPrimitive.Value>\n\nexport type SelectTriggerProps = AsChildPrimitiveProps<typeof SelectPrimitive.Trigger> & {\n /**\n * Height of the trigger.\n * @default 'md'\n */\n size?: 'sm' | 'md'\n}\n\nexport type SelectContentProps = Omit<React.ComponentProps<typeof SelectPrimitive.Popup>, 'render'> &\n Pick<\n React.ComponentProps<typeof SelectPrimitive.Positioner>,\n 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'alignItemWithTrigger' | 'sticky'\n >\n\nexport type SelectLabelProps = AsChildPrimitiveProps<typeof SelectPrimitive.GroupLabel>\n\nexport type SelectItemProps = Omit<React.ComponentProps<typeof SelectPrimitive.Item>, 'render'>\n\nexport type SelectSeparatorProps = AsChildPrimitiveProps<typeof SelectPrimitive.Separator>\n\nexport type SelectScrollUpButtonProps = AsChildPrimitiveProps<typeof SelectPrimitive.ScrollUpArrow>\n\nexport type SelectScrollDownButtonProps = AsChildPrimitiveProps<typeof SelectPrimitive.ScrollDownArrow>\n\nfunction Select<Value = string, Multiple extends boolean | undefined = false>({\n ...props\n}: SelectProps<Value, Multiple>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({ className, asChild, children, ...props }: SelectGroupProps) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={(state) => cn('scroll-my-1 p-1', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction SelectValue({ asChild, children, ...props }: SelectValueProps) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction SelectTrigger({\n className,\n id,\n size = 'md',\n children,\n asChild,\n 'aria-invalid': ariaInvalid,\n ...props\n}: SelectTriggerProps) {\n const fieldControlId = useFieldControlId(id)\n const invalid = useFieldInvalid(ariaInvalid)\n\n return (\n <SelectPrimitive.Trigger\n id={fieldControlId}\n aria-invalid={invalid}\n data-slot=\"select-trigger\"\n data-size={size}\n className={(state) =>\n cn(\n 'border-input data-placeholder:text-placeholder dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-1.5 whitespace-nowrap rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none outline-none',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'data-[size=md]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)]',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5',\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n 'disabled:cursor-not-allowed disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:opacity-50',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && (\n <SelectPrimitive.Icon render={<IconSelector className=\"text-muted-foreground size-4 pointer-events-none\" />} />\n )}\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n children,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 0,\n alignItemWithTrigger = true,\n sticky,\n ...props\n}: SelectContentProps) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n sticky={sticky}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n data-align-trigger={alignItemWithTrigger}\n className={(state) =>\n cn(\n 'bg-popover text-popover-foreground ring-foreground/10 relative isolate z-50 min-w-[max(--spacing(36),var(--anchor-width))] max-h-(--available-height) rounded-lg shadow-md ring-1 duration-100 origin-(--transform-origin) overflow-x-hidden overflow-y-auto',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'data-[align-trigger=true]:animate-none',\n resolveClassName(className, state)\n )\n }\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List>{children}</SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({ className, asChild, children, ...props }: SelectLabelProps) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={(state) => cn('text-muted-foreground px-1.5 py-1 text-xs', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={(state) =>\n cn(\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none',\n '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n resolveClassName(className, state)\n )\n }\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <IconCheck className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText render={<span />}>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({ className, asChild, children, ...props }: SelectSeparatorProps) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={(state) => cn('bg-border -mx-1 my-1 h-px pointer-events-none', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction SelectScrollUpButton({ className, asChild, children, ...props }: SelectScrollUpButtonProps) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={(state) =>\n cn(\n 'bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1',\n \"[&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n <IconChevronUp />\n </SelectPrimitive.ScrollUpArrow>\n )\n}\n\nfunction SelectScrollDownButton({ className, asChild, children, ...props }: SelectScrollDownButtonProps) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={(state) =>\n cn(\n 'bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1',\n \"[&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n <IconChevronDown />\n </SelectPrimitive.ScrollDownArrow>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue\n}\n"],"mappings":"4cA2CA,SAAS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EA,SAAS,qBAAqB,CAAE,YAAW,UAAS,WAAU,GAAGN,GAAoC,CACnG,MACE,kBAACH,EAAgB,cAAjB,CACE,YAAU,0BACV,UAAY,GACVI,EACE,oFACA,uCACAH,EAAiBI,EAAWC,CAAK,CACnC,EAEF,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,EAE1C,SAAA,kBAACW,EAAD,CAAgB,CAAA,CACa,CAAA,CAEnC,CAEA,SAAS,uBAAuB,CAAE,YAAW,UAAS,WAAU,GAAGjB,GAAsC,CACvG,MACE,kBAACH,EAAgB,gBAAjB,CACE,YAAU,4BACV,UAAY,GACVI,EACE,uFACA,uCACAH,EAAiBI,EAAWC,CAAK,CACnC,EAEF,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,EAE1C,SAAA,kBAACY,EAAD,CAAkB,CAAA,CACa,CAAA,CAErC"}
|
|
1
|
+
{"version":3,"file":"select.js","names":["SelectPrimitive","resolveClassName","Select$1","props","cn","className","state","toAsChildRenderProps","asChild","children","ariaInvalid","fieldControlId","useFieldControlId","id","invalid","useFieldInvalid","size","IconSelector","alignItemWithTrigger","IconCheck","IconChevronUp","IconChevronDown"],"sources":["../../src/components/select.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { Select as SelectPrimitive } from '@base-ui/react/select'\nimport { IconCheck, IconChevronDown, IconChevronUp, IconSelector } from '@tabler/icons-react'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\nimport { useFieldControlId, useFieldInvalid } from './field'\n\nexport type SelectProps<Value = string, Multiple extends boolean | undefined = false> = SelectPrimitive.Root.Props<\n Value,\n Multiple\n>\n\nexport type SelectGroupProps = AsChildPrimitiveProps<typeof SelectPrimitive.Group>\n\nexport type SelectValueProps = AsChildPrimitiveProps<typeof SelectPrimitive.Value>\n\nexport type SelectTriggerProps = AsChildPrimitiveProps<typeof SelectPrimitive.Trigger> & {\n /**\n * Height of the trigger.\n * @default 'md'\n */\n size?: 'sm' | 'md'\n}\n\nexport type SelectContentProps = Omit<React.ComponentProps<typeof SelectPrimitive.Popup>, 'render'> &\n Pick<\n React.ComponentProps<typeof SelectPrimitive.Positioner>,\n 'side' | 'sideOffset' | 'align' | 'alignOffset' | 'alignItemWithTrigger' | 'sticky'\n >\n\nexport type SelectLabelProps = AsChildPrimitiveProps<typeof SelectPrimitive.GroupLabel>\n\nexport type SelectItemProps = Omit<React.ComponentProps<typeof SelectPrimitive.Item>, 'render'>\n\nexport type SelectSeparatorProps = AsChildPrimitiveProps<typeof SelectPrimitive.Separator>\n\nexport type SelectScrollUpButtonProps = AsChildPrimitiveProps<typeof SelectPrimitive.ScrollUpArrow>\n\nexport type SelectScrollDownButtonProps = AsChildPrimitiveProps<typeof SelectPrimitive.ScrollDownArrow>\n\nfunction Select<Value = string, Multiple extends boolean | undefined = false>({\n ...props\n}: SelectProps<Value, Multiple>) {\n return <SelectPrimitive.Root data-slot=\"select\" {...props} />\n}\n\nfunction SelectGroup({ className, asChild, children, ...props }: SelectGroupProps) {\n return (\n <SelectPrimitive.Group\n data-slot=\"select-group\"\n className={(state) => cn('scroll-my-1 p-1', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction SelectValue({ asChild, children, ...props }: SelectValueProps) {\n return <SelectPrimitive.Value data-slot=\"select-value\" {...props} {...toAsChildRenderProps(asChild, children)} />\n}\n\nfunction SelectTrigger({\n className,\n id,\n size = 'md',\n children,\n asChild,\n 'aria-invalid': ariaInvalid,\n ...props\n}: SelectTriggerProps) {\n const fieldControlId = useFieldControlId(id)\n const invalid = useFieldInvalid(ariaInvalid)\n\n return (\n <SelectPrimitive.Trigger\n id={fieldControlId}\n aria-invalid={invalid}\n data-slot=\"select-trigger\"\n data-size={size}\n className={(state) =>\n cn(\n 'border-input data-placeholder:text-placeholder dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-1.5 whitespace-nowrap rounded-lg border bg-transparent py-2 pr-2 pl-2.5 text-sm transition-colors select-none outline-none',\n 'focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-3',\n 'aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-invalid:ring-3 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40',\n 'data-[size=md]:h-8 data-[size=sm]:h-7 data-[size=sm]:rounded-[min(var(--radius-md),10px)]',\n '*:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-1.5',\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n 'disabled:cursor-not-allowed disabled:opacity-50 data-disabled:cursor-not-allowed data-disabled:opacity-50',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n {!asChild && children}\n {!asChild && (\n <SelectPrimitive.Icon render={<IconSelector className=\"text-muted-foreground size-4 pointer-events-none\" />} />\n )}\n </SelectPrimitive.Trigger>\n )\n}\n\nfunction SelectContent({\n className,\n children,\n side = 'bottom',\n sideOffset = 4,\n align = 'center',\n alignOffset = 0,\n alignItemWithTrigger = true,\n sticky,\n ...props\n}: SelectContentProps) {\n return (\n <SelectPrimitive.Portal>\n <SelectPrimitive.Positioner\n side={side}\n sideOffset={sideOffset}\n align={align}\n alignOffset={alignOffset}\n alignItemWithTrigger={alignItemWithTrigger}\n sticky={sticky}\n className=\"isolate z-50\"\n >\n <SelectPrimitive.Popup\n data-slot=\"select-content\"\n data-align-trigger={alignItemWithTrigger}\n className={(state) =>\n cn(\n 'bg-popover text-popover-foreground ring-foreground/10 relative isolate z-50 min-w-[max(--spacing(36),var(--anchor-width))] max-h-(--available-height) rounded-lg shadow-md ring-1 duration-100 origin-(--transform-origin) overflow-x-hidden overflow-y-auto',\n 'data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95',\n 'data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n 'data-[align-trigger=true]:animate-none',\n resolveClassName(className, state)\n )\n }\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.List>{children}</SelectPrimitive.List>\n <SelectScrollDownButton />\n </SelectPrimitive.Popup>\n </SelectPrimitive.Positioner>\n </SelectPrimitive.Portal>\n )\n}\n\nfunction SelectLabel({ className, asChild, children, ...props }: SelectLabelProps) {\n return (\n <SelectPrimitive.GroupLabel\n data-slot=\"select-label\"\n className={(state) => cn('text-muted-foreground px-1.5 py-1 text-xs', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction SelectItem({ className, children, ...props }: SelectItemProps) {\n return (\n <SelectPrimitive.Item\n data-slot=\"select-item\"\n className={(state) =>\n cn(\n 'focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground',\n 'relative flex w-full cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none',\n '*:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2',\n \"[&_svg:not([class*='size-'])]:size-4 [&_svg]:pointer-events-none [&_svg]:shrink-0\",\n 'data-disabled:pointer-events-none data-disabled:opacity-50',\n resolveClassName(className, state)\n )\n }\n {...props}\n >\n <span className=\"pointer-events-none absolute right-2 flex size-4 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <IconCheck className=\"pointer-events-none\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n <SelectPrimitive.ItemText render={<span />}>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n )\n}\n\nfunction SelectSeparator({ className, asChild, children, ...props }: SelectSeparatorProps) {\n return (\n <SelectPrimitive.Separator\n data-slot=\"select-separator\"\n className={(state) => cn('bg-border -mx-1 my-1 h-px pointer-events-none', resolveClassName(className, state))}\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nfunction SelectScrollUpButton({ className, asChild, children, ...props }: SelectScrollUpButtonProps) {\n return (\n <SelectPrimitive.ScrollUpArrow\n data-slot=\"select-scroll-up-button\"\n className={(state) =>\n cn(\n 'bg-popover top-0 z-10 flex w-full cursor-default items-center justify-center py-1',\n \"[&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n <IconChevronUp />\n </SelectPrimitive.ScrollUpArrow>\n )\n}\n\nfunction SelectScrollDownButton({ className, asChild, children, ...props }: SelectScrollDownButtonProps) {\n return (\n <SelectPrimitive.ScrollDownArrow\n data-slot=\"select-scroll-down-button\"\n className={(state) =>\n cn(\n 'bg-popover bottom-0 z-10 flex w-full cursor-default items-center justify-center py-1',\n \"[&_svg:not([class*='size-'])]:size-4\",\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n >\n <IconChevronDown />\n </SelectPrimitive.ScrollDownArrow>\n )\n}\n\nexport {\n Select,\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue\n}\n"],"mappings":"A,4cA2CA,SAAS,OAAqE,CAC5E,GAAGG,GAC4B,CAC/B,MAAO,kBAACH,EAAgB,KAAjB,CAAsB,YAAU,SAAS,GAAIG,CAAQ,CAAA,CAC9D,CAEA,SAAS,YAAY,CAAE,YAAW,UAAS,WAAU,GAAGA,GAA2B,CACjF,MACE,kBAACH,EAAgB,MAAjB,CACE,YAAU,eACV,UAAY,GAAUI,EAAG,kBAAmBH,EAAiBI,EAAWC,CAAK,CAAC,EAC9E,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,CAEA,SAAS,YAAY,CAAE,UAAS,W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E,YAAU,4BACV,UAAY,GACVI,EACE,uFACA,uCACAH,EAAiBI,EAAWC,CAAK,CACnC,EAEF,GAAIH,EACJ,GAAII,EAAqBC,EAASC,CAAQ,EAE1C,SAAA,kBAACY,EAAD,CAAkB,CAAA,CACa,CAAA,CAErC,C"}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
-
import { t as AsChildPrimitiveProps } from "../as-child-
|
|
2
|
+
import { t as AsChildPrimitiveProps } from "../as-child-T9W73ZYU.js";
|
|
3
3
|
import { Separator as Separator$1 } from "@base-ui/react/separator";
|
|
4
|
-
//#region src/components/separator.d.ts
|
|
5
4
|
export type SeparatorProps = AsChildPrimitiveProps<typeof Separator$1> & {
|
|
6
5
|
/**
|
|
7
6
|
* When `true` (default), the separator is purely visual and hidden from assistive technology.
|
|
@@ -9,6 +8,5 @@ export type SeparatorProps = AsChildPrimitiveProps<typeof Separator$1> & {
|
|
|
9
8
|
decorative?: boolean;
|
|
10
9
|
};
|
|
11
10
|
declare function Separator({ className, orientation, decorative, asChild, children, ...props }: SeparatorProps): import("react").JSX.Element;
|
|
12
|
-
//#endregion
|
|
13
11
|
export { Separator };
|
|
14
12
|
//# sourceMappingURL=separator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"separator.js","names":["SeparatorPrimitive","resolveClassName","Separator$1","props","decorative","cn","className","state","toAsChildRenderProps","asChild","children"],"sources":["../../src/components/separator.tsx"],"sourcesContent":["import { Separator as SeparatorPrimitive } from '@base-ui/react/separator'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type SeparatorProps = AsChildPrimitiveProps<typeof SeparatorPrimitive> & {\n /**\n * When `true` (default), the separator is purely visual and hidden from assistive technology.\n */\n decorative?: boolean\n}\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n asChild,\n children,\n ...props\n}: SeparatorProps) {\n return (\n <SeparatorPrimitive\n data-slot=\"separator\"\n orientation={orientation}\n {...(decorative && { role: 'none', 'aria-orientation': undefined })}\n className={(state) =>\n cn(\n 'bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport { Separator }\n"],"mappings":"0RAaA,SAAS,UAAU,CACjB,YACA,cAAc,aACd,aAAa,GACb,UACA,WACA,GAAGG,GACc,CACjB,MACE,kBAACH,EAAD,CACE,YAAU,YACG,cACb,GAAKI,GAAc,CAAE,KAAM,OAAQ,mBAAoB,IAAA,EAAU,EACjE,UAAY,GACVC,EACE,+GACAJ,EAAiBK,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL"}
|
|
1
|
+
{"version":3,"file":"separator.js","names":["SeparatorPrimitive","resolveClassName","Separator$1","props","decorative","cn","className","state","toAsChildRenderProps","asChild","children"],"sources":["../../src/components/separator.tsx"],"sourcesContent":["import { Separator as SeparatorPrimitive } from '@base-ui/react/separator'\n\nimport { type AsChildPrimitiveProps, toAsChildRenderProps } from '../lib/as-child'\nimport { cn } from '../lib/utils'\nimport { resolveClassName } from '../utils/resolve-class-name'\n\nexport type SeparatorProps = AsChildPrimitiveProps<typeof SeparatorPrimitive> & {\n /**\n * When `true` (default), the separator is purely visual and hidden from assistive technology.\n */\n decorative?: boolean\n}\n\nfunction Separator({\n className,\n orientation = 'horizontal',\n decorative = true,\n asChild,\n children,\n ...props\n}: SeparatorProps) {\n return (\n <SeparatorPrimitive\n data-slot=\"separator\"\n orientation={orientation}\n {...(decorative && { role: 'none', 'aria-orientation': undefined })}\n className={(state) =>\n cn(\n 'bg-border shrink-0 data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch',\n resolveClassName(className, state)\n )\n }\n {...props}\n {...toAsChildRenderProps(asChild, children)}\n />\n )\n}\n\nexport { Separator }\n"],"mappings":"A,0RAaA,SAAS,UAAU,CACjB,YACA,cAAc,aACd,aAAa,GACb,UACA,WACA,GAAGG,GACc,CACjB,MACE,kBAACH,EAAD,CACE,YAAU,YACG,cACb,GAAKI,GAAc,CAAE,KAAM,OAAQ,mBAAoB,IAAA,EAAU,EACjE,UAAY,GACVC,EACE,+GACAJ,EAAiBK,EAAWC,CAAK,CACnC,EAEF,GAAIJ,EACJ,GAAIK,EAAqBC,EAASC,CAAQ,CAC3C,CAAA,CAEL,C"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { t as __name } from "../rolldown-runtime-BhWHdk3m.js";
|
|
2
|
-
import { n as AsChildProps } from "../as-child-
|
|
2
|
+
import { n as AsChildProps } from "../as-child-T9W73ZYU.js";
|
|
3
3
|
import { Button } from "./button.js";
|
|
4
|
-
import { Separator } from "./separator.js";
|
|
5
4
|
import { Input } from "./input.js";
|
|
5
|
+
import { Separator } from "./separator.js";
|
|
6
6
|
import { TooltipContent } from "./tooltip.js";
|
|
7
7
|
import * as React from "react";
|
|
8
8
|
import { VariantProps } from "class-variance-authority";
|
|
9
|
-
//#region src/components/sidebar.d.ts
|
|
10
9
|
type SidebarContextProps = {
|
|
11
10
|
state: 'expanded' | 'collapsed';
|
|
12
11
|
open: boolean;
|
|
@@ -144,6 +143,5 @@ declare function SidebarMenuSkeleton({ className, showIcon, ...props }: SidebarM
|
|
|
144
143
|
declare function SidebarMenuSub({ className, ...props }: SidebarMenuSubProps): React.JSX.Element;
|
|
145
144
|
declare function SidebarMenuSubItem({ className, ...props }: SidebarMenuSubItemProps): React.JSX.Element;
|
|
146
145
|
declare function SidebarMenuSubButton({ size, isActive, className, ...props }: SidebarMenuSubButtonProps): React.ReactElement<unknown, string | React.JSXElementConstructor<any>>;
|
|
147
|
-
//#endregion
|
|
148
146
|
export { Sidebar, SidebarContent, SidebarFooter, SidebarGroup, SidebarGroupAction, SidebarGroupContent, SidebarGroupLabel, SidebarHeader, SidebarInput, SidebarInset, SidebarMenu, SidebarMenuAction, SidebarMenuBadge, SidebarMenuButton, SidebarMenuItem, SidebarMenuSkeleton, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem, SidebarProvider, SidebarRail, SidebarSeparator, SidebarTrigger, useSidebar };
|
|
149
147
|
//# sourceMappingURL=sidebar.d.ts.map
|