periplo-ui 4.16.0 → 4.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/feedback/Dialog/Dialog.js +1 -1
- package/dist/components/feedback/Dialog/Dialog.js.map +1 -1
- package/dist/components/feedback/Skeleton/Skeleton.js +1 -1
- package/dist/components/feedback/Skeleton/Skeleton.js.map +1 -1
- package/dist/components/inputs/Button/Button.js +1 -1
- package/dist/components/inputs/Button/Button.js.map +1 -1
- package/dist/components/inputs/Combobox/Combobox.js +2 -1
- package/dist/components/inputs/Combobox/Combobox.js.map +1 -1
- package/dist/components/inputs/Combobox/StaticComboboxList.js +1 -2
- package/dist/components/inputs/Combobox/StaticComboboxList.js.map +1 -1
- package/dist/components/inputs/Combobox/VirtualizedComboboxList.js +1 -2
- package/dist/components/inputs/Combobox/VirtualizedComboboxList.js.map +1 -1
- package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.js +12 -13
- package/dist/components/inputs/InlineMultiSelect/InlineMultiSelect.js.map +1 -1
- package/dist/components/inputs/LazyDatePicker/LazyDatePicker.js +1 -1
- package/dist/components/inputs/LazyDatePicker/LazyDatePicker.js.map +1 -1
- package/dist/components/inputs/MultiSelect/MultiSelect.js +12 -13
- package/dist/components/inputs/MultiSelect/MultiSelect.js.map +1 -1
- package/dist/components/inputs/PhoneInput/PhoneInput.js +2 -1
- package/dist/components/inputs/PhoneInput/PhoneInput.js.map +1 -1
- package/dist/components/inputs/Select/Select.js +6 -5
- package/dist/components/inputs/Select/Select.js.map +1 -1
- package/dist/components/inputs/Toggle/Toggle.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.js.map +1 -1
- package/dist/components/navigation/DropdownMenu/DropdownMenu.js +7 -6
- package/dist/components/navigation/DropdownMenu/DropdownMenu.js.map +1 -1
- package/dist/components/navigation/Sheet/Sheet.js +1 -1
- package/dist/components/navigation/Sheet/Sheet.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarMenu.js +2 -2
- package/dist/components/navigation/Sidebar/SidebarMenu.js.map +1 -1
- package/dist/components/navigation/Sidebar/SidebarUser.js +1 -1
- package/dist/components/navigation/Sidebar/SidebarUser.js.map +1 -1
- package/dist/components/navigation/Sidebar/styles.d.ts +1 -1
- package/dist/components/navigation/Sidebar/styles.js +3 -1
- package/dist/components/navigation/Sidebar/styles.js.map +1 -1
- package/dist/components/utils/Command/Command.js +8 -7
- package/dist/components/utils/Command/Command.js.map +1 -1
- package/dist/components/utils/Popover/Popover.js +2 -1
- package/dist/components/utils/Popover/Popover.js.map +1 -1
- package/dist/lib/surface.d.ts +5 -0
- package/dist/lib/surface.js +10 -0
- package/dist/lib/surface.js.map +1 -0
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn, createSearchMatcher } from "../../../lib/utils.js";
|
|
2
|
+
import { SURFACE_LIST } from "../../../lib/surface.js";
|
|
2
3
|
import { useListScroll } from "../../../lib/useListScroll.js";
|
|
3
4
|
import { Command, CommandInput } from "../../utils/Command/Command.js";
|
|
4
5
|
import { PopoverContent, PopoverRoot, PopoverTrigger } from "../../utils/Popover/Popover.js";
|
|
@@ -115,7 +116,7 @@ function PhoneInput(props) {
|
|
|
115
116
|
})
|
|
116
117
|
}), /* @__PURE__ */ jsx(PopoverContent, {
|
|
117
118
|
align: "start",
|
|
118
|
-
className: "w-72 overflow-hidden p-0",
|
|
119
|
+
className: cn(SURFACE_LIST, "w-72 overflow-hidden p-0"),
|
|
119
120
|
children: /* @__PURE__ */ jsxs(Command, {
|
|
120
121
|
shouldFilter: false,
|
|
121
122
|
defaultValue: selectedValue,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PhoneInput.js","names":["React","_Fragment"],"sources":["../../../../src/components/inputs/PhoneInput/PhoneInput.tsx"],"sourcesContent":["import { CaretDownIcon } from '@phosphor-icons/react/dist/ssr/CaretDown'\nimport { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { GlobeIcon } from '@phosphor-icons/react/dist/ssr/Globe'\nimport { WarningCircleIcon } from '@phosphor-icons/react/dist/ssr/WarningCircle'\nimport * as React from 'react'\n\nimport { Flag } from '../../data-display/Flag'\nimport { Command, CommandInput } from '../../utils/Command'\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from '../../utils/Popover'\nimport { VirtualizedComboboxList } from '../Combobox'\n\nimport { usePhoneField } from './hooks'\nimport { exampleNational } from './phone'\nimport type { PhoneCountry, PhoneInputCountryAccessors, PhoneValue } from './types'\n\nimport { buildCountries, splitByPriority } from '@/lib/countries'\nimport { useListScroll } from '@/lib/useListScroll'\nimport { cn, createSearchMatcher } from '@/lib/utils'\n\ntype PhoneInputBaseProps = {\n /** Lands on the number input, so `<label htmlFor>` targets it. */\n id?: string\n name?: string\n className?: string\n disabled?: boolean\n error?: boolean\n inputRef?: React.Ref<HTMLInputElement>\n /** Controlled when set, otherwise seeded by `defaultCountry`. */\n country?: string\n /** National digits, no country code or separators. */\n number?: string\n onChange?: (value: PhoneValue) => void\n /** ISO code, used when `country` is uncontrolled. */\n defaultCountry?: string\n /** ISO codes pinned above the list, in order. */\n priorityCountries?: Array<string>\n numberInputProps?: Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'id' | 'name' | 'disabled' | 'value' | 'onChange' | 'onKeyDown' | 'className'\n >\n /** Defaults to the country's example number. */\n placeholder?: string\n countryAriaLabel?: string\n searchPlaceholder?: string\n emptyMessage?: string\n 'aria-describedby'?: string\n 'aria-invalid'?: boolean\n}\n\ntype ResolvedPhoneInputProps<T extends object> = PhoneInputBaseProps &\n Partial<PhoneInputCountryAccessors<T>> & {\n /** Defaults to the generated list. */\n countries?: Array<T>\n /** Names the generated list. Ignored when `countries` is passed. */\n locale?: string\n onChange?: (value: PhoneValue<T>) => void\n }\n\nexport type PhoneInputDefaultProps = ResolvedPhoneInputProps<PhoneCountry>\n\nexport type PhoneInputCustomProps<T extends object> = PhoneInputBaseProps &\n PhoneInputCountryAccessors<T> & {\n countries: Array<T>\n onChange?: (value: PhoneValue<T>) => void\n }\n\nexport type PhoneInputProps<T extends object = PhoneCountry> = PhoneInputDefaultProps | PhoneInputCustomProps<T>\n\nconst defaultAccessors: PhoneInputCountryAccessors<PhoneCountry> = {\n getCountryValue: (country) => country.isoCode,\n getCountryIsoCode: (country) => country.isoCode,\n getCountryDialCode: (country) => country.dialCode,\n getCountryFlag: (country) => country.flag,\n getCountryName: (country) => country.name,\n}\n\nexport function PhoneInput(props: PhoneInputDefaultProps): React.ReactElement\nexport function PhoneInput<T extends object>(props: PhoneInputCustomProps<T>): React.ReactElement\nexport function PhoneInput<T extends object>(props: ResolvedPhoneInputProps<T>): React.ReactElement {\n const {\n id,\n name,\n className,\n disabled = false,\n error = false,\n inputRef: externalInputRef,\n countries,\n country,\n onChange,\n number,\n defaultCountry,\n priorityCountries,\n locale = 'en',\n numberInputProps,\n placeholder,\n countryAriaLabel = 'Select country',\n searchPlaceholder = 'Search...',\n emptyMessage = 'No results found.',\n getCountryValue,\n getCountryIsoCode,\n getCountryDialCode,\n getCountryFlag,\n getCountryName,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n } = props\n\n const defaults = defaultAccessors as unknown as PhoneInputCountryAccessors<T>\n const options = countries ?? (buildCountries(locale) as unknown as Array<T>)\n const resolveValue = getCountryValue ?? defaults.getCountryValue\n const resolveIsoCode = getCountryIsoCode ?? defaults.getCountryIsoCode\n const resolveDialCode = getCountryDialCode ?? defaults.getCountryDialCode\n const resolveFlag = getCountryFlag ?? defaults.getCountryFlag\n const resolveName = getCountryName ?? defaults.getCountryName\n\n const {\n isoOf,\n selectedValue,\n selectedOption,\n selectedIso,\n displayValue,\n inputElRef,\n selectCountry,\n onInputChange,\n onInputKeyDown,\n } = usePhoneField({\n options,\n getCountryValue: resolveValue,\n getCountryDialCode: resolveDialCode,\n getCountryIsoCode: resolveIsoCode,\n country,\n number,\n onChange,\n defaultCountry,\n priorityCountries,\n })\n\n const [open, setOpen] = React.useState(false)\n const [search, setSearch] = React.useState('')\n const listRef = useListScroll({ open, searchTerm: search, selectedValue: undefined })\n\n const renderFlag = (option: T) => {\n const iso = isoOf(option)\n return iso ? <Flag iso={iso} /> : <span className=\"text-lg leading-none\">{resolveFlag(option)}</span>\n }\n\n const prefixDisabled = disabled || options.length <= 1\n\n const matches = createSearchMatcher(search)\n const filteredOptions = search.trim()\n ? options.filter((option) => matches([resolveName(option), resolveDialCode(option), isoOf(option) ?? '']))\n : options\n const { priority: priorityOptions, rest: restOptions } = splitByPriority(filteredOptions, priorityCountries, isoOf)\n\n const handleOpenChange = (next: boolean) => {\n setOpen(next)\n if (!next) setSearch('')\n }\n\n const handleSelect = (value: string) => {\n const option = filteredOptions.find((candidate) => resolveValue(candidate) === value)\n if (option) selectCountry(option)\n handleOpenChange(false)\n }\n\n const renderOption = (option: T, isSelected: boolean) => (\n <>\n {renderFlag(option)}\n <span className=\"shrink-0 text-neutral-500\">{resolveDialCode(option)}</span>\n <span className=\"truncate\">{resolveName(option)}</span>\n {isSelected && (\n <CheckIcon data-testid=\"selected-check\" weight=\"bold\" className=\"ml-auto h-4 w-4 shrink-0 text-neutral-950\" />\n )}\n </>\n )\n\n return (\n <div className={cn('flex w-full flex-col gap-1', className)}>\n <div\n data-testid=\"phone-input-shell\"\n className={cn(\n 'flex h-12 w-full items-stretch overflow-hidden rounded-lg border border-neutral-200 bg-white transition-colors has-[input:focus]:border-neutral-950',\n disabled && 'bg-neutral-50',\n error && 'border-error-400 has-[input:focus]:border-error-700',\n )}\n >\n <PopoverRoot open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n id={id ? `${id}-country` : undefined}\n disabled={prefixDisabled}\n aria-label={selectedOption ? resolveName(selectedOption) : countryAriaLabel}\n className={cn(\n 'flex shrink-0 items-center gap-1.5 border-r border-neutral-200 px-3 text-base text-neutral-950 transition-colors outline-none',\n options.length > 1 && 'w-28',\n !prefixDisabled && 'hover:bg-neutral-50',\n prefixDisabled && 'cursor-not-allowed',\n disabled && 'opacity-50',\n )}\n >\n {selectedOption ? (\n <>\n {renderFlag(selectedOption)}\n <span className=\"tabular-nums\">{resolveDialCode(selectedOption)}</span>\n </>\n ) : (\n <GlobeIcon className=\"h-5 w-5 text-neutral-300\" aria-hidden />\n )}\n {!prefixDisabled && <CaretDownIcon className=\"ml-auto h-4 w-4 shrink-0 opacity-50\" />}\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"start\" className=\"w-72 overflow-hidden p-0\">\n <Command shouldFilter={false} defaultValue={selectedValue}>\n <CommandInput placeholder={searchPlaceholder} value={search} onValueChange={setSearch} />\n <VirtualizedComboboxList\n listRef={listRef}\n localOptions={restOptions}\n specialOptions={priorityOptions}\n loading={false}\n loadingPlaceholder=\"\"\n emptyMessage={emptyMessage}\n value={selectedValue}\n getOptionValue={resolveValue}\n getOptionLabel={resolveName}\n handleSelect={handleSelect}\n renderOption={renderOption}\n maxHeight={300}\n />\n </Command>\n </PopoverContent>\n </PopoverRoot>\n\n <input\n /* eslint-disable react-hooks/immutability -- merging the internal ref with the caller-supplied `inputRef` is the standard ref-forwarding idiom */\n ref={(el) => {\n inputElRef.current = el\n if (typeof externalInputRef === 'function') externalInputRef(el)\n else if (externalInputRef) externalInputRef.current = el\n }}\n /* eslint-enable react-hooks/immutability */\n id={id}\n name={name}\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel-national\"\n disabled={disabled}\n value={displayValue}\n onChange={onInputChange}\n onKeyDown={onInputKeyDown}\n placeholder={placeholder ?? exampleNational(selectedIso)}\n aria-invalid={ariaInvalid ?? (error || undefined)}\n aria-describedby={ariaDescribedBy}\n className=\"min-w-0 flex-1 bg-transparent px-3 text-base text-neutral-950 outline-none placeholder:text-neutral-300 disabled:cursor-not-allowed disabled:opacity-50\"\n {...numberInputProps}\n />\n\n {error && (\n <div className=\"flex items-center pr-3\">\n <WarningCircleIcon data-testid=\"exclaim-icon\" className=\"text-error-500\" size={18} />\n </div>\n )}\n </div>\n </div>\n )\n}\n\nPhoneInput.displayName = 'PhoneInput'\n"],"mappings":";;;;;;;;;;;;;;;;AAoEA,IAAM,mBAA6D;CACjE,kBAAkB,YAAY,QAAQ;CACtC,oBAAoB,YAAY,QAAQ;CACxC,qBAAqB,YAAY,QAAQ;CACzC,iBAAiB,YAAY,QAAQ;CACrC,iBAAiB,YAAY,QAAQ;AACvC;AAIA,SAAgB,WAA6B,OAAuD;CAClG,MAAM,EACJ,IACA,MACA,WACA,WAAW,OACX,QAAQ,OACR,UAAU,kBACV,WACA,SACA,UACA,QACA,gBACA,mBACA,SAAS,MACT,kBACA,aACA,mBAAmB,kBACnB,oBAAoB,aACpB,eAAe,qBACf,iBACA,mBACA,oBACA,gBACA,gBACA,oBAAoB,iBACpB,gBAAgB,gBACd;CAEJ,MAAM,WAAW;CACjB,MAAM,UAAU,aAAc,eAAe,MAAM;CACnD,MAAM,eAAe,mBAAmB,SAAS;CACjD,MAAM,iBAAiB,qBAAqB,SAAS;CACrD,MAAM,kBAAkB,sBAAsB,SAAS;CACvD,MAAM,cAAc,kBAAkB,SAAS;CAC/C,MAAM,cAAc,kBAAkB,SAAS;CAE/C,MAAM,EACJ,OACA,eACA,gBACA,aACA,cACA,YACA,eACA,eACA,mBACE,cAAc;EAChB;EACA,iBAAiB;EACjB,oBAAoB;EACpB,mBAAmB;EACnB;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,MAAM,WAAWA,QAAM,SAAS,KAAK;CAC5C,MAAM,CAAC,QAAQ,aAAaA,QAAM,SAAS,EAAE;CAC7C,MAAM,UAAU,cAAc;EAAE;EAAM,YAAY;EAAQ,eAAe,KAAA;CAAU,CAAC;CAEpF,MAAM,cAAc,WAAc;EAChC,MAAM,MAAM,MAAM,MAAM;EACxB,OAAO,MAAM,oBAAC,MAAD,EAAW,IAAM,CAAA,IAAI,oBAAC,QAAD;GAAM,WAAU;GAAwB,UAAA,YAAY,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AAA;AAET;AAEA,WAAW,cAAc"}
|
|
1
|
+
{"version":3,"file":"PhoneInput.js","names":["React","_Fragment"],"sources":["../../../../src/components/inputs/PhoneInput/PhoneInput.tsx"],"sourcesContent":["import { CaretDownIcon } from '@phosphor-icons/react/dist/ssr/CaretDown'\nimport { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { GlobeIcon } from '@phosphor-icons/react/dist/ssr/Globe'\nimport { WarningCircleIcon } from '@phosphor-icons/react/dist/ssr/WarningCircle'\nimport * as React from 'react'\n\nimport { Flag } from '../../data-display/Flag'\nimport { Command, CommandInput } from '../../utils/Command'\nimport { PopoverContent, PopoverRoot, PopoverTrigger } from '../../utils/Popover'\nimport { VirtualizedComboboxList } from '../Combobox'\n\nimport { usePhoneField } from './hooks'\nimport { exampleNational } from './phone'\nimport type { PhoneCountry, PhoneInputCountryAccessors, PhoneValue } from './types'\n\nimport { buildCountries, splitByPriority } from '@/lib/countries'\nimport { SURFACE_LIST } from '@/lib/surface'\nimport { useListScroll } from '@/lib/useListScroll'\nimport { cn, createSearchMatcher } from '@/lib/utils'\n\ntype PhoneInputBaseProps = {\n /** Lands on the number input, so `<label htmlFor>` targets it. */\n id?: string\n name?: string\n className?: string\n disabled?: boolean\n error?: boolean\n inputRef?: React.Ref<HTMLInputElement>\n /** Controlled when set, otherwise seeded by `defaultCountry`. */\n country?: string\n /** National digits, no country code or separators. */\n number?: string\n onChange?: (value: PhoneValue) => void\n /** ISO code, used when `country` is uncontrolled. */\n defaultCountry?: string\n /** ISO codes pinned above the list, in order. */\n priorityCountries?: Array<string>\n numberInputProps?: Omit<\n React.InputHTMLAttributes<HTMLInputElement>,\n 'id' | 'name' | 'disabled' | 'value' | 'onChange' | 'onKeyDown' | 'className'\n >\n /** Defaults to the country's example number. */\n placeholder?: string\n countryAriaLabel?: string\n searchPlaceholder?: string\n emptyMessage?: string\n 'aria-describedby'?: string\n 'aria-invalid'?: boolean\n}\n\ntype ResolvedPhoneInputProps<T extends object> = PhoneInputBaseProps &\n Partial<PhoneInputCountryAccessors<T>> & {\n /** Defaults to the generated list. */\n countries?: Array<T>\n /** Names the generated list. Ignored when `countries` is passed. */\n locale?: string\n onChange?: (value: PhoneValue<T>) => void\n }\n\nexport type PhoneInputDefaultProps = ResolvedPhoneInputProps<PhoneCountry>\n\nexport type PhoneInputCustomProps<T extends object> = PhoneInputBaseProps &\n PhoneInputCountryAccessors<T> & {\n countries: Array<T>\n onChange?: (value: PhoneValue<T>) => void\n }\n\nexport type PhoneInputProps<T extends object = PhoneCountry> = PhoneInputDefaultProps | PhoneInputCustomProps<T>\n\nconst defaultAccessors: PhoneInputCountryAccessors<PhoneCountry> = {\n getCountryValue: (country) => country.isoCode,\n getCountryIsoCode: (country) => country.isoCode,\n getCountryDialCode: (country) => country.dialCode,\n getCountryFlag: (country) => country.flag,\n getCountryName: (country) => country.name,\n}\n\nexport function PhoneInput(props: PhoneInputDefaultProps): React.ReactElement\nexport function PhoneInput<T extends object>(props: PhoneInputCustomProps<T>): React.ReactElement\nexport function PhoneInput<T extends object>(props: ResolvedPhoneInputProps<T>): React.ReactElement {\n const {\n id,\n name,\n className,\n disabled = false,\n error = false,\n inputRef: externalInputRef,\n countries,\n country,\n onChange,\n number,\n defaultCountry,\n priorityCountries,\n locale = 'en',\n numberInputProps,\n placeholder,\n countryAriaLabel = 'Select country',\n searchPlaceholder = 'Search...',\n emptyMessage = 'No results found.',\n getCountryValue,\n getCountryIsoCode,\n getCountryDialCode,\n getCountryFlag,\n getCountryName,\n 'aria-describedby': ariaDescribedBy,\n 'aria-invalid': ariaInvalid,\n } = props\n\n const defaults = defaultAccessors as unknown as PhoneInputCountryAccessors<T>\n const options = countries ?? (buildCountries(locale) as unknown as Array<T>)\n const resolveValue = getCountryValue ?? defaults.getCountryValue\n const resolveIsoCode = getCountryIsoCode ?? defaults.getCountryIsoCode\n const resolveDialCode = getCountryDialCode ?? defaults.getCountryDialCode\n const resolveFlag = getCountryFlag ?? defaults.getCountryFlag\n const resolveName = getCountryName ?? defaults.getCountryName\n\n const {\n isoOf,\n selectedValue,\n selectedOption,\n selectedIso,\n displayValue,\n inputElRef,\n selectCountry,\n onInputChange,\n onInputKeyDown,\n } = usePhoneField({\n options,\n getCountryValue: resolveValue,\n getCountryDialCode: resolveDialCode,\n getCountryIsoCode: resolveIsoCode,\n country,\n number,\n onChange,\n defaultCountry,\n priorityCountries,\n })\n\n const [open, setOpen] = React.useState(false)\n const [search, setSearch] = React.useState('')\n const listRef = useListScroll({ open, searchTerm: search, selectedValue: undefined })\n\n const renderFlag = (option: T) => {\n const iso = isoOf(option)\n return iso ? <Flag iso={iso} /> : <span className=\"text-lg leading-none\">{resolveFlag(option)}</span>\n }\n\n const prefixDisabled = disabled || options.length <= 1\n\n const matches = createSearchMatcher(search)\n const filteredOptions = search.trim()\n ? options.filter((option) => matches([resolveName(option), resolveDialCode(option), isoOf(option) ?? '']))\n : options\n const { priority: priorityOptions, rest: restOptions } = splitByPriority(filteredOptions, priorityCountries, isoOf)\n\n const handleOpenChange = (next: boolean) => {\n setOpen(next)\n if (!next) setSearch('')\n }\n\n const handleSelect = (value: string) => {\n const option = filteredOptions.find((candidate) => resolveValue(candidate) === value)\n if (option) selectCountry(option)\n handleOpenChange(false)\n }\n\n const renderOption = (option: T, isSelected: boolean) => (\n <>\n {renderFlag(option)}\n <span className=\"shrink-0 text-neutral-500\">{resolveDialCode(option)}</span>\n <span className=\"truncate\">{resolveName(option)}</span>\n {isSelected && (\n <CheckIcon data-testid=\"selected-check\" weight=\"bold\" className=\"ml-auto h-4 w-4 shrink-0 text-neutral-950\" />\n )}\n </>\n )\n\n return (\n <div className={cn('flex w-full flex-col gap-1', className)}>\n <div\n data-testid=\"phone-input-shell\"\n className={cn(\n 'flex h-12 w-full items-stretch overflow-hidden rounded-lg border border-neutral-200 bg-white transition-colors has-[input:focus]:border-neutral-950',\n disabled && 'bg-neutral-50',\n error && 'border-error-400 has-[input:focus]:border-error-700',\n )}\n >\n <PopoverRoot open={open} onOpenChange={handleOpenChange}>\n <PopoverTrigger asChild>\n <button\n type=\"button\"\n id={id ? `${id}-country` : undefined}\n disabled={prefixDisabled}\n aria-label={selectedOption ? resolveName(selectedOption) : countryAriaLabel}\n className={cn(\n 'flex shrink-0 items-center gap-1.5 border-r border-neutral-200 px-3 text-base text-neutral-950 transition-colors outline-none',\n options.length > 1 && 'w-28',\n !prefixDisabled && 'hover:bg-neutral-50',\n prefixDisabled && 'cursor-not-allowed',\n disabled && 'opacity-50',\n )}\n >\n {selectedOption ? (\n <>\n {renderFlag(selectedOption)}\n <span className=\"tabular-nums\">{resolveDialCode(selectedOption)}</span>\n </>\n ) : (\n <GlobeIcon className=\"h-5 w-5 text-neutral-300\" aria-hidden />\n )}\n {!prefixDisabled && <CaretDownIcon className=\"ml-auto h-4 w-4 shrink-0 opacity-50\" />}\n </button>\n </PopoverTrigger>\n <PopoverContent align=\"start\" className={cn(SURFACE_LIST, 'w-72 overflow-hidden p-0')}>\n <Command shouldFilter={false} defaultValue={selectedValue}>\n <CommandInput placeholder={searchPlaceholder} value={search} onValueChange={setSearch} />\n <VirtualizedComboboxList\n listRef={listRef}\n localOptions={restOptions}\n specialOptions={priorityOptions}\n loading={false}\n loadingPlaceholder=\"\"\n emptyMessage={emptyMessage}\n value={selectedValue}\n getOptionValue={resolveValue}\n getOptionLabel={resolveName}\n handleSelect={handleSelect}\n renderOption={renderOption}\n maxHeight={300}\n />\n </Command>\n </PopoverContent>\n </PopoverRoot>\n\n <input\n /* eslint-disable react-hooks/immutability -- merging the internal ref with the caller-supplied `inputRef` is the standard ref-forwarding idiom */\n ref={(el) => {\n inputElRef.current = el\n if (typeof externalInputRef === 'function') externalInputRef(el)\n else if (externalInputRef) externalInputRef.current = el\n }}\n /* eslint-enable react-hooks/immutability */\n id={id}\n name={name}\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel-national\"\n disabled={disabled}\n value={displayValue}\n onChange={onInputChange}\n onKeyDown={onInputKeyDown}\n placeholder={placeholder ?? exampleNational(selectedIso)}\n aria-invalid={ariaInvalid ?? (error || undefined)}\n aria-describedby={ariaDescribedBy}\n className=\"min-w-0 flex-1 bg-transparent px-3 text-base text-neutral-950 outline-none placeholder:text-neutral-300 disabled:cursor-not-allowed disabled:opacity-50\"\n {...numberInputProps}\n />\n\n {error && (\n <div className=\"flex items-center pr-3\">\n <WarningCircleIcon data-testid=\"exclaim-icon\" className=\"text-error-500\" size={18} />\n </div>\n )}\n </div>\n </div>\n )\n}\n\nPhoneInput.displayName = 'PhoneInput'\n"],"mappings":";;;;;;;;;;;;;;;;;AAqEA,IAAM,mBAA6D;CACjE,kBAAkB,YAAY,QAAQ;CACtC,oBAAoB,YAAY,QAAQ;CACxC,qBAAqB,YAAY,QAAQ;CACzC,iBAAiB,YAAY,QAAQ;CACrC,iBAAiB,YAAY,QAAQ;AACvC;AAIA,SAAgB,WAA6B,OAAuD;CAClG,MAAM,EACJ,IACA,MACA,WACA,WAAW,OACX,QAAQ,OACR,UAAU,kBACV,WACA,SACA,UACA,QACA,gBACA,mBACA,SAAS,MACT,kBACA,aACA,mBAAmB,kBACnB,oBAAoB,aACpB,eAAe,qBACf,iBACA,mBACA,oBACA,gBACA,gBACA,oBAAoB,iBACpB,gBAAgB,gBACd;CAEJ,MAAM,WAAW;CACjB,MAAM,UAAU,aAAc,eAAe,MAAM;CACnD,MAAM,eAAe,mBAAmB,SAAS;CACjD,MAAM,iBAAiB,qBAAqB,SAAS;CACrD,MAAM,kBAAkB,sBAAsB,SAAS;CACvD,MAAM,cAAc,kBAAkB,SAAS;CAC/C,MAAM,cAAc,kBAAkB,SAAS;CAE/C,MAAM,EACJ,OACA,eACA,gBACA,aACA,cACA,YACA,eACA,eACA,mBACE,cAAc;EAChB;EACA,iBAAiB;EACjB,oBAAoB;EACpB,mBAAmB;EACnB;EACA;EACA;EACA;EACA;CACF,CAAC;CAED,MAAM,CAAC,MAAM,WAAWA,QAAM,SAAS,KAAK;CAC5C,MAAM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;KACH;KACV,OAAO;KACP,UAAU;KACV,WAAW;KACX,aAAa,eAAe,gBAAgB,WAAW;KACvD,gBAAc,gBAAgB,SAAS,KAAA;KACvC,oBAAkB;KAClB,WAAU;KACV,GAAI;IACL,CAAA;IAEA,SACC,oBAAC,OAAD;KAAK,WAAU;KACb,UAAA,oBAAC,mBAAD;MAAmB,eAAY;MAAe,WAAU;MAAiB,MAAM;KAAK,CAAA;IACjF,CAAA;GAEJ;;CACF,CAAA;AAET;AAEA,WAAW,cAAc"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
2
|
import { buttonVariants } from "../Button/Button.js";
|
|
3
|
+
import { SURFACE_ITEM, SURFACE_LIST } from "../../../lib/surface.js";
|
|
3
4
|
import * as React$1 from "react";
|
|
4
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
6
|
import { CheckIcon } from "@phosphor-icons/react/dist/ssr/Check";
|
|
@@ -39,13 +40,13 @@ var SelectContent = React$1.forwardRef(({ className, children, position = "poppe
|
|
|
39
40
|
children: /* @__PURE__ */ jsxs(SelectPrimitive.Content, {
|
|
40
41
|
ref,
|
|
41
42
|
sideOffset: 4,
|
|
42
|
-
className: cn("text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height,300px) min-w-32 overflow-hidden
|
|
43
|
+
className: cn(SURFACE_LIST, "text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height,300px) min-w-32 overflow-hidden border bg-[#fff] shadow-md", className),
|
|
43
44
|
position,
|
|
44
45
|
...props,
|
|
45
46
|
children: [
|
|
46
47
|
/* @__PURE__ */ jsx(SelectScrollUpButton, {}),
|
|
47
48
|
/* @__PURE__ */ jsx(SelectPrimitive.Viewport, {
|
|
48
|
-
className: cn("p-
|
|
49
|
+
className: cn("p-(--surface-inset)", position === "popper" && "w-(--radix-select-trigger-width) md:w-auto md:min-w-(--radix-select-trigger-width)"),
|
|
49
50
|
children
|
|
50
51
|
}),
|
|
51
52
|
/* @__PURE__ */ jsx(SelectScrollDownButton, {})
|
|
@@ -61,10 +62,10 @@ var SelectLabel = React$1.forwardRef(({ className, ...props }, ref) => /* @__PUR
|
|
|
61
62
|
SelectLabel.displayName = SelectPrimitive.Label.displayName;
|
|
62
63
|
var SelectItem = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(SelectPrimitive.Item, {
|
|
63
64
|
ref,
|
|
64
|
-
className: cn("focus:text-accent-foreground relative flex w-full items-center
|
|
65
|
+
className: cn(SURFACE_ITEM, "focus:text-accent-foreground relative flex min-h-10 w-full items-center py-2 pr-3 pl-10 text-sm outline-none select-none focus:bg-neutral-100 data-disabled:pointer-events-none data-disabled:opacity-50", className),
|
|
65
66
|
...props,
|
|
66
67
|
children: [/* @__PURE__ */ jsx("span", {
|
|
67
|
-
className: "absolute left-
|
|
68
|
+
className: "absolute left-3 flex h-3.5 w-3.5 items-center justify-center",
|
|
68
69
|
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemIndicator, { children: /* @__PURE__ */ jsx(CheckIcon, { className: "h-4 w-4" }) })
|
|
69
70
|
}), /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children })]
|
|
70
71
|
}));
|
|
@@ -122,7 +123,7 @@ function Select({ onValueChange, defaultValue, value, options, placeholder, clas
|
|
|
122
123
|
value: option.value,
|
|
123
124
|
"data-testid": option.value,
|
|
124
125
|
textValue: typeof option.label === "string" ? option.label : void 0,
|
|
125
|
-
className: "focus:text-accent-foreground relative flex w-full items-start
|
|
126
|
+
className: cn(SURFACE_ITEM, "focus:text-accent-foreground relative flex min-h-10 w-full items-start px-3 py-2 text-sm outline-none select-none focus:bg-neutral-100 data-disabled:pointer-events-none data-disabled:opacity-50"),
|
|
126
127
|
children: [/* @__PURE__ */ jsx("span", {
|
|
127
128
|
className: "hidden",
|
|
128
129
|
children: /* @__PURE__ */ jsx(SelectPrimitive.ItemText, { children: option.label })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","names":["React"],"sources":["../../../../src/components/inputs/Select/Select.tsx"],"sourcesContent":["import { CaretDownIcon } from '@phosphor-icons/react/dist/ssr/CaretDown'\nimport { CaretUpIcon } from '@phosphor-icons/react/dist/ssr/CaretUp'\nimport { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport * as SelectPrimitive from '@radix-ui/react-select'\nimport * as React from 'react'\n\nimport { buttonVariants } from '../Button'\n\nimport { cn } from '@/lib/utils'\n\nconst SelectRoot = SelectPrimitive.Root\n\nconst SelectGroup = SelectPrimitive.Group\n\nconst SelectValue = SelectPrimitive.Value\n\nconst SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger ref={ref} className={className} {...props}>\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretDownIcon className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <CaretUpIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <CaretDownIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {\n container?: HTMLElement\n }\n>(({ className, children, position = 'popper', container, ...props }, ref) => (\n <SelectPrimitive.Portal container={container}>\n <SelectPrimitive.Content\n ref={ref}\n sideOffset={4}\n className={cn(\n 'text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height,300px) min-w-32 overflow-hidden rounded-md border bg-[#fff] shadow-md',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-1',\n position === 'popper' && 'w-(--radix-select-trigger-width) md:w-auto md:min-w-(--radix-select-trigger-width)',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label ref={ref} className={cn('py-1.5 pr-2 pl-8 text-sm font-semibold', className)} {...props} />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:text-accent-foreground relative flex w-full items-center rounded-sm py-1.5 pr-2 pl-8 text-sm outline-none select-none focus:bg-neutral-100 data-disabled:pointer-events-none data-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator ref={ref} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport type Option = {\n value: string\n label: React.ReactElement | string | number\n}\n\nexport {\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectRoot,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n\ntype Props = {\n onValueChange?: (value: string) => void\n defaultValue?: string\n value?: string\n placeholder?: string\n options: Array<Option>\n className?: string\n disabled?: boolean\n error?: boolean | string\n id?: string\n onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void\n container?: HTMLElement\n renderOption?: (option: Option) => React.ReactNode\n}\n\nexport function Select({\n onValueChange,\n defaultValue,\n value,\n options,\n placeholder,\n className,\n disabled = false,\n error,\n id,\n onKeyDown,\n container,\n renderOption,\n ...props\n}: Readonly<Props>) {\n const [open, setOpen] = React.useState(false)\n\n const handleOpenChange = React.useCallback(\n (nextOpen: boolean) => {\n if (!disabled) setOpen(nextOpen)\n },\n [disabled],\n )\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <SelectRoot\n {...props}\n open={open}\n onOpenChange={handleOpenChange}\n onValueChange={onValueChange}\n value={value}\n defaultValue={defaultValue}\n disabled={disabled}\n >\n <SelectTrigger\n id={id}\n onKeyDown={onKeyDown}\n aria-invalid={error ? 'true' : 'false'}\n className={cn(\n buttonVariants({ variant: 'input', size: 'lg' }),\n 'flex justify-between',\n error && 'ring-error-400 focus-within:ring-error-700 border-none ring-1',\n className,\n )}\n onPointerDown={(event) => {\n event.stopPropagation()\n if (open) {\n setOpen(false)\n event.preventDefault()\n } else {\n setOpen(true)\n }\n }}\n onClick={(event) => {\n event.preventDefault()\n event.stopPropagation()\n }}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent\n container={container}\n onPointerDownOutside={(event) => {\n if (!container) return\n const original = (event as unknown as Record<string, unknown>).detail as\n { originalEvent?: PointerEvent } | undefined\n if (!original?.originalEvent?.composedPath) return\n if (original.originalEvent.composedPath().includes(container)) {\n event.preventDefault()\n }\n }}\n >\n {options.map((option) =>\n renderOption ? (\n <SelectPrimitive.Item\n key={option.value}\n value={option.value}\n data-testid={option.value}\n textValue={typeof option.label === 'string' ? option.label : undefined}\n className=\"focus:text-accent-foreground relative flex w-full items-start rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-100 data-disabled:pointer-events-none data-disabled:opacity-50\"\n >\n <span className=\"hidden\">\n <SelectPrimitive.ItemText>{option.label}</SelectPrimitive.ItemText>\n </span>\n {renderOption(option)}\n </SelectPrimitive.Item>\n ) : (\n <SelectItem key={option.value} value={option.value} data-testid={option.value}>\n {option.label}\n </SelectItem>\n ),\n )}\n </SelectContent>\n </SelectRoot>\n {typeof error === 'string' && <span className=\"text-error-500 text-sm\">{error}</span>}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;AAUA,IAAM,aAAa,gBAAgB;AAEnC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,gBAAgBA,QAAM,YAGzB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,qBAAC,gBAAgB,SAAjB;CAA8B;CAAgB;CAAW,GAAI;CAA7D,UAAA,CACG,UACD,oBAAC,gBAAgB,MAAjB;EAAsB,SAAA;EACpB,UAAA,oBAAC,eAAD,EAAe,WAAU,qBAAsB,CAAA;CAC3B,CAAA,CACC;AAC1B,CAAA,CAAA;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,uBAAuBA,QAAM,YAGhC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,gBAAjB;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,GAAI;CAEJ,UAAA,oBAAC,aAAD,EAAa,WAAU,UAAW,CAAA;AACJ,CAAA,CACjC;AACD,qBAAqB,cAAc,gBAAgB,eAAe;AAElE,IAAM,yBAAyBA,QAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,kBAAjB;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,GAAI;CAEJ,UAAA,oBAAC,eAAD,EAAe,WAAU,UAAW,CAAA;AACJ,CAAA,CACnC;AACD,uBAAuB,cAAc,gBAAgB,iBAAiB;AAEtE,IAAM,gBAAgBA,QAAM,YAKzB,EAAE,WAAW,UA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,OAAO,KAUQ,IAEtB,oBAAC,YAAD;KAA+B,OAAO,OAAO;KAAO,eAAa,OAAO;KACrE,UAAA,OAAO;IACE,GAFK,OAAO,KAEZ,CAEhB;GACa,CAAA,CACL;EACX,CAAA,GAAA,OAAO,UAAU,YAAY,oBAAC,QAAD;GAAM,WAAU;GAA0B,UAAA;EAAY,CAAA,CACjF;;AAET"}
|
|
1
|
+
{"version":3,"file":"Select.js","names":["React"],"sources":["../../../../src/components/inputs/Select/Select.tsx"],"sourcesContent":["import { CaretDownIcon } from '@phosphor-icons/react/dist/ssr/CaretDown'\nimport { CaretUpIcon } from '@phosphor-icons/react/dist/ssr/CaretUp'\nimport { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport * as SelectPrimitive from '@radix-ui/react-select'\nimport * as React from 'react'\n\nimport { buttonVariants } from '../Button'\n\nimport { SURFACE_ITEM, SURFACE_LIST } from '@/lib/surface'\nimport { cn } from '@/lib/utils'\n\nconst SelectRoot = SelectPrimitive.Root\n\nconst SelectGroup = SelectPrimitive.Group\n\nconst SelectValue = SelectPrimitive.Value\n\nconst SelectTrigger = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Trigger>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Trigger ref={ref} className={className} {...props}>\n {children}\n <SelectPrimitive.Icon asChild>\n <CaretDownIcon className=\"h-4 w-4 opacity-50\" />\n </SelectPrimitive.Icon>\n </SelectPrimitive.Trigger>\n))\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName\n\nconst SelectScrollUpButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollUpButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollUpButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollUpButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <CaretUpIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollUpButton>\n))\nSelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName\n\nconst SelectScrollDownButton = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.ScrollDownButton>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.ScrollDownButton>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.ScrollDownButton\n ref={ref}\n className={cn('flex cursor-default items-center justify-center py-1', className)}\n {...props}\n >\n <CaretDownIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ScrollDownButton>\n))\nSelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName\n\nconst SelectContent = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content> & {\n container?: HTMLElement\n }\n>(({ className, children, position = 'popper', container, ...props }, ref) => (\n <SelectPrimitive.Portal container={container}>\n <SelectPrimitive.Content\n ref={ref}\n sideOffset={4}\n className={cn(\n SURFACE_LIST,\n 'text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height,300px) min-w-32 overflow-hidden border bg-[#fff] shadow-md',\n className,\n )}\n position={position}\n {...props}\n >\n <SelectScrollUpButton />\n <SelectPrimitive.Viewport\n className={cn(\n 'p-(--surface-inset)',\n position === 'popper' && 'w-(--radix-select-trigger-width) md:w-auto md:min-w-(--radix-select-trigger-width)',\n )}\n >\n {children}\n </SelectPrimitive.Viewport>\n <SelectScrollDownButton />\n </SelectPrimitive.Content>\n </SelectPrimitive.Portal>\n))\nSelectContent.displayName = SelectPrimitive.Content.displayName\n\nconst SelectLabel = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Label ref={ref} className={cn('py-1.5 pr-2 pl-8 text-sm font-semibold', className)} {...props} />\n))\nSelectLabel.displayName = SelectPrimitive.Label.displayName\n\nconst SelectItem = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>\n>(({ className, children, ...props }, ref) => (\n <SelectPrimitive.Item\n ref={ref}\n className={cn(\n SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex min-h-10 w-full items-center py-2 pr-3 pl-10 text-sm outline-none select-none focus:bg-neutral-100 data-disabled:pointer-events-none data-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-3 flex h-3.5 w-3.5 items-center justify-center\">\n <SelectPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </SelectPrimitive.ItemIndicator>\n </span>\n\n <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n </SelectPrimitive.Item>\n))\nSelectItem.displayName = SelectPrimitive.Item.displayName\n\nconst SelectSeparator = React.forwardRef<\n React.ComponentRef<typeof SelectPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof SelectPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <SelectPrimitive.Separator ref={ref} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />\n))\nSelectSeparator.displayName = SelectPrimitive.Separator.displayName\n\nexport type Option = {\n value: string\n label: React.ReactElement | string | number\n}\n\nexport {\n SelectContent,\n SelectGroup,\n SelectItem,\n SelectLabel,\n SelectRoot,\n SelectScrollDownButton,\n SelectScrollUpButton,\n SelectSeparator,\n SelectTrigger,\n SelectValue,\n}\n\ntype Props = {\n onValueChange?: (value: string) => void\n defaultValue?: string\n value?: string\n placeholder?: string\n options: Array<Option>\n className?: string\n disabled?: boolean\n error?: boolean | string\n id?: string\n onKeyDown?: (event: React.KeyboardEvent<HTMLButtonElement>) => void\n container?: HTMLElement\n renderOption?: (option: Option) => React.ReactNode\n}\n\nexport function Select({\n onValueChange,\n defaultValue,\n value,\n options,\n placeholder,\n className,\n disabled = false,\n error,\n id,\n onKeyDown,\n container,\n renderOption,\n ...props\n}: Readonly<Props>) {\n const [open, setOpen] = React.useState(false)\n\n const handleOpenChange = React.useCallback(\n (nextOpen: boolean) => {\n if (!disabled) setOpen(nextOpen)\n },\n [disabled],\n )\n\n return (\n <div className=\"flex w-full flex-col gap-1\">\n <SelectRoot\n {...props}\n open={open}\n onOpenChange={handleOpenChange}\n onValueChange={onValueChange}\n value={value}\n defaultValue={defaultValue}\n disabled={disabled}\n >\n <SelectTrigger\n id={id}\n onKeyDown={onKeyDown}\n aria-invalid={error ? 'true' : 'false'}\n className={cn(\n buttonVariants({ variant: 'input', size: 'lg' }),\n 'flex justify-between',\n error && 'ring-error-400 focus-within:ring-error-700 border-none ring-1',\n className,\n )}\n onPointerDown={(event) => {\n event.stopPropagation()\n if (open) {\n setOpen(false)\n event.preventDefault()\n } else {\n setOpen(true)\n }\n }}\n onClick={(event) => {\n event.preventDefault()\n event.stopPropagation()\n }}\n >\n <SelectValue placeholder={placeholder} />\n </SelectTrigger>\n <SelectContent\n container={container}\n onPointerDownOutside={(event) => {\n if (!container) return\n const original = (event as unknown as Record<string, unknown>).detail as\n { originalEvent?: PointerEvent } | undefined\n if (!original?.originalEvent?.composedPath) return\n if (original.originalEvent.composedPath().includes(container)) {\n event.preventDefault()\n }\n }}\n >\n {options.map((option) =>\n renderOption ? (\n <SelectPrimitive.Item\n key={option.value}\n value={option.value}\n data-testid={option.value}\n textValue={typeof option.label === 'string' ? option.label : undefined}\n className={cn(\n SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex min-h-10 w-full items-start px-3 py-2 text-sm outline-none select-none focus:bg-neutral-100 data-disabled:pointer-events-none data-disabled:opacity-50',\n )}\n >\n <span className=\"hidden\">\n <SelectPrimitive.ItemText>{option.label}</SelectPrimitive.ItemText>\n </span>\n {renderOption(option)}\n </SelectPrimitive.Item>\n ) : (\n <SelectItem key={option.value} value={option.value} data-testid={option.value}>\n {option.label}\n </SelectItem>\n ),\n )}\n </SelectContent>\n </SelectRoot>\n {typeof error === 'string' && <span className=\"text-error-500 text-sm\">{error}</span>}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;AAWA,IAAM,aAAa,gBAAgB;AAEnC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,cAAc,gBAAgB;AAEpC,IAAM,gBAAgBA,QAAM,YAGzB,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,qBAAC,gBAAgB,SAAjB;CAA8B;CAAgB;CAAW,GAAI;CAA7D,UAAA,CACG,UACD,oBAAC,gBAAgB,MAAjB;EAAsB,SAAA;EACpB,UAAA,oBAAC,eAAD,EAAe,WAAU,qBAAsB,CAAA;CAC3B,CAAA,CACC;AAC1B,CAAA,CAAA;AACD,cAAc,cAAc,gBAAgB,QAAQ;AAEpD,IAAM,uBAAuBA,QAAM,YAGhC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,gBAAjB;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,GAAI;CAEJ,UAAA,oBAAC,aAAD,EAAa,WAAU,UAAW,CAAA;AACJ,CAAA,CACjC;AACD,qBAAqB,cAAc,gBAAgB,eAAe;AAElE,IAAM,yBAAyBA,QAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,gBAAgB,kBAAjB;CACO;CACL,WAAW,GAAG,wDAAwD,SAAS;CAC/E,GAAI;CAEJ,UAAA,oBAAC,eAAD,EAAe,WAAU,UAAW,CAAA;AACJ,CAAA,CACnC;AACD,uBAAuB,cAAc,gBAAgB,iBAAiB;AAEtE,IAAM,gBAAgBA,QAAM,YAKzB,EAAE,WAAW,UAAU,WAAW,UAAU,WAAW,GAAG,SAAS,QACpE,oBAAC,gBAAgB,QAAj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KAA+B,OAAO,OAAO;KAAO,eAAa,OAAO;KACrE,UAAA,OAAO;IACE,GAFK,OAAO,KAEZ,CAEhB;GACa,CAAA,CACL;EACX,CAAA,GAAA,OAAO,UAAU,YAAY,oBAAC,QAAD;GAAM,WAAU;GAA0B,UAAA;EAAY,CAAA,CACjF;;AAET"}
|
|
@@ -4,7 +4,7 @@ import * as React$1 from "react";
|
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
6
6
|
//#region src/components/inputs/Toggle/Toggle.tsx
|
|
7
|
-
var toggleVariants = cva("inline-flex items-center justify-center rounded-
|
|
7
|
+
var toggleVariants = cva("inline-flex items-center justify-center rounded-lg text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", {
|
|
8
8
|
variants: {
|
|
9
9
|
variant: {
|
|
10
10
|
primary: [
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.js","names":["React"],"sources":["../../../../src/components/inputs/Toggle/Toggle.tsx"],"sourcesContent":["import * as TogglePrimitive from '@radix-ui/react-toggle'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst toggleVariants = cva(\n 'inline-flex items-center justify-center rounded-
|
|
1
|
+
{"version":3,"file":"Toggle.js","names":["React"],"sources":["../../../../src/components/inputs/Toggle/Toggle.tsx"],"sourcesContent":["import * as TogglePrimitive from '@radix-ui/react-toggle'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst toggleVariants = cva(\n 'inline-flex items-center justify-center rounded-lg text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50',\n {\n variants: {\n variant: {\n primary: [\n 'bg-neutral-50 text-neutral-950',\n 'hover:bg-neutral-100',\n 'data-[state=on]:bg-primary data-[state=on]:text-primary-foreground',\n ],\n outline: [\n 'border border-primary bg-transparent',\n 'hover:bg-neutral-50 hover:text-neutral-950',\n 'data-[state=on]:bg-primary data-[state=on]:text-primary-foreground',\n ],\n ghost: [\n 'bg-transparent',\n 'hover:bg-neutral-50 hover:text-neutral-950',\n 'data-[state=on]:bg-neutral-100 data-[state=on]:text-neutral-950',\n ],\n },\n size: {\n sm: 'h-8 min-h-8 px-2.5 text-sm',\n md: 'h-10 min-h-10 px-3 text-sm',\n lg: 'h-12 min-h-12 px-5 text-base',\n },\n },\n defaultVariants: {\n variant: 'primary',\n size: 'md',\n },\n },\n)\n\ntype ToggleProps = {\n /** Style variant of the toggle: 'primary' | 'outline' | 'ghost'\n * @default primary\n */\n variant?: VariantProps<typeof toggleVariants>['variant']\n /** Size variant of the toggle: 'sm' | 'md' | 'lg'\n * @default md\n */\n size?: VariantProps<typeof toggleVariants>['size']\n /** The controlled pressed state of the toggle */\n pressed?: boolean\n /** Whether the toggle is disabled */\n disabled?: boolean\n} & Omit<React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>, 'size'>\n\n/**\n * A toggleable button component that can be either on or off.\n *\n * @example\n * ```tsx\n * <Toggle variant=\"outline\" size=\"sm\" onPressedChange={(pressed) => console.info(pressed)}>\n * Toggle Me\n * </Toggle>\n * ```\n */\nconst Toggle = React.forwardRef<React.ComponentRef<typeof TogglePrimitive.Root>, ToggleProps>(\n ({ className, variant = 'primary', size = 'md', ...props }, ref) => (\n <TogglePrimitive.Root ref={ref} className={cn(toggleVariants({ className, variant, size }))} {...props} />\n ),\n)\n\nToggle.displayName = TogglePrimitive.Root.displayName\n\nexport { Toggle, toggleVariants }\nexport type { ToggleProps }\n"],"mappings":";;;;;;AAMA,IAAM,iBAAiB,IACrB,wQACA;CACE,UAAU;EACR,SAAS;GACP,SAAS;IACP;IACA;IACA;GACF;GACA,SAAS;IACP;IACA;IACA;GACF;GACA,OAAO;IACL;IACA;IACA;GACF;EACF;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,iBAAiB;EACf,SAAS;EACT,MAAM;CACR;AACF,CACF;;;;;;;;;;;AA2BA,IAAM,SAASA,QAAM,YAClB,EAAE,WAAW,UAAU,WAAW,OAAO,MAAM,GAAG,SAAS,QAC1D,oBAAC,gBAAgB,MAAjB;CAA2B;CAAK,WAAW,GAAG,eAAe;EAAE;EAAW;EAAS;CAAK,CAAC,CAAC;CAAG,GAAI;AAAQ,CAAA,CAE7G;AAEA,OAAO,cAAc,gBAAgB,KAAK"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { cn } from "../../../lib/utils.js";
|
|
2
|
+
import { SURFACE, SURFACE_INSET, SURFACE_ITEM } from "../../../lib/surface.js";
|
|
2
3
|
import * as React$1 from "react";
|
|
3
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { CaretRightIcon } from "@phosphor-icons/react/dist/ssr/CaretRight";
|
|
@@ -14,33 +15,33 @@ var DropdownMenuSub = DropdownMenuPrimitive.Sub;
|
|
|
14
15
|
var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
|
|
15
16
|
var DropdownMenuSubTrigger = React$1.forwardRef(({ className, inset, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.SubTrigger, {
|
|
16
17
|
ref,
|
|
17
|
-
className: cn("flex items-center gap-2
|
|
18
|
+
className: cn(SURFACE_ITEM, "flex items-center gap-2 px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-50 data-[state=open]:bg-neutral-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", inset && "pl-8", className),
|
|
18
19
|
...props,
|
|
19
20
|
children: [children, /* @__PURE__ */ jsx(CaretRightIcon, { className: "ml-auto" })]
|
|
20
21
|
}));
|
|
21
22
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName;
|
|
22
23
|
var DropdownMenuSubContent = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.SubContent, {
|
|
23
24
|
ref,
|
|
24
|
-
className: cn("text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden
|
|
25
|
+
className: cn(SURFACE, SURFACE_INSET, "text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden border bg-white shadow-lg", className),
|
|
25
26
|
...props
|
|
26
27
|
}));
|
|
27
28
|
DropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName;
|
|
28
29
|
var DropdownMenuContent = React$1.forwardRef(({ className, sideOffset = 4, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Portal, { children: /* @__PURE__ */ jsx(DropdownMenuPrimitive.Content, {
|
|
29
30
|
ref,
|
|
30
31
|
sideOffset,
|
|
31
|
-
className: cn("text-popover-foreground z-50 min-w-[min(var(--radix-dropdown-menu-trigger-width),8rem)] overflow-hidden
|
|
32
|
+
className: cn(SURFACE, SURFACE_INSET, "text-popover-foreground z-50 min-w-[min(var(--radix-dropdown-menu-trigger-width),8rem)] overflow-hidden border bg-white shadow-md", "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", className),
|
|
32
33
|
...props
|
|
33
34
|
}) }));
|
|
34
35
|
DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
|
|
35
36
|
var DropdownMenuItem = React$1.forwardRef(({ className, inset, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuPrimitive.Item, {
|
|
36
37
|
ref,
|
|
37
|
-
className: cn("focus:text-accent-foreground relative flex items-center gap-2
|
|
38
|
+
className: cn(SURFACE_ITEM, "focus:text-accent-foreground relative flex items-center gap-2 px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0", inset && "pl-8", className),
|
|
38
39
|
...props
|
|
39
40
|
}));
|
|
40
41
|
DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName;
|
|
41
42
|
var DropdownMenuCheckboxItem = React$1.forwardRef(({ className, children, checked, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.CheckboxItem, {
|
|
42
43
|
ref,
|
|
43
|
-
className: cn("focus:text-accent-foreground relative flex items-center
|
|
44
|
+
className: cn(SURFACE_ITEM, "focus:text-accent-foreground relative flex items-center py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50", className),
|
|
44
45
|
checked,
|
|
45
46
|
...props,
|
|
46
47
|
children: [/* @__PURE__ */ jsx("span", {
|
|
@@ -51,7 +52,7 @@ var DropdownMenuCheckboxItem = React$1.forwardRef(({ className, children, checke
|
|
|
51
52
|
DropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName;
|
|
52
53
|
var DropdownMenuRadioItem = React$1.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DropdownMenuPrimitive.RadioItem, {
|
|
53
54
|
ref,
|
|
54
|
-
className: cn("focus:text-accent-foreground relative flex items-center
|
|
55
|
+
className: cn(SURFACE_ITEM, "focus:text-accent-foreground relative flex items-center py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50", className),
|
|
55
56
|
...props,
|
|
56
57
|
children: [/* @__PURE__ */ jsx("span", {
|
|
57
58
|
className: "absolute left-2 flex h-3.5 w-3.5 items-center justify-center",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DropdownMenu.js","names":["React"],"sources":["../../../../src/components/navigation/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { CaretRightIcon } from '@phosphor-icons/react/dist/ssr/CaretRight'\nimport { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { DotIcon } from '@phosphor-icons/react/dist/ssr/Dot'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n 'flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-50 data-[state=open]:bg-neutral-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <CaretRightIcon className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n 'text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden rounded-md border bg-white p-1 shadow-lg',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n 'text-popover-foreground z-50 min-w-[min(var(--radix-dropdown-menu-trigger-width),8rem)] overflow-hidden rounded-md border bg-white p-1 shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n 'focus:text-accent-foreground relative flex items-center gap-2 rounded-sm px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n 'focus:text-accent-foreground relative flex items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n 'focus:text-accent-foreground relative flex items-center rounded-sm py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotIcon className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"],"mappings":";;;;;;;;AAQA,IAAM,eAAe,sBAAsB;AAE3C,IAAM,sBAAsB,sBAAsB;AAElD,IAAM,oBAAoB,sBAAsB;AAEhD,IAAM,qBAAqB,sBAAsB;AAEjD,IAAM,kBAAkB,sBAAsB;AAE9C,IAAM,yBAAyB,sBAAsB;AAErD,IAAM,yBAAyBA,QAAM,YAKlC,EAAE,WAAW,OAAO,UAAU,GAAG,SAAS,QAC3C,qBAAC,sBAAsB,YAAvB;CACO;CACL,WAAW,GACT,mMACA,SAAS,QACT,SACF;CACA,GAAI;CAPN,UAAA,CASG,UACD,oBAAC,gBAAD,EAAgB,WAAU,UAAW,CAAA,CACL;AACnC,CAAA,CAAA;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAEtE,IAAM,yBAAyBA,QAAM,YAGlC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,sBAAsB,YAAvB;CACO;CACL,WAAW,GACT,mbACA,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,uBAAuB,cAAc,sBAAsB,WAAW;AAEtE,IAAM,sBAAsBA,QAAM,YAG/B,EAAE,WAAW,aAAa,GAAG,GAAG,SAAS,QAC1C,oBAAC,sBAAsB,QAAvB,EAAA,UACE,oBAAC,sBAAsB,SAAvB;CACO;CACO;CACZ,WAAW,GACT,oJACA,oVACA,SACF;CACA,GAAI;AACL,CAAA,EAC2B,CAAA,CAC/B;AACD,oBAAoB,cAAc,sBAAsB,QAAQ;AAEhE,IAAM,mBAAmBA,QAAM,YAK5B,EAAE,WAAW,OAAO,GAAG,SAAS,QACjC,oBAAC,sBAAsB,MAAvB;CACO;CACL,WAAW,GACT,0PACA,SAAS,QACT,SACF;CACA,GAAI;AACL,CAAA,CACF;AACD,iBAAiB,cAAc,sBAAsB,KAAK;AAE1D,I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A;AACnG;AACA,qBAAqB,cAAc"}
|
|
1
|
+
{"version":3,"file":"DropdownMenu.js","names":["React"],"sources":["../../../../src/components/navigation/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { CaretRightIcon } from '@phosphor-icons/react/dist/ssr/CaretRight'\nimport { CheckIcon } from '@phosphor-icons/react/dist/ssr/Check'\nimport { DotIcon } from '@phosphor-icons/react/dist/ssr/Dot'\nimport * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'\nimport * as React from 'react'\n\nimport { SURFACE, SURFACE_INSET, SURFACE_ITEM } from '@/lib/surface'\nimport { cn } from '@/lib/utils'\n\nconst DropdownMenu = DropdownMenuPrimitive.Root\n\nconst DropdownMenuTrigger = DropdownMenuPrimitive.Trigger\n\nconst DropdownMenuGroup = DropdownMenuPrimitive.Group\n\nconst DropdownMenuPortal = DropdownMenuPrimitive.Portal\n\nconst DropdownMenuSub = DropdownMenuPrimitive.Sub\n\nconst DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubTrigger>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubTrigger> & {\n inset?: boolean\n }\n>(({ className, inset, children, ...props }, ref) => (\n <DropdownMenuPrimitive.SubTrigger\n ref={ref}\n className={cn(\n SURFACE_ITEM,\n 'flex items-center gap-2 px-2 py-1.5 text-sm outline-none select-none focus:bg-neutral-50 data-[state=open]:bg-neutral-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n >\n {children}\n <CaretRightIcon className=\"ml-auto\" />\n </DropdownMenuPrimitive.SubTrigger>\n))\nDropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.SubContent>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.SubContent>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.SubContent\n ref={ref}\n className={cn(\n SURFACE,\n SURFACE_INSET,\n 'text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-32 overflow-hidden border bg-white shadow-lg',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuSubContent.displayName = DropdownMenuPrimitive.SubContent.displayName\n\nconst DropdownMenuContent = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Content>\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <DropdownMenuPrimitive.Portal>\n <DropdownMenuPrimitive.Content\n ref={ref}\n sideOffset={sideOffset}\n className={cn(\n SURFACE,\n SURFACE_INSET,\n 'text-popover-foreground z-50 min-w-[min(var(--radix-dropdown-menu-trigger-width),8rem)] overflow-hidden border bg-white shadow-md',\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',\n className,\n )}\n {...props}\n />\n </DropdownMenuPrimitive.Portal>\n))\nDropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName\n\nconst DropdownMenuItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Item> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Item\n ref={ref}\n className={cn(\n SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center gap-2 px-2 py-1.5 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0',\n inset && 'pl-8',\n className,\n )}\n {...props}\n />\n))\nDropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.CheckboxItem>\n>(({ className, children, checked, ...props }, ref) => (\n <DropdownMenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(\n SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50',\n className,\n )}\n checked={checked}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <CheckIcon className=\"h-4 w-4\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.CheckboxItem>\n))\nDropdownMenuCheckboxItem.displayName = DropdownMenuPrimitive.CheckboxItem.displayName\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <DropdownMenuPrimitive.RadioItem\n ref={ref}\n className={cn(\n SURFACE_ITEM,\n 'focus:text-accent-foreground relative flex items-center py-1.5 pr-2 pl-8 text-sm transition-colors outline-none select-none focus:bg-neutral-50 data-disabled:pointer-events-none data-disabled:opacity-50',\n className,\n )}\n {...props}\n >\n <span className=\"absolute left-2 flex h-3.5 w-3.5 items-center justify-center\">\n <DropdownMenuPrimitive.ItemIndicator>\n <DotIcon className=\"h-2 w-2 fill-current\" />\n </DropdownMenuPrimitive.ItemIndicator>\n </span>\n {children}\n </DropdownMenuPrimitive.RadioItem>\n))\nDropdownMenuRadioItem.displayName = DropdownMenuPrimitive.RadioItem.displayName\n\nconst DropdownMenuLabel = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Label>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Label> & {\n inset?: boolean\n }\n>(({ className, inset, ...props }, ref) => (\n <DropdownMenuPrimitive.Label\n ref={ref}\n className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}\n {...props}\n />\n))\nDropdownMenuLabel.displayName = DropdownMenuPrimitive.Label.displayName\n\nconst DropdownMenuSeparator = React.forwardRef<\n React.ComponentRef<typeof DropdownMenuPrimitive.Separator>,\n React.ComponentPropsWithoutRef<typeof DropdownMenuPrimitive.Separator>\n>(({ className, ...props }, ref) => (\n <DropdownMenuPrimitive.Separator ref={ref} className={cn('bg-muted -mx-1 my-1 h-px', className)} {...props} />\n))\nDropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName\n\nconst DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {\n return <span className={cn('ml-auto text-xs tracking-widest opacity-60', className)} {...props} />\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut'\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuGroup,\n DropdownMenuPortal,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuRadioGroup,\n}\n"],"mappings":";;;;;;;;;AASA,IAAM,eAAe,sBAAsB;AAE3C,IAAM,sBAAsB,sBAAsB;AAElD,IAAM,oBAAoB,sBAAsB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A,oBAAC,sBAAsB,eAAvB,EAAA,UACE,oBAAC,WAAD,EAAW,WAAU,UAAW,CAAA,EACG,CAAA;CACjC,CAAA,GACL,QACiC;AACrC,CAAA,CAAA;AACD,yBAAyB,cAAc,sBAAsB,aAAa;AAE1E,IAAM,wBAAwBA,QAAM,YAGjC,EAAE,WAAW,UAAU,GAAG,SAAS,QACpC,qBAAC,sBAAsB,WAAvB;CACO;CACL,WAAW,GACT,cACA,8MACA,SACF;CACA,GAAI;CAPN,UAAA,CASE,oBAAC,QAAD;EAAM,WAAU;EACd,UAAA,oBAAC,sBAAsB,eAAvB,EAAA,UACE,oBAAC,SAAD,EAAS,WAAU,uBAAwB,CAAA,EACR,CAAA;CACjC,CAAA,GACL,QAC8B;AAClC,CAAA,CAAA;AACD,sBAAsB,cAAc,sBAAsB,UAAU;AAEpE,IAAM,oBAAoBA,QAAM,YAK7B,EAAE,WAAW,OAAO,GAAG,SAAS,QACjC,oBAAC,sBAAsB,OAAvB;CACO;CACL,WAAW,GAAG,qCAAqC,SAAS,QAAQ,SAAS;CAC7E,GAAI;AACL,CAAA,CACF;AACD,kBAAkB,cAAc,sBAAsB,MAAM;AAE5D,IAAM,wBAAwBA,QAAM,YAGjC,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,sBAAsB,WAAvB;CAAsC;CAAK,WAAW,GAAG,4BAA4B,SAAS;CAAG,GAAI;AAAQ,CAAA,CAC9G;AACD,sBAAsB,cAAc,sBAAsB,UAAU;AAEpE,IAAM,wBAAwB,EAAE,WAAW,GAAG,YAAmD;CAC/F,OAAO,oBAAC,QAAD;EAAM,WAAW,GAAG,8CAA8C,SAAS;EAAG,GAAI;CAAQ,CAAA;AACnG;AACA,qBAAqB,cAAc"}
|
|
@@ -10,7 +10,7 @@ var SheetTrigger = SheetPrimitive.Trigger;
|
|
|
10
10
|
var SheetClose = SheetPrimitive.Close;
|
|
11
11
|
var SheetPortal = SheetPrimitive.Portal;
|
|
12
12
|
var SheetOverlay = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(SheetPrimitive.Overlay, {
|
|
13
|
-
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-
|
|
13
|
+
className: cn("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-neutral-950/32", className),
|
|
14
14
|
...props,
|
|
15
15
|
ref
|
|
16
16
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sheet.js","names":["React"],"sources":["../../../../src/components/navigation/Sheet/Sheet.tsx"],"sourcesContent":["import { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport * as SheetPrimitive from '@radix-ui/react-dialog'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst SheetRoot = SheetPrimitive.Root\n\nconst SheetTrigger = SheetPrimitive.Trigger\n\nconst SheetClose = SheetPrimitive.Close\n\nconst SheetPortal = SheetPrimitive.Portal\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-
|
|
1
|
+
{"version":3,"file":"Sheet.js","names":["React"],"sources":["../../../../src/components/navigation/Sheet/Sheet.tsx"],"sourcesContent":["import { XIcon } from '@phosphor-icons/react/dist/ssr/X'\nimport * as SheetPrimitive from '@radix-ui/react-dialog'\nimport { cva, type VariantProps } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { cn } from '@/lib/utils'\n\nconst SheetRoot = SheetPrimitive.Root\n\nconst SheetTrigger = SheetPrimitive.Trigger\n\nconst SheetClose = SheetPrimitive.Close\n\nconst SheetPortal = SheetPrimitive.Portal\n\nconst SheetOverlay = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Overlay\n className={cn(\n 'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-neutral-950/32',\n className,\n )}\n {...props}\n ref={ref}\n />\n))\nSheetOverlay.displayName = SheetPrimitive.Overlay.displayName\n\nconst sheetVariants = cva(\n 'fixed z-50 gap-4 bg-background-100 p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500',\n {\n variants: {\n side: {\n top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',\n bottom:\n 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',\n left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',\n right:\n 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm',\n },\n },\n defaultVariants: {\n side: 'left',\n },\n },\n)\n\ntype SheetContentProps = {\n showClose?: boolean\n} & React.ComponentPropsWithoutRef<typeof SheetPrimitive.Content> &\n VariantProps<typeof sheetVariants>\n\nconst SheetContent = React.forwardRef<React.ComponentRef<typeof SheetPrimitive.Content>, SheetContentProps>(\n ({ side = 'left', className, children, showClose, ...props }, ref) => (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Content ref={ref} className={cn(sheetVariants({ side }), className)} {...props}>\n {children}\n {showClose && (\n <SheetPrimitive.Close className=\"data-[state=open]:bg-secondary ring-offset-background absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:outline-none disabled:pointer-events-none\">\n <XIcon className=\"h-4 w-4\" />\n <span className=\"sr-only\">Close</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Content>\n </SheetPortal>\n ),\n)\nSheetContent.displayName = SheetPrimitive.Content.displayName\n\nconst SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col space-y-2 text-center sm:text-left', className)} {...props} />\n)\nSheetHeader.displayName = 'SheetHeader'\n\nconst SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n <div className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2', className)} {...props} />\n)\nSheetFooter.displayName = 'SheetFooter'\n\nconst SheetTitle = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Title ref={ref} className={cn('text-foreground text-lg font-semibold', className)} {...props} />\n))\nSheetTitle.displayName = SheetPrimitive.Title.displayName\n\nconst SheetDescription = React.forwardRef<\n React.ComponentRef<typeof SheetPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof SheetPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <SheetPrimitive.Description ref={ref} className={cn('text-muted-foreground text-sm', className)} {...props} />\n))\nSheetDescription.displayName = SheetPrimitive.Description.displayName\n\nexport type SheetComponentProps = {\n trigger: string | React.ReactNode\n title: string | React.ReactNode\n content: string | React.ReactNode\n showClose?: boolean\n className?: string\n side?: 'top' | 'bottom' | 'left' | 'right'\n}\n\nexport const Sheet = ({ trigger, title, content, side, className, showClose }: SheetComponentProps) => {\n return (\n <SheetRoot>\n <SheetTrigger>{trigger}</SheetTrigger>\n <SheetContent showClose={showClose} side={side} className={className}>\n <SheetHeader>\n <SheetTitle>{title}</SheetTitle>\n </SheetHeader>\n {content}\n </SheetContent>\n </SheetRoot>\n )\n}\n\nexport {\n SheetRoot,\n SheetPortal,\n SheetOverlay,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n"],"mappings":";;;;;;;AAOA,IAAM,YAAY,eAAe;AAEjC,IAAM,eAAe,eAAe;AAEpC,IAAM,aAAa,eAAe;AAElC,IAAM,cAAc,eAAe;AAEnC,IAAM,eAAeA,QAAM,YAGxB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,SAAhB;CACE,WAAW,GACT,gKACA,SACF;CACA,GAAI;CACC;AACN,CAAA,CACF;AACD,aAAa,cAAc,eAAe,QAAQ;AAElD,IAAM,gBAAgB,IACpB,wMACA;CACE,UAAU,EACR,MAAM;EACJ,KAAK;EACL,QACE;EACF,MAAM;EACN,OACE;CACJ,EACF;CACA,iBAAiB,EACf,MAAM,OACR;AACF,CACF;AAOA,IAAM,eAAeA,QAAM,YACxB,EAAE,OAAO,QAAQ,WAAW,UAAU,WAAW,GAAG,SAAS,QAC5D,qBAAC,aAAD,EAAA,UAAA,CACE,oBAAC,cAAD,CAAe,CAAA,GACf,qBAAC,eAAe,SAAhB;CAA6B;CAAK,WAAW,GAAG,cAAc,EAAE,KAAK,CAAC,GAAG,SAAS;CAAG,GAAI;CAAzF,UAAA,CACG,UACA,aACC,qBAAC,eAAe,OAAhB;EAAsB,WAAU;EAAhC,UAAA,CACE,oBAAC,OAAD,EAAO,WAAU,UAAW,CAAA,GAC5B,oBAAC,QAAD;GAAM,WAAU;GAAU,UAAA;EAAW,CAAA,CACjB;CAEF,CAAA,CAAA;AACb,CAAA,CAAA,EAAA,CAAA,CAEjB;AACA,aAAa,cAAc,eAAe,QAAQ;AAElD,IAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CAAK,WAAW,GAAG,oDAAoD,SAAS;CAAG,GAAI;AAAQ,CAAA;AAEjG,YAAY,cAAc;AAE1B,IAAM,eAAe,EAAE,WAAW,GAAG,YACnC,oBAAC,OAAD;CAAK,WAAW,GAAG,iEAAiE,SAAS;CAAG,GAAI;AAAQ,CAAA;AAE9G,YAAY,cAAc;AAE1B,IAAM,aAAaA,QAAM,YAGtB,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,OAAhB;CAA2B;CAAK,WAAW,GAAG,yCAAyC,SAAS;CAAG,GAAI;AAAQ,CAAA,CAChH;AACD,WAAW,cAAc,eAAe,MAAM;AAE9C,IAAM,mBAAmBA,QAAM,YAG5B,EAAE,WAAW,GAAG,SAAS,QAC1B,oBAAC,eAAe,aAAhB;CAAiC;CAAK,WAAW,GAAG,iCAAiC,SAAS;CAAG,GAAI;AAAQ,CAAA,CAC9G;AACD,iBAAiB,cAAc,eAAe,YAAY;AAW1D,IAAa,SAAS,EAAE,SAAS,OAAO,SAAS,MAAM,WAAW,gBAAqC;CACrG,OACE,qBAAC,WAAD,EAAA,UAAA,CACE,oBAAC,cAAD,EAAA,UAAe,QAAsB,CAAA,GACrC,qBAAC,cAAD;EAAyB;EAAiB;EAAiB;EAA3D,UAAA,CACE,oBAAC,aAAD,EAAA,UACE,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA,EACpB,CAAA,GACZ,OACW;CACL,CAAA,CAAA,EAAA,CAAA;AAEf"}
|
|
@@ -195,7 +195,7 @@ var SidebarMenuSkeleton = React$1.forwardRef(({ className, showIcon = false, siz
|
|
|
195
195
|
}),
|
|
196
196
|
showIcon && /* @__PURE__ */ jsx(Skeleton, {
|
|
197
197
|
"aria-hidden": true,
|
|
198
|
-
className: cn("shrink-0
|
|
198
|
+
className: cn("shrink-0", dims.icon),
|
|
199
199
|
"data-sidebar": "menu-skeleton-icon"
|
|
200
200
|
}),
|
|
201
201
|
/* @__PURE__ */ jsx(Skeleton, {
|
|
@@ -420,7 +420,7 @@ var SidebarMenuCollapsible = React$1.forwardRef(({ label, icon, isActive = false
|
|
|
420
420
|
className: "block px-3 pt-3 pb-2 text-neutral-500",
|
|
421
421
|
children: label
|
|
422
422
|
}), /* @__PURE__ */ jsx("ul", {
|
|
423
|
-
className: "flex flex-col",
|
|
423
|
+
className: "flex flex-col [&>li]:rounded-(--surface-item-radius)",
|
|
424
424
|
children
|
|
425
425
|
})]
|
|
426
426
|
})]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarMenu.js","names":["React"],"sources":["../../../../src/components/navigation/Sidebar/SidebarMenu.tsx"],"sourcesContent":["'use client'\n\nimport { CaretDownIcon } from '@phosphor-icons/react/dist/ssr/CaretDown'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { TooltipContent, TooltipRoot, TooltipTrigger } from '../../data-display/Tooltip'\nimport { Typography } from '../../data-display/Typography'\nimport { Skeleton } from '../../feedback/Skeleton'\nimport { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from '../../surface/Collapsible'\nimport { PopoverAnchor, PopoverContent, PopoverRoot } from '../../utils/Popover'\n\nimport { useResolvedSize, useSidebar } from './context'\nimport type { SidebarSize } from './context'\nimport { MOTION, FADE_TEXT, SIDEBAR_COLLISION_PADDING, SIDEBAR_FLYOUT_SURFACE } from './styles'\n\nimport { getInputModality } from '@/lib/inputModality'\nimport { MARQUEE_FADE_MASK } from '@/lib/marquee'\nimport { cn } from '@/lib/utils'\n\nconst SIDEBAR_FLYOUT_ALIGN_OFFSET: Record<SidebarSize, number> = {\n small: -9,\n medium: -5,\n big: -1,\n}\n\nconst SIDEBAR_POPOVER_SWITCH = '[body:has([data-sidebar=popover][data-state$=open])_&]:data-[state=closed]:duration-0'\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'>>(({ className, ...props }, ref) => (\n <ul ref={ref} data-sidebar=\"menu\" className={cn('flex w-full min-w-0 flex-col gap-3', className)} {...props} />\n))\nSidebarMenu.displayName = 'SidebarMenu'\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(({ className, ...props }, ref) => (\n <li ref={ref} data-sidebar=\"menu-item\" className={cn('group/menu-item relative', className)} {...props} />\n))\nSidebarMenuItem.displayName = 'SidebarMenuItem'\n\nconst FADE_LAST_SPAN =\n '[&>span:last-child]:min-w-0 [&>span:last-child]:flex-1 [&>span:last-child]:overflow-hidden [&>span:last-child]:whitespace-nowrap [&>span:last-child]:mask-[linear-gradient(to_right,transparent,black_var(--fade-left,0px),black_calc(100%-var(--fade-right,1rem)),transparent)] [&>span:last-child]:mask-no-repeat [&>span:last-child]:after:inline-block [&>span:last-child]:after:w-4 [&>span:last-child]:after:content-[\"\"]'\n\nconst sidebarMenuButtonVariants = cva(\n [\n 'peer/menu-button group/menu-button relative flex w-full items-center overflow-hidden rounded-lg pr-2 text-left text-sm whitespace-nowrap outline-hidden',\n 'text-sidebar-foreground ring-sidebar-ring focus-visible:ring-2',\n 'transition-[padding,background-color]',\n MOTION,\n 'hover:bg-sidebar-accent',\n 'disabled:pointer-events-none disabled:opacity-40 aria-disabled:pointer-events-none aria-disabled:opacity-40',\n 'group-has-[[data-sidebar=menu-action]]/menu-item:pr-8',\n 'data-[active=true]:bg-background-200 data-[active=true]:font-semibold',\n 'before:absolute before:top-1/2 before:left-0 before:w-0.75 before:-translate-y-1/2 before:rounded-lg before:bg-primary-950 before:opacity-0 data-[active=true]:before:opacity-100 before:transition-opacity motion-reduce:before:transition-none',\n FADE_LAST_SPAN,\n '[&>svg]:shrink-0',\n ].join(' '),\n {\n variants: {\n variant: {\n 'navigation-item':\n '[&>:not(svg:first-child)]:transition-[opacity,rotate] [&>:not(svg:first-child)]:duration-200 [&>:not(svg:first-child)]:ease-in-out motion-reduce:[&>:not(svg:first-child)]:duration-0 group-data-[state=collapsed]:pr-0 group-data-[state=collapsed]:[&>:not(svg:first-child)]:opacity-0',\n element: 'group-data-[state=collapsed]:p-0',\n },\n size: {\n small: 'h-8 gap-2 pl-1.75 before:h-4 [&>svg:first-child]:size-4.5',\n medium: 'h-10 gap-3 pl-2.5 before:h-5 [&>svg:first-child]:size-5',\n big: 'h-12 gap-3 pl-3 before:h-6 [&>svg:first-child]:size-6',\n },\n },\n defaultVariants: {\n variant: 'navigation-item',\n size: 'medium',\n },\n },\n)\n\nfunction useCloseSheetOnLink<T extends HTMLElement>(onClick?: React.MouseEventHandler<T>) {\n const { isMobile, setOpenMobile } = useSidebar()\n\n return (event: React.MouseEvent<T>) => {\n onClick?.(event)\n if (isMobile && event.currentTarget instanceof HTMLAnchorElement) {\n setOpenMobile(false)\n }\n }\n}\n\nconst SidebarMenuButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<'button'> & {\n asChild?: boolean\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n variant?: 'navigation-item' | 'element'\n size?: SidebarSize\n }\n>(\n (\n {\n asChild = false,\n isActive = false,\n tooltip,\n className,\n children,\n variant = 'navigation-item',\n size,\n onClick,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button'\n const { isMobile, state } = useSidebar()\n const resolvedSize = useResolvedSize(size)\n const [tooltipOpen, setTooltipOpen] = React.useState(false)\n const handleClick = useCloseSheetOnLink(onClick)\n\n const button = (\n <Comp\n ref={ref}\n type={asChild ? undefined : 'button'}\n data-sidebar=\"menu-button\"\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size: resolvedSize }), className)}\n onClick={handleClick}\n {...props}\n >\n {children}\n </Comp>\n )\n\n if (!tooltip) {\n return button\n }\n\n const {\n hidden,\n className: tooltipClassName,\n children: tooltipLabel,\n ...tooltipProps\n }: React.ComponentProps<typeof TooltipContent> = typeof tooltip === 'string' ? { children: tooltip } : tooltip\n const tooltipEnabled = state === 'collapsed' && !isMobile && !hidden\n if (!tooltipEnabled && tooltipOpen) {\n setTooltipOpen(false)\n }\n\n return (\n <TooltipRoot open={tooltipEnabled && tooltipOpen} onOpenChange={setTooltipOpen}>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n data-sidebar=\"popover\"\n side=\"right\"\n align=\"center\"\n className={cn('px-4.25 data-[state=instant-open]:duration-0', SIDEBAR_POPOVER_SWITCH, tooltipClassName)}\n {...tooltipProps}\n >\n {typeof tooltipLabel === 'string' ? (\n <Typography variant=\"body-sm\" weight=\"semibold\" className=\"block\">\n {tooltipLabel}\n </Typography>\n ) : (\n tooltipLabel\n )}\n </TooltipContent>\n </TooltipRoot>\n )\n },\n)\nSidebarMenuButton.displayName = 'SidebarMenuButton'\n\nconst sidebarMenuActionVariants = cva(\n [\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute flex aspect-square items-center justify-center rounded-md p-0 transition-[opacity,visibility,color,background-color] outline-hidden focus-visible:ring-2 after:absolute after:-inset-2 after:md:hidden group-data-[state=collapsed]:invisible group-data-[state=collapsed]:opacity-0 [&>svg]:shrink-0',\n MOTION,\n ].join(' '),\n {\n variants: {\n size: {\n small: 'top-1.5 right-1 w-5 [&>svg]:size-4',\n medium: 'top-2.5 right-1 w-5 [&>svg]:size-4',\n big: 'top-3 right-1.5 w-6 [&>svg]:size-5',\n },\n showOnHover: {\n true: 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=expanded]:opacity-100 md:opacity-0',\n false: '',\n },\n },\n defaultVariants: {\n size: 'medium',\n showOnHover: false,\n },\n },\n)\n\nconst SidebarMenuAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<'button'> & {\n asChild?: boolean\n showOnHover?: boolean\n size?: SidebarSize\n }\n>(({ className, asChild = false, showOnHover = false, size, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n const resolvedSize = useResolvedSize(size)\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : 'button'}\n data-sidebar=\"menu-action\"\n className={cn(sidebarMenuActionVariants({ size: resolvedSize, showOnHover }), className)}\n {...props}\n />\n )\n})\nSidebarMenuAction.displayName = 'SidebarMenuAction'\n\nconst sidebarMenuBadgeVariants = cva(\n [\n 'text-sidebar-foreground pointer-events-none absolute flex items-center justify-center rounded-md font-medium tabular-nums select-none peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground transition-[opacity,visibility] group-data-[state=collapsed]:invisible group-data-[state=collapsed]:opacity-0',\n MOTION,\n ].join(' '),\n {\n variants: {\n size: {\n small: 'top-1.5 right-1 h-5 min-w-5 px-1 text-xs',\n medium: 'top-2.5 right-1 h-5 min-w-5 px-1 text-xs',\n big: 'top-3 right-1.5 h-6 min-w-6 px-1.5 text-sm',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\nconst SidebarMenuBadge = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'> & { size?: SidebarSize }>(\n ({ className, size, ...props }, ref) => {\n const resolvedSize = useResolvedSize(size)\n\n return (\n <div\n ref={ref}\n data-sidebar=\"menu-badge\"\n className={cn(sidebarMenuBadgeVariants({ size: resolvedSize }), className)}\n {...props}\n />\n )\n },\n)\nSidebarMenuBadge.displayName = 'SidebarMenuBadge'\n\nconst SIDEBAR_MENU_SKELETON: Record<SidebarSize, { row: string; icon: string }> = {\n small: { row: 'h-8 gap-2 pl-1.75 pr-2', icon: 'size-4.5' },\n medium: { row: 'h-10 gap-3 pl-2.5 pr-2', icon: 'size-5' },\n big: { row: 'h-12 gap-3 pl-3 pr-2', icon: 'size-6' },\n}\n\nconst SidebarMenuSkeleton = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & {\n showIcon?: boolean\n size?: SidebarSize\n }\n>(({ className, showIcon = false, size, ...props }, ref) => {\n const resolvedSize = useResolvedSize(size)\n const dims = SIDEBAR_MENU_SKELETON[resolvedSize]\n\n return (\n <div\n ref={ref}\n data-sidebar=\"menu-skeleton\"\n className={cn('flex items-center overflow-hidden rounded-lg', dims.row, className)}\n {...props}\n >\n <span className=\"sr-only\">Loading</span>\n {showIcon && (\n <Skeleton aria-hidden className={cn('shrink-0 rounded-md', dims.icon)} data-sidebar=\"menu-skeleton-icon\" />\n )}\n <Skeleton aria-hidden className=\"h-4 max-w-7/10 flex-1\" data-sidebar=\"menu-skeleton-text\" />\n </div>\n )\n})\nSidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton'\n\nconst sidebarMenuSubVariants = cva(\n [\n 'border-sidebar-border relative flex min-w-0 flex-col gap-1 border-l-2 pl-2 group-data-[state=collapsed]:hidden',\n 'before:bg-primary-950 before:absolute before:top-0 before:-left-0.5 before:h-(--indicator-height) before:w-0.5 before:translate-y-(--indicator-top) before:opacity-0',\n 'data-[indicator=visible]:before:opacity-100 before:transition-opacity',\n 'data-[indicator-slide=true]:before:transition-[opacity,translate,height] motion-reduce:before:transition-none',\n ].join(' '),\n {\n variants: {\n size: {\n small: 'ml-3.75',\n medium: 'ml-4.75',\n big: 'ml-5.75',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\ntype SubIndicator = { top: number; height: number; visible: boolean; slide: boolean }\n\nfunction useSubIndicator(listRef: React.RefObject<HTMLUListElement | null>) {\n const [indicator, setIndicator] = React.useState<SubIndicator | null>(null)\n\n React.useLayoutEffect(() => {\n const list = listRef.current\n if (!list) {\n return\n }\n\n const update = () => {\n const active = list.querySelector<HTMLElement>('[data-sidebar=menu-sub-button][data-active=true]')\n setIndicator((prev) => {\n if (!active) {\n return prev?.visible ? { ...prev, visible: false, slide: false } : prev\n }\n const { offsetTop: top, offsetHeight: height } = active\n if (prev?.visible && prev.top === top && prev.height === height) {\n return prev\n }\n return { top, height, visible: true, slide: Boolean(prev?.visible) }\n })\n }\n\n update()\n const mutationObserver = new MutationObserver(update)\n mutationObserver.observe(list, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: ['data-active'],\n })\n const resizeObserver = new ResizeObserver(update)\n resizeObserver.observe(list)\n return () => {\n mutationObserver.disconnect()\n resizeObserver.disconnect()\n }\n }, [listRef])\n\n return indicator\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'> & { size?: SidebarSize }>(\n ({ className, size, style, ...props }, ref) => {\n const resolvedSize = useResolvedSize(size)\n const listRef = React.useRef<HTMLUListElement>(null)\n React.useImperativeHandle(ref, () => listRef.current as HTMLUListElement, [])\n const indicator = useSubIndicator(listRef)\n\n return (\n <ul\n ref={listRef}\n data-sidebar=\"menu-sub\"\n data-indicator={indicator?.visible ? 'visible' : 'hidden'}\n data-indicator-slide={indicator?.slide}\n className={cn(sidebarMenuSubVariants({ size: resolvedSize }), className)}\n style={\n {\n '--indicator-top': `${indicator?.top ?? 0}px`,\n '--indicator-height': `${indicator?.height ?? 0}px`,\n ...style,\n } as React.CSSProperties\n }\n {...props}\n />\n )\n },\n)\nSidebarMenuSub.displayName = 'SidebarMenuSub'\n\nconst SidebarMenuSubItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(\n ({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\n 'ring-sidebar-ring hover:bg-sidebar-accent has-[>[data-active=true]]:bg-background-200 rounded-lg transition-colors has-[>:focus-visible]:ring-2 has-[>[aria-disabled=true]]:pointer-events-none motion-reduce:transition-none',\n className,\n )}\n {...props}\n />\n ),\n)\nSidebarMenuSubItem.displayName = 'SidebarMenuSubItem'\n\nconst sidebarMenuSubButtonVariants = cva(\n [\n 'text-sidebar-foreground block w-full min-w-0 px-3 text-sm tracking-[0.035px] outline-hidden',\n 'overflow-hidden whitespace-nowrap mask-clip-content mask-origin-content',\n MARQUEE_FADE_MASK,\n 'aria-disabled:pointer-events-none aria-disabled:opacity-40 data-[active=true]:font-semibold',\n ].join(' '),\n {\n variants: {\n size: {\n small: 'h-8 leading-8',\n medium: 'h-9 leading-9',\n big: 'h-10 leading-10',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\nconst SidebarMenuSubButton = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentProps<'a'> & {\n asChild?: boolean\n isActive?: boolean\n size?: SidebarSize\n }\n>(({ asChild = false, isActive, className, children, size, onClick, ...props }, ref) => {\n const Comp = asChild ? Slot : 'a'\n const resolvedSize = useResolvedSize(size)\n const handleClick = useCloseSheetOnLink(onClick)\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-sub-button\"\n data-active={isActive}\n className={cn(sidebarMenuSubButtonVariants({ size: resolvedSize }), className)}\n onClick={handleClick}\n {...props}\n >\n {children}\n </Comp>\n )\n})\nSidebarMenuSubButton.displayName = 'SidebarMenuSubButton'\n\nconst SIDEBAR_CHEVRON: Record<SidebarSize, string> = {\n small: 'size-4',\n medium: 'size-4',\n big: 'size-5',\n}\n\ntype SidebarMenuCollapsibleProps = Omit<React.ComponentProps<'li'>, 'children'> & {\n label: string\n icon: React.ReactNode\n isActive?: boolean\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n children: React.ReactNode\n}\n\nconst SidebarMenuCollapsible = React.forwardRef<HTMLLIElement, SidebarMenuCollapsibleProps>(\n ({ label, icon, isActive = false, open: openProp, defaultOpen = false, onOpenChange, children, ...props }, ref) => {\n const { state, isMobile, size } = useSidebar()\n const isRail = state === 'collapsed' && !isMobile\n const [openState, setOpenState] = React.useState(defaultOpen)\n const [flyoutOpen, setFlyoutOpen] = React.useState(false)\n const [flyoutInstant, setFlyoutInstant] = React.useState(false)\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n const titleId = React.useId()\n const sectionOpen = !isRail && (openProp ?? openState)\n\n if (!isRail && flyoutOpen) {\n setFlyoutOpen(false)\n }\n\n const handleSectionOpenChange = (value: boolean) => {\n if (openProp === undefined) {\n setOpenState(value)\n }\n onOpenChange?.(value)\n }\n\n const openFlyout = () => {\n setFlyoutInstant(document.querySelector('[data-sidebar=popover]') !== null)\n setFlyoutOpen(true)\n }\n\n const railProps = isRail\n ? {\n 'aria-haspopup': 'dialog' as const,\n 'aria-expanded': flyoutOpen,\n className: flyoutOpen ? 'bg-sidebar-accent' : undefined,\n onPointerDown: (event: React.PointerEvent) => {\n if (event.button === 0 && !event.ctrlKey) {\n event.preventDefault()\n openFlyout()\n }\n },\n onClick: (event: React.MouseEvent) => {\n event.preventDefault()\n if (event.detail === 0) {\n openFlyout()\n }\n },\n }\n : {}\n\n return (\n <SidebarMenuItem ref={ref} {...props}>\n <CollapsibleRoot open={sectionOpen} onOpenChange={handleSectionOpenChange}>\n <PopoverRoot modal open={flyoutOpen} onOpenChange={setFlyoutOpen}>\n <PopoverAnchor asChild>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton\n ref={triggerRef}\n isActive={isActive}\n tooltip={{ children: label, hidden: flyoutOpen }}\n {...railProps}\n >\n {icon}\n <Typography variant=\"body-md\" weight={isActive ? 'semibold' : 'regular'} className={FADE_TEXT}>\n {label}\n </Typography>\n <CaretDownIcon\n weight=\"regular\"\n aria-hidden\n className={cn(\n 'ml-auto shrink-0 group-data-[state=open]/menu-button:rotate-180',\n SIDEBAR_CHEVRON[size],\n )}\n />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n </PopoverAnchor>\n <PopoverContent\n side=\"right\"\n align=\"start\"\n sideOffset={4}\n collisionPadding={SIDEBAR_COLLISION_PADDING}\n alignOffset={SIDEBAR_FLYOUT_ALIGN_OFFSET[size]}\n data-sidebar=\"popover\"\n aria-labelledby={titleId}\n className={cn(\n SIDEBAR_FLYOUT_SURFACE,\n 'w-max max-w-(--radix-popover-content-available-width) min-w-60',\n flyoutInstant && 'data-[state=open]:duration-0',\n )}\n onClick={(event) => {\n if (event.target instanceof Element && event.target.closest('a, button')) {\n setFlyoutOpen(false)\n if (!(openProp ?? openState)) {\n handleSectionOpenChange(true)\n }\n }\n }}\n onOpenAutoFocus={(event) => {\n event.preventDefault()\n if (event.target instanceof HTMLElement) {\n const focusTarget =\n getInputModality() === 'keyboard'\n ? event.target.querySelector<HTMLElement>('a, button')\n : event.target\n focusTarget?.focus()\n }\n }}\n onCloseAutoFocus={(event) => {\n event.preventDefault()\n if (getInputModality() === 'keyboard') {\n triggerRef.current?.focus()\n }\n }}\n >\n <Typography\n id={titleId}\n variant=\"body-sm\"\n weight=\"semibold\"\n className=\"block px-3 pt-3 pb-2 text-neutral-500\"\n >\n {label}\n </Typography>\n <ul className=\"flex flex-col\">{children}</ul>\n </PopoverContent>\n </PopoverRoot>\n <CollapsibleContent\n className={cn(\n 'group/section data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down -mx-1 overflow-hidden px-1',\n MOTION,\n )}\n >\n <div className=\"pt-1 pb-0.5\">\n <SidebarMenuSub\n className={cn(\n 'group-data-[state=collapsed]:flex',\n 'group-data-[state=closed]/section:animate-out group-data-[state=closed]/section:fade-out-0 group-data-[state=open]/section:animate-in group-data-[state=open]/section:fade-in-0',\n MOTION,\n )}\n >\n {children}\n </SidebarMenuSub>\n </div>\n </CollapsibleContent>\n </CollapsibleRoot>\n </SidebarMenuItem>\n )\n },\n)\nSidebarMenuCollapsible.displayName = 'SidebarMenuCollapsible'\n\nexport {\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuCollapsible,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n sidebarMenuActionVariants,\n sidebarMenuBadgeVariants,\n sidebarMenuButtonVariants,\n sidebarMenuSubButtonVariants,\n sidebarMenuSubVariants,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,IAAA,8BAAA;CACE,OAAA;CACA,QAAA;CACA,KAAA;AACF;AAEA,IAAA,yBAAA;AAEA,IAAA,cAAA,QAAA,YAAA,EAAA,WAAA,GAAA,SAAA,QAAA,oBAAA,MAAA;CACW;CAAK,gBAAA;CAAoB,WAAA,GAAA,sCAAA,SAAA;CAAgE,GAAA;AAAY,CAAA,CAAA;AAEhH,YAAA,cAAA;AAEA,IAA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cAAA,KAAA;OACA,IAAA,EAAA,YAAA,YAAA,wBAAA,IAAA;MAGF;KACF;KACA,kBAAA,UAAA;MACE,MAAA,eAAA;MACA,IAAA,MAAA,kBAAA,aAAA,CAAA,iBAAA,MAAA,aAAA,MAAA,OAAA,cAAA,WAAA,IAAA,MAAA,OAAA,EAAA,MAAA;KAOF;KACA,mBAAA,UAAA;MACE,MAAA,eAAA;MACA,IAAA,iBAAA,MAAA,YAAA,WAAA,SAAA,MAAA;KAGF;KApCF,UAAA,CAAA,oBAAA,YAAA;MAuCI,IAAA;MACA,SAAA;MACA,QAAA;MACA,WAAA;MAEC,UAAA;KACS,CAAA,GAAA,oBAAA,MAAA;MACR,WAAA;MAA2B;KAAa,CAAA,CAAA;IAEnC,CAAA,CAAA;GACb,CAAA,GAAA,oBAAA,oBAAA;IACE,WAAA,GAAA,kIAAA,MAAA;IAKA,UAAA,oBAAA,OAAA;KAAK,WAAA;KACH,UAAA,oBAAA,gBAAA;MACE,WAAA,GAAA,qCAAA,mLAAA,MAAA;MAMC;KACa,CAAA;IACb,CAAA;GACa,CAAA,CAAA;;CAEP,CAAA;AAErB,CAAA;AAEF,uBAAA,cAAA"}
|
|
1
|
+
{"version":3,"file":"SidebarMenu.js","names":["React"],"sources":["../../../../src/components/navigation/Sidebar/SidebarMenu.tsx"],"sourcesContent":["'use client'\n\nimport { CaretDownIcon } from '@phosphor-icons/react/dist/ssr/CaretDown'\nimport { Slot } from '@radix-ui/react-slot'\nimport { cva } from 'class-variance-authority'\nimport * as React from 'react'\n\nimport { TooltipContent, TooltipRoot, TooltipTrigger } from '../../data-display/Tooltip'\nimport { Typography } from '../../data-display/Typography'\nimport { Skeleton } from '../../feedback/Skeleton'\nimport { CollapsibleContent, CollapsibleRoot, CollapsibleTrigger } from '../../surface/Collapsible'\nimport { PopoverAnchor, PopoverContent, PopoverRoot } from '../../utils/Popover'\n\nimport { useResolvedSize, useSidebar } from './context'\nimport type { SidebarSize } from './context'\nimport { MOTION, FADE_TEXT, SIDEBAR_COLLISION_PADDING, SIDEBAR_FLYOUT_SURFACE } from './styles'\n\nimport { getInputModality } from '@/lib/inputModality'\nimport { MARQUEE_FADE_MASK } from '@/lib/marquee'\nimport { cn } from '@/lib/utils'\n\nconst SIDEBAR_FLYOUT_ALIGN_OFFSET: Record<SidebarSize, number> = {\n small: -9,\n medium: -5,\n big: -1,\n}\n\nconst SIDEBAR_POPOVER_SWITCH = '[body:has([data-sidebar=popover][data-state$=open])_&]:data-[state=closed]:duration-0'\n\nconst SidebarMenu = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'>>(({ className, ...props }, ref) => (\n <ul ref={ref} data-sidebar=\"menu\" className={cn('flex w-full min-w-0 flex-col gap-3', className)} {...props} />\n))\nSidebarMenu.displayName = 'SidebarMenu'\n\nconst SidebarMenuItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(({ className, ...props }, ref) => (\n <li ref={ref} data-sidebar=\"menu-item\" className={cn('group/menu-item relative', className)} {...props} />\n))\nSidebarMenuItem.displayName = 'SidebarMenuItem'\n\nconst FADE_LAST_SPAN =\n '[&>span:last-child]:min-w-0 [&>span:last-child]:flex-1 [&>span:last-child]:overflow-hidden [&>span:last-child]:whitespace-nowrap [&>span:last-child]:mask-[linear-gradient(to_right,transparent,black_var(--fade-left,0px),black_calc(100%-var(--fade-right,1rem)),transparent)] [&>span:last-child]:mask-no-repeat [&>span:last-child]:after:inline-block [&>span:last-child]:after:w-4 [&>span:last-child]:after:content-[\"\"]'\n\nconst sidebarMenuButtonVariants = cva(\n [\n 'peer/menu-button group/menu-button relative flex w-full items-center overflow-hidden rounded-lg pr-2 text-left text-sm whitespace-nowrap outline-hidden',\n 'text-sidebar-foreground ring-sidebar-ring focus-visible:ring-2',\n 'transition-[padding,background-color]',\n MOTION,\n 'hover:bg-sidebar-accent',\n 'disabled:pointer-events-none disabled:opacity-40 aria-disabled:pointer-events-none aria-disabled:opacity-40',\n 'group-has-[[data-sidebar=menu-action]]/menu-item:pr-8',\n 'data-[active=true]:bg-background-200 data-[active=true]:font-semibold',\n 'before:absolute before:top-1/2 before:left-0 before:w-0.75 before:-translate-y-1/2 before:rounded-lg before:bg-primary-950 before:opacity-0 data-[active=true]:before:opacity-100 before:transition-opacity motion-reduce:before:transition-none',\n FADE_LAST_SPAN,\n '[&>svg]:shrink-0',\n ].join(' '),\n {\n variants: {\n variant: {\n 'navigation-item':\n '[&>:not(svg:first-child)]:transition-[opacity,rotate] [&>:not(svg:first-child)]:duration-200 [&>:not(svg:first-child)]:ease-in-out motion-reduce:[&>:not(svg:first-child)]:duration-0 group-data-[state=collapsed]:pr-0 group-data-[state=collapsed]:[&>:not(svg:first-child)]:opacity-0',\n element: 'group-data-[state=collapsed]:p-0',\n },\n size: {\n small: 'h-8 gap-2 pl-1.75 before:h-4 [&>svg:first-child]:size-4.5',\n medium: 'h-10 gap-3 pl-2.5 before:h-5 [&>svg:first-child]:size-5',\n big: 'h-12 gap-3 pl-3 before:h-6 [&>svg:first-child]:size-6',\n },\n },\n defaultVariants: {\n variant: 'navigation-item',\n size: 'medium',\n },\n },\n)\n\nfunction useCloseSheetOnLink<T extends HTMLElement>(onClick?: React.MouseEventHandler<T>) {\n const { isMobile, setOpenMobile } = useSidebar()\n\n return (event: React.MouseEvent<T>) => {\n onClick?.(event)\n if (isMobile && event.currentTarget instanceof HTMLAnchorElement) {\n setOpenMobile(false)\n }\n }\n}\n\nconst SidebarMenuButton = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<'button'> & {\n asChild?: boolean\n isActive?: boolean\n tooltip?: string | React.ComponentProps<typeof TooltipContent>\n variant?: 'navigation-item' | 'element'\n size?: SidebarSize\n }\n>(\n (\n {\n asChild = false,\n isActive = false,\n tooltip,\n className,\n children,\n variant = 'navigation-item',\n size,\n onClick,\n ...props\n },\n ref,\n ) => {\n const Comp = asChild ? Slot : 'button'\n const { isMobile, state } = useSidebar()\n const resolvedSize = useResolvedSize(size)\n const [tooltipOpen, setTooltipOpen] = React.useState(false)\n const handleClick = useCloseSheetOnLink(onClick)\n\n const button = (\n <Comp\n ref={ref}\n type={asChild ? undefined : 'button'}\n data-sidebar=\"menu-button\"\n data-active={isActive}\n className={cn(sidebarMenuButtonVariants({ variant, size: resolvedSize }), className)}\n onClick={handleClick}\n {...props}\n >\n {children}\n </Comp>\n )\n\n if (!tooltip) {\n return button\n }\n\n const {\n hidden,\n className: tooltipClassName,\n children: tooltipLabel,\n ...tooltipProps\n }: React.ComponentProps<typeof TooltipContent> = typeof tooltip === 'string' ? { children: tooltip } : tooltip\n const tooltipEnabled = state === 'collapsed' && !isMobile && !hidden\n if (!tooltipEnabled && tooltipOpen) {\n setTooltipOpen(false)\n }\n\n return (\n <TooltipRoot open={tooltipEnabled && tooltipOpen} onOpenChange={setTooltipOpen}>\n <TooltipTrigger asChild>{button}</TooltipTrigger>\n <TooltipContent\n data-sidebar=\"popover\"\n side=\"right\"\n align=\"center\"\n className={cn('px-4.25 data-[state=instant-open]:duration-0', SIDEBAR_POPOVER_SWITCH, tooltipClassName)}\n {...tooltipProps}\n >\n {typeof tooltipLabel === 'string' ? (\n <Typography variant=\"body-sm\" weight=\"semibold\" className=\"block\">\n {tooltipLabel}\n </Typography>\n ) : (\n tooltipLabel\n )}\n </TooltipContent>\n </TooltipRoot>\n )\n },\n)\nSidebarMenuButton.displayName = 'SidebarMenuButton'\n\nconst sidebarMenuActionVariants = cva(\n [\n 'text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground peer-hover/menu-button:text-sidebar-accent-foreground absolute flex aspect-square items-center justify-center rounded-md p-0 transition-[opacity,visibility,color,background-color] outline-hidden focus-visible:ring-2 after:absolute after:-inset-2 after:md:hidden group-data-[state=collapsed]:invisible group-data-[state=collapsed]:opacity-0 [&>svg]:shrink-0',\n MOTION,\n ].join(' '),\n {\n variants: {\n size: {\n small: 'top-1.5 right-1 w-5 [&>svg]:size-4',\n medium: 'top-2.5 right-1 w-5 [&>svg]:size-4',\n big: 'top-3 right-1.5 w-6 [&>svg]:size-5',\n },\n showOnHover: {\n true: 'peer-data-[active=true]/menu-button:text-sidebar-accent-foreground group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=expanded]:opacity-100 md:opacity-0',\n false: '',\n },\n },\n defaultVariants: {\n size: 'medium',\n showOnHover: false,\n },\n },\n)\n\nconst SidebarMenuAction = React.forwardRef<\n HTMLButtonElement,\n React.ComponentProps<'button'> & {\n asChild?: boolean\n showOnHover?: boolean\n size?: SidebarSize\n }\n>(({ className, asChild = false, showOnHover = false, size, ...props }, ref) => {\n const Comp = asChild ? Slot : 'button'\n const resolvedSize = useResolvedSize(size)\n\n return (\n <Comp\n ref={ref}\n type={asChild ? undefined : 'button'}\n data-sidebar=\"menu-action\"\n className={cn(sidebarMenuActionVariants({ size: resolvedSize, showOnHover }), className)}\n {...props}\n />\n )\n})\nSidebarMenuAction.displayName = 'SidebarMenuAction'\n\nconst sidebarMenuBadgeVariants = cva(\n [\n 'text-sidebar-foreground pointer-events-none absolute flex items-center justify-center rounded-md font-medium tabular-nums select-none peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground transition-[opacity,visibility] group-data-[state=collapsed]:invisible group-data-[state=collapsed]:opacity-0',\n MOTION,\n ].join(' '),\n {\n variants: {\n size: {\n small: 'top-1.5 right-1 h-5 min-w-5 px-1 text-xs',\n medium: 'top-2.5 right-1 h-5 min-w-5 px-1 text-xs',\n big: 'top-3 right-1.5 h-6 min-w-6 px-1.5 text-sm',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\nconst SidebarMenuBadge = React.forwardRef<HTMLDivElement, React.ComponentProps<'div'> & { size?: SidebarSize }>(\n ({ className, size, ...props }, ref) => {\n const resolvedSize = useResolvedSize(size)\n\n return (\n <div\n ref={ref}\n data-sidebar=\"menu-badge\"\n className={cn(sidebarMenuBadgeVariants({ size: resolvedSize }), className)}\n {...props}\n />\n )\n },\n)\nSidebarMenuBadge.displayName = 'SidebarMenuBadge'\n\nconst SIDEBAR_MENU_SKELETON: Record<SidebarSize, { row: string; icon: string }> = {\n small: { row: 'h-8 gap-2 pl-1.75 pr-2', icon: 'size-4.5' },\n medium: { row: 'h-10 gap-3 pl-2.5 pr-2', icon: 'size-5' },\n big: { row: 'h-12 gap-3 pl-3 pr-2', icon: 'size-6' },\n}\n\nconst SidebarMenuSkeleton = React.forwardRef<\n HTMLDivElement,\n React.ComponentProps<'div'> & {\n showIcon?: boolean\n size?: SidebarSize\n }\n>(({ className, showIcon = false, size, ...props }, ref) => {\n const resolvedSize = useResolvedSize(size)\n const dims = SIDEBAR_MENU_SKELETON[resolvedSize]\n\n return (\n <div\n ref={ref}\n data-sidebar=\"menu-skeleton\"\n className={cn('flex items-center overflow-hidden rounded-lg', dims.row, className)}\n {...props}\n >\n <span className=\"sr-only\">Loading</span>\n {showIcon && <Skeleton aria-hidden className={cn('shrink-0', dims.icon)} data-sidebar=\"menu-skeleton-icon\" />}\n <Skeleton aria-hidden className=\"h-4 max-w-7/10 flex-1\" data-sidebar=\"menu-skeleton-text\" />\n </div>\n )\n})\nSidebarMenuSkeleton.displayName = 'SidebarMenuSkeleton'\n\nconst sidebarMenuSubVariants = cva(\n [\n 'border-sidebar-border relative flex min-w-0 flex-col gap-1 border-l-2 pl-2 group-data-[state=collapsed]:hidden',\n 'before:bg-primary-950 before:absolute before:top-0 before:-left-0.5 before:h-(--indicator-height) before:w-0.5 before:translate-y-(--indicator-top) before:opacity-0',\n 'data-[indicator=visible]:before:opacity-100 before:transition-opacity',\n 'data-[indicator-slide=true]:before:transition-[opacity,translate,height] motion-reduce:before:transition-none',\n ].join(' '),\n {\n variants: {\n size: {\n small: 'ml-3.75',\n medium: 'ml-4.75',\n big: 'ml-5.75',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\ntype SubIndicator = { top: number; height: number; visible: boolean; slide: boolean }\n\nfunction useSubIndicator(listRef: React.RefObject<HTMLUListElement | null>) {\n const [indicator, setIndicator] = React.useState<SubIndicator | null>(null)\n\n React.useLayoutEffect(() => {\n const list = listRef.current\n if (!list) {\n return\n }\n\n const update = () => {\n const active = list.querySelector<HTMLElement>('[data-sidebar=menu-sub-button][data-active=true]')\n setIndicator((prev) => {\n if (!active) {\n return prev?.visible ? { ...prev, visible: false, slide: false } : prev\n }\n const { offsetTop: top, offsetHeight: height } = active\n if (prev?.visible && prev.top === top && prev.height === height) {\n return prev\n }\n return { top, height, visible: true, slide: Boolean(prev?.visible) }\n })\n }\n\n update()\n const mutationObserver = new MutationObserver(update)\n mutationObserver.observe(list, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: ['data-active'],\n })\n const resizeObserver = new ResizeObserver(update)\n resizeObserver.observe(list)\n return () => {\n mutationObserver.disconnect()\n resizeObserver.disconnect()\n }\n }, [listRef])\n\n return indicator\n}\n\nconst SidebarMenuSub = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'> & { size?: SidebarSize }>(\n ({ className, size, style, ...props }, ref) => {\n const resolvedSize = useResolvedSize(size)\n const listRef = React.useRef<HTMLUListElement>(null)\n React.useImperativeHandle(ref, () => listRef.current as HTMLUListElement, [])\n const indicator = useSubIndicator(listRef)\n\n return (\n <ul\n ref={listRef}\n data-sidebar=\"menu-sub\"\n data-indicator={indicator?.visible ? 'visible' : 'hidden'}\n data-indicator-slide={indicator?.slide}\n className={cn(sidebarMenuSubVariants({ size: resolvedSize }), className)}\n style={\n {\n '--indicator-top': `${indicator?.top ?? 0}px`,\n '--indicator-height': `${indicator?.height ?? 0}px`,\n ...style,\n } as React.CSSProperties\n }\n {...props}\n />\n )\n },\n)\nSidebarMenuSub.displayName = 'SidebarMenuSub'\n\nconst SidebarMenuSubItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(\n ({ className, ...props }, ref) => (\n <li\n ref={ref}\n className={cn(\n 'ring-sidebar-ring hover:bg-sidebar-accent has-[>[data-active=true]]:bg-background-200 rounded-lg transition-colors has-[>:focus-visible]:ring-2 has-[>[aria-disabled=true]]:pointer-events-none motion-reduce:transition-none',\n className,\n )}\n {...props}\n />\n ),\n)\nSidebarMenuSubItem.displayName = 'SidebarMenuSubItem'\n\nconst sidebarMenuSubButtonVariants = cva(\n [\n 'text-sidebar-foreground block w-full min-w-0 px-3 text-sm tracking-[0.035px] outline-hidden',\n 'overflow-hidden whitespace-nowrap mask-clip-content mask-origin-content',\n MARQUEE_FADE_MASK,\n 'aria-disabled:pointer-events-none aria-disabled:opacity-40 data-[active=true]:font-semibold',\n ].join(' '),\n {\n variants: {\n size: {\n small: 'h-8 leading-8',\n medium: 'h-9 leading-9',\n big: 'h-10 leading-10',\n },\n },\n defaultVariants: {\n size: 'medium',\n },\n },\n)\n\nconst SidebarMenuSubButton = React.forwardRef<\n HTMLAnchorElement,\n React.ComponentProps<'a'> & {\n asChild?: boolean\n isActive?: boolean\n size?: SidebarSize\n }\n>(({ asChild = false, isActive, className, children, size, onClick, ...props }, ref) => {\n const Comp = asChild ? Slot : 'a'\n const resolvedSize = useResolvedSize(size)\n const handleClick = useCloseSheetOnLink(onClick)\n\n return (\n <Comp\n ref={ref}\n data-sidebar=\"menu-sub-button\"\n data-active={isActive}\n className={cn(sidebarMenuSubButtonVariants({ size: resolvedSize }), className)}\n onClick={handleClick}\n {...props}\n >\n {children}\n </Comp>\n )\n})\nSidebarMenuSubButton.displayName = 'SidebarMenuSubButton'\n\nconst SIDEBAR_CHEVRON: Record<SidebarSize, string> = {\n small: 'size-4',\n medium: 'size-4',\n big: 'size-5',\n}\n\ntype SidebarMenuCollapsibleProps = Omit<React.ComponentProps<'li'>, 'children'> & {\n label: string\n icon: React.ReactNode\n isActive?: boolean\n open?: boolean\n defaultOpen?: boolean\n onOpenChange?: (open: boolean) => void\n children: React.ReactNode\n}\n\nconst SidebarMenuCollapsible = React.forwardRef<HTMLLIElement, SidebarMenuCollapsibleProps>(\n ({ label, icon, isActive = false, open: openProp, defaultOpen = false, onOpenChange, children, ...props }, ref) => {\n const { state, isMobile, size } = useSidebar()\n const isRail = state === 'collapsed' && !isMobile\n const [openState, setOpenState] = React.useState(defaultOpen)\n const [flyoutOpen, setFlyoutOpen] = React.useState(false)\n const [flyoutInstant, setFlyoutInstant] = React.useState(false)\n const triggerRef = React.useRef<HTMLButtonElement>(null)\n const titleId = React.useId()\n const sectionOpen = !isRail && (openProp ?? openState)\n\n if (!isRail && flyoutOpen) {\n setFlyoutOpen(false)\n }\n\n const handleSectionOpenChange = (value: boolean) => {\n if (openProp === undefined) {\n setOpenState(value)\n }\n onOpenChange?.(value)\n }\n\n const openFlyout = () => {\n setFlyoutInstant(document.querySelector('[data-sidebar=popover]') !== null)\n setFlyoutOpen(true)\n }\n\n const railProps = isRail\n ? {\n 'aria-haspopup': 'dialog' as const,\n 'aria-expanded': flyoutOpen,\n className: flyoutOpen ? 'bg-sidebar-accent' : undefined,\n onPointerDown: (event: React.PointerEvent) => {\n if (event.button === 0 && !event.ctrlKey) {\n event.preventDefault()\n openFlyout()\n }\n },\n onClick: (event: React.MouseEvent) => {\n event.preventDefault()\n if (event.detail === 0) {\n openFlyout()\n }\n },\n }\n : {}\n\n return (\n <SidebarMenuItem ref={ref} {...props}>\n <CollapsibleRoot open={sectionOpen} onOpenChange={handleSectionOpenChange}>\n <PopoverRoot modal open={flyoutOpen} onOpenChange={setFlyoutOpen}>\n <PopoverAnchor asChild>\n <CollapsibleTrigger asChild>\n <SidebarMenuButton\n ref={triggerRef}\n isActive={isActive}\n tooltip={{ children: label, hidden: flyoutOpen }}\n {...railProps}\n >\n {icon}\n <Typography variant=\"body-md\" weight={isActive ? 'semibold' : 'regular'} className={FADE_TEXT}>\n {label}\n </Typography>\n <CaretDownIcon\n weight=\"regular\"\n aria-hidden\n className={cn(\n 'ml-auto shrink-0 group-data-[state=open]/menu-button:rotate-180',\n SIDEBAR_CHEVRON[size],\n )}\n />\n </SidebarMenuButton>\n </CollapsibleTrigger>\n </PopoverAnchor>\n <PopoverContent\n side=\"right\"\n align=\"start\"\n sideOffset={4}\n collisionPadding={SIDEBAR_COLLISION_PADDING}\n alignOffset={SIDEBAR_FLYOUT_ALIGN_OFFSET[size]}\n data-sidebar=\"popover\"\n aria-labelledby={titleId}\n className={cn(\n SIDEBAR_FLYOUT_SURFACE,\n 'w-max max-w-(--radix-popover-content-available-width) min-w-60',\n flyoutInstant && 'data-[state=open]:duration-0',\n )}\n onClick={(event) => {\n if (event.target instanceof Element && event.target.closest('a, button')) {\n setFlyoutOpen(false)\n if (!(openProp ?? openState)) {\n handleSectionOpenChange(true)\n }\n }\n }}\n onOpenAutoFocus={(event) => {\n event.preventDefault()\n if (event.target instanceof HTMLElement) {\n const focusTarget =\n getInputModality() === 'keyboard'\n ? event.target.querySelector<HTMLElement>('a, button')\n : event.target\n focusTarget?.focus()\n }\n }}\n onCloseAutoFocus={(event) => {\n event.preventDefault()\n if (getInputModality() === 'keyboard') {\n triggerRef.current?.focus()\n }\n }}\n >\n <Typography\n id={titleId}\n variant=\"body-sm\"\n weight=\"semibold\"\n className=\"block px-3 pt-3 pb-2 text-neutral-500\"\n >\n {label}\n </Typography>\n <ul className=\"flex flex-col [&>li]:rounded-(--surface-item-radius)\">{children}</ul>\n </PopoverContent>\n </PopoverRoot>\n <CollapsibleContent\n className={cn(\n 'group/section data-[state=closed]:animate-collapsible-up data-[state=open]:animate-collapsible-down -mx-1 overflow-hidden px-1',\n MOTION,\n )}\n >\n <div className=\"pt-1 pb-0.5\">\n <SidebarMenuSub\n className={cn(\n 'group-data-[state=collapsed]:flex',\n 'group-data-[state=closed]/section:animate-out group-data-[state=closed]/section:fade-out-0 group-data-[state=open]/section:animate-in group-data-[state=open]/section:fade-in-0',\n MOTION,\n )}\n >\n {children}\n </SidebarMenuSub>\n </div>\n </CollapsibleContent>\n </CollapsibleRoot>\n </SidebarMenuItem>\n )\n },\n)\nSidebarMenuCollapsible.displayName = 'SidebarMenuCollapsible'\n\nexport {\n SidebarMenu,\n SidebarMenuAction,\n SidebarMenuBadge,\n SidebarMenuButton,\n SidebarMenuCollapsible,\n SidebarMenuItem,\n SidebarMenuSkeleton,\n SidebarMenuSub,\n SidebarMenuSubButton,\n SidebarMenuSubItem,\n sidebarMenuActionVariants,\n sidebarMenuBadgeVariants,\n sidebarMenuButtonVariants,\n sidebarMenuSubButtonVariants,\n sidebarMenuSubVariants,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAqBA,IAAA,8BAAA;CACE,OAAA;CACA,QAAA;CACA,KAAA;AACF;AAEA,IAAA,yBAAA;AAEA,IAAA,cAAA,QAAA,YAAA,EAAA,WAAA,GAAA,SAAA,QAAA,oBAAA,MAAA;CACW;CAAK,gBAAA;CAAoB,WAAA,GAAA,sCAAA,SAAA;CAAgE,GAAA;AAAY,CAAA,CAAA;AAEhH,YAAA,cAAA;AAEA,IAAA,kBAAA,QAAA,YAAA,EAAA,WAAA,GAAA,SAAA,QAAA,oBAAA,MAAA;CACW;CAAK,gBAAA;CAAyB,WAAA,GAAA,4BAAA,SAAA;CAAsD,GAAA;AAAY,CAAA,CAAA;AAE3G,gBAAA,cAAA;AAKA,IAAA,4BAAA,IAAA;CAEI;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAA,CAAA,KAAA,GAAA,GAAA;CAEE,UAAA;EACE,SAAA;GACE,mBAAA;GAEA,SAAA;EACF;EACA,MAAA;GACE,OAAA;GACA,QAAA;GACA,KAAA;EACF;CACF;CACA,iBAAA;EACE,SAAA;EACA,MAAA;CACF;AACF,CAAA;AAGF,SAAA,oBAAA,SAAA;CACE,MAAA,EAAA,UAAA,kBAAA,WAAA;CAEA,QAAA,UAAA;EACE,UAAA,KAAA;EACA,IAAA,YAAA,MAAA,yBAAA,mBAAA,cAAA,KAAA;CAGF;AACF;AAEA,IAAA,oBAAA,QAAA,YAAA,EAAA,UAAA,OAAA,WAAA,OAAA,SAAA,WAAA,UAAA,UAAA,mBAAA,MAAA,SAA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AAA;AAErB,CAAA;AAEF,uBAAA,cAAA"}
|
|
@@ -132,7 +132,7 @@ var SidebarUserMenuSeparator = React$1.forwardRef(({ className, ...props }, ref)
|
|
|
132
132
|
...props
|
|
133
133
|
}));
|
|
134
134
|
SidebarUserMenuSeparator.displayName = "SidebarUserMenuSeparator";
|
|
135
|
-
var SIDEBAR_USER_MENU_ITEM = "h-9 gap-3
|
|
135
|
+
var SIDEBAR_USER_MENU_ITEM = "h-9 gap-3 px-3 py-0 text-sm [&>svg]:size-5 transition-colors motion-reduce:transition-none hover:bg-neutral-100 focus:bg-transparent focus:hover:bg-neutral-100 data-[state=open]:bg-neutral-100 ring-sidebar-ring in-data-[input=keyboard]:focus:ring-2";
|
|
136
136
|
var SidebarUserMenuItem = React$1.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(DropdownMenuItem, {
|
|
137
137
|
ref,
|
|
138
138
|
className: cn(SIDEBAR_USER_MENU_ITEM, className),
|