@tetherto/dev-websites-core 0.2.1 → 0.3.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/README.md +81 -9
- package/dist/analytics/GtmLoader.d.mts +14 -0
- package/dist/analytics/GtmLoader.d.mts.map +1 -0
- package/dist/analytics/GtmLoader.mjs +30 -0
- package/dist/analytics/GtmLoader.mjs.map +1 -0
- package/dist/analytics/createTrackedLink.d.mts +46 -0
- package/dist/analytics/createTrackedLink.d.mts.map +1 -0
- package/dist/analytics/createTrackedLink.mjs +36 -0
- package/dist/analytics/createTrackedLink.mjs.map +1 -0
- package/dist/analytics/index.d.mts +3 -0
- package/dist/analytics/index.mjs +3 -0
- package/dist/cms/index.d.mts +2 -2
- package/dist/cms/index.mjs +2 -2
- package/dist/{cms-5bS91IRZ.mjs → cms.mjs} +2 -2
- package/dist/cms.mjs.map +1 -0
- package/dist/i18n/index.d.mts +1 -1
- package/dist/i18n/index.mjs +1 -1
- package/dist/{i18n-Dy3VrbBw.mjs → i18n.mjs} +1 -1
- package/dist/i18n.mjs.map +1 -0
- package/dist/index.d.mts +214 -6
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +6 -6
- package/dist/{index-D36IEwUg.d.mts → index2.d.mts} +1 -1
- package/dist/index2.d.mts.map +1 -0
- package/dist/{index-tTs9h9BS.d.mts → index3.d.mts} +2 -2
- package/dist/index3.d.mts.map +1 -0
- package/dist/{index-Dyi7DDoO.d.mts → index4.d.mts} +1 -1
- package/dist/index4.d.mts.map +1 -0
- package/dist/index5.d.mts +6 -0
- package/dist/{logger-BPURnavq.mjs → logger.mjs} +1 -1
- package/dist/logger.mjs.map +1 -0
- package/dist/{readMediaBuffer-1C3QTpkO.d.mts → readMediaBuffer.d.mts} +1 -1
- package/dist/readMediaBuffer.d.mts.map +1 -0
- package/dist/{readMediaBuffer-DWkTbYVn.mjs → readMediaBuffer.mjs} +2 -2
- package/dist/readMediaBuffer.mjs.map +1 -0
- package/dist/seo/index.d.mts +1 -1
- package/dist/seo/index.mjs +1 -1
- package/dist/{seo-e5XjgQ7l.mjs → seo.mjs} +3 -3
- package/dist/seo.mjs.map +1 -0
- package/dist/ui/a11y/focus.d.mts +6 -0
- package/dist/ui/a11y/focus.d.mts.map +1 -0
- package/dist/ui/a11y/focus.mjs +7 -0
- package/dist/ui/a11y/focus.mjs.map +1 -0
- package/dist/ui/a11y/index.d.mts +4 -0
- package/dist/ui/a11y/index.mjs +4 -0
- package/dist/ui/carousel/index.d.mts +3 -0
- package/dist/ui/carousel/index.mjs +3 -0
- package/dist/ui/components/Accordion/Accordion.d.mts +16 -0
- package/dist/ui/components/Accordion/Accordion.d.mts.map +1 -0
- package/dist/ui/components/Accordion/Accordion.mjs +51 -0
- package/dist/ui/components/Accordion/Accordion.mjs.map +1 -0
- package/dist/ui/components/Accordion/index.d.mts +2 -0
- package/dist/ui/components/Accordion/index.mjs +2 -0
- package/dist/ui/components/Avatar/Avatar.d.mts +9 -0
- package/dist/ui/components/Avatar/Avatar.d.mts.map +1 -0
- package/dist/ui/components/Avatar/Avatar.mjs +15 -0
- package/dist/ui/components/Avatar/Avatar.mjs.map +1 -0
- package/dist/ui/components/Avatar/index.d.mts +2 -0
- package/dist/ui/components/Avatar/index.mjs +2 -0
- package/dist/ui/components/Badge/Badge.d.mts +14 -0
- package/dist/ui/components/Badge/Badge.d.mts.map +1 -0
- package/dist/ui/components/Badge/Badge.mjs +30 -0
- package/dist/ui/components/Badge/Badge.mjs.map +1 -0
- package/dist/ui/components/Badge/index.d.mts +2 -0
- package/dist/ui/components/Badge/index.mjs +2 -0
- package/dist/ui/components/BadgeVersion/BadgeVersion.d.mts +24 -0
- package/dist/ui/components/BadgeVersion/BadgeVersion.d.mts.map +1 -0
- package/dist/ui/components/BadgeVersion/BadgeVersion.mjs +66 -0
- package/dist/ui/components/BadgeVersion/BadgeVersion.mjs.map +1 -0
- package/dist/ui/components/BadgeVersion/index.d.mts +2 -0
- package/dist/ui/components/BadgeVersion/index.mjs +2 -0
- package/dist/ui/components/Button/Button.d.mts +14 -0
- package/dist/ui/components/Button/Button.d.mts.map +1 -0
- package/dist/ui/components/Button/Button.mjs +48 -0
- package/dist/ui/components/Button/Button.mjs.map +1 -0
- package/dist/ui/components/Button/index.d.mts +2 -0
- package/dist/ui/components/Button/index.mjs +2 -0
- package/dist/ui/components/Card/Card.d.mts +14 -0
- package/dist/ui/components/Card/Card.d.mts.map +1 -0
- package/dist/ui/components/Card/Card.mjs +40 -0
- package/dist/ui/components/Card/Card.mjs.map +1 -0
- package/dist/ui/components/Card/index.d.mts +2 -0
- package/dist/ui/components/Card/index.mjs +2 -0
- package/dist/ui/components/Carousel/Carousel.d.mts +42 -0
- package/dist/ui/components/Carousel/Carousel.d.mts.map +1 -0
- package/dist/ui/components/Carousel/Carousel.mjs +164 -0
- package/dist/ui/components/Carousel/Carousel.mjs.map +1 -0
- package/dist/ui/components/Carousel/index.d.mts +2 -0
- package/dist/ui/components/Carousel/index.mjs +2 -0
- package/dist/ui/components/Checkbox/Checkbox.d.mts +8 -0
- package/dist/ui/components/Checkbox/Checkbox.d.mts.map +1 -0
- package/dist/ui/components/Checkbox/Checkbox.mjs +39 -0
- package/dist/ui/components/Checkbox/Checkbox.mjs.map +1 -0
- package/dist/ui/components/Checkbox/index.d.mts +2 -0
- package/dist/ui/components/Checkbox/index.mjs +2 -0
- package/dist/ui/components/CodeBlock/CodeBlock.d.mts +22 -0
- package/dist/ui/components/CodeBlock/CodeBlock.d.mts.map +1 -0
- package/dist/ui/components/CodeBlock/CodeBlock.mjs +66 -0
- package/dist/ui/components/CodeBlock/CodeBlock.mjs.map +1 -0
- package/dist/ui/components/CodeBlock/index.d.mts +2 -0
- package/dist/ui/components/CodeBlock/index.mjs +2 -0
- package/dist/ui/components/CodeBlockTabs/CodeBlockTabs.d.mts +19 -0
- package/dist/ui/components/CodeBlockTabs/CodeBlockTabs.d.mts.map +1 -0
- package/dist/ui/components/CodeBlockTabs/CodeBlockTabs.mjs +59 -0
- package/dist/ui/components/CodeBlockTabs/CodeBlockTabs.mjs.map +1 -0
- package/dist/ui/components/CodeBlockTabs/index.d.mts +2 -0
- package/dist/ui/components/CodeBlockTabs/index.mjs +2 -0
- package/dist/ui/components/CollapsibleSection/CollapsibleSection.d.mts +13 -0
- package/dist/ui/components/CollapsibleSection/CollapsibleSection.d.mts.map +1 -0
- package/dist/ui/components/CollapsibleSection/CollapsibleSection.mjs +55 -0
- package/dist/ui/components/CollapsibleSection/CollapsibleSection.mjs.map +1 -0
- package/dist/ui/components/CollapsibleSection/index.d.mts +2 -0
- package/dist/ui/components/CollapsibleSection/index.mjs +2 -0
- package/dist/ui/components/CopyButton/CopyButton.d.mts +12 -0
- package/dist/ui/components/CopyButton/CopyButton.d.mts.map +1 -0
- package/dist/ui/components/CopyButton/CopyButton.mjs +45 -0
- package/dist/ui/components/CopyButton/CopyButton.mjs.map +1 -0
- package/dist/ui/components/CopyButton/index.d.mts +2 -0
- package/dist/ui/components/CopyButton/index.mjs +2 -0
- package/dist/ui/components/Dialog/Dialog.d.mts +26 -0
- package/dist/ui/components/Dialog/Dialog.d.mts.map +1 -0
- package/dist/ui/components/Dialog/Dialog.mjs +79 -0
- package/dist/ui/components/Dialog/Dialog.mjs.map +1 -0
- package/dist/ui/components/Dialog/index.d.mts +2 -0
- package/dist/ui/components/Dialog/index.mjs +2 -0
- package/dist/ui/components/EmptyState/EmptyState.d.mts +18 -0
- package/dist/ui/components/EmptyState/EmptyState.d.mts.map +1 -0
- package/dist/ui/components/EmptyState/EmptyState.mjs +36 -0
- package/dist/ui/components/EmptyState/EmptyState.mjs.map +1 -0
- package/dist/ui/components/EmptyState/index.d.mts +2 -0
- package/dist/ui/components/EmptyState/index.mjs +2 -0
- package/dist/ui/components/FieldError/FieldError.d.mts +14 -0
- package/dist/ui/components/FieldError/FieldError.d.mts.map +1 -0
- package/dist/ui/components/FieldError/FieldError.mjs +19 -0
- package/dist/ui/components/FieldError/FieldError.mjs.map +1 -0
- package/dist/ui/components/FieldError/index.d.mts +2 -0
- package/dist/ui/components/FieldError/index.mjs +2 -0
- package/dist/ui/components/FormattedDate/FormattedDate.d.mts +15 -0
- package/dist/ui/components/FormattedDate/FormattedDate.d.mts.map +1 -0
- package/dist/ui/components/FormattedDate/FormattedDate.mjs +23 -0
- package/dist/ui/components/FormattedDate/FormattedDate.mjs.map +1 -0
- package/dist/ui/components/FormattedDate/index.d.mts +2 -0
- package/dist/ui/components/FormattedDate/index.mjs +2 -0
- package/dist/ui/components/IconButton/IconButton.d.mts +10 -0
- package/dist/ui/components/IconButton/IconButton.d.mts.map +1 -0
- package/dist/ui/components/IconButton/IconButton.mjs +19 -0
- package/dist/ui/components/IconButton/IconButton.mjs.map +1 -0
- package/dist/ui/components/IconButton/index.d.mts +2 -0
- package/dist/ui/components/IconButton/index.mjs +2 -0
- package/dist/ui/components/Input/Input.d.mts +12 -0
- package/dist/ui/components/Input/Input.d.mts.map +1 -0
- package/dist/ui/components/Input/Input.mjs +43 -0
- package/dist/ui/components/Input/Input.mjs.map +1 -0
- package/dist/ui/components/Input/index.d.mts +2 -0
- package/dist/ui/components/Input/index.mjs +2 -0
- package/dist/ui/components/Label/Label.d.mts +11 -0
- package/dist/ui/components/Label/Label.d.mts.map +1 -0
- package/dist/ui/components/Label/Label.mjs +18 -0
- package/dist/ui/components/Label/Label.mjs.map +1 -0
- package/dist/ui/components/Label/index.d.mts +2 -0
- package/dist/ui/components/Label/index.mjs +2 -0
- package/dist/ui/components/LazyVideo/LazyVideo.d.mts +23 -0
- package/dist/ui/components/LazyVideo/LazyVideo.d.mts.map +1 -0
- package/dist/ui/components/LazyVideo/LazyVideo.mjs +57 -0
- package/dist/ui/components/LazyVideo/LazyVideo.mjs.map +1 -0
- package/dist/ui/components/LazyVideo/index.d.mts +2 -0
- package/dist/ui/components/LazyVideo/index.mjs +2 -0
- package/dist/ui/components/Pagination/Pagination.d.mts +38 -0
- package/dist/ui/components/Pagination/Pagination.d.mts.map +1 -0
- package/dist/ui/components/Pagination/Pagination.mjs +110 -0
- package/dist/ui/components/Pagination/Pagination.mjs.map +1 -0
- package/dist/ui/components/Pagination/index.d.mts +2 -0
- package/dist/ui/components/Pagination/index.mjs +2 -0
- package/dist/ui/components/PaginationItem/PaginationItem.d.mts +15 -0
- package/dist/ui/components/PaginationItem/PaginationItem.d.mts.map +1 -0
- package/dist/ui/components/PaginationItem/PaginationItem.mjs +34 -0
- package/dist/ui/components/PaginationItem/PaginationItem.mjs.map +1 -0
- package/dist/ui/components/PaginationItem/index.d.mts +2 -0
- package/dist/ui/components/PaginationItem/index.mjs +2 -0
- package/dist/ui/components/PasswordInput/PasswordInput.d.mts +10 -0
- package/dist/ui/components/PasswordInput/PasswordInput.d.mts.map +1 -0
- package/dist/ui/components/PasswordInput/PasswordInput.mjs +39 -0
- package/dist/ui/components/PasswordInput/PasswordInput.mjs.map +1 -0
- package/dist/ui/components/PasswordInput/index.d.mts +2 -0
- package/dist/ui/components/PasswordInput/index.mjs +2 -0
- package/dist/ui/components/ProgressStepper/ProgressStepper.d.mts +20 -0
- package/dist/ui/components/ProgressStepper/ProgressStepper.d.mts.map +1 -0
- package/dist/ui/components/ProgressStepper/ProgressStepper.mjs +39 -0
- package/dist/ui/components/ProgressStepper/ProgressStepper.mjs.map +1 -0
- package/dist/ui/components/ProgressStepper/index.d.mts +2 -0
- package/dist/ui/components/ProgressStepper/index.mjs +2 -0
- package/dist/ui/components/Prose/Prose.d.mts +10 -0
- package/dist/ui/components/Prose/Prose.d.mts.map +1 -0
- package/dist/ui/components/Prose/Prose.mjs +19 -0
- package/dist/ui/components/Prose/Prose.mjs.map +1 -0
- package/dist/ui/components/Prose/index.d.mts +2 -0
- package/dist/ui/components/Prose/index.mjs +2 -0
- package/dist/ui/components/Radio/Radio.d.mts +8 -0
- package/dist/ui/components/Radio/Radio.d.mts.map +1 -0
- package/dist/ui/components/Radio/Radio.mjs +25 -0
- package/dist/ui/components/Radio/Radio.mjs.map +1 -0
- package/dist/ui/components/Radio/index.d.mts +2 -0
- package/dist/ui/components/Radio/index.mjs +2 -0
- package/dist/ui/components/Reveal/Reveal.d.mts +10 -0
- package/dist/ui/components/Reveal/Reveal.d.mts.map +1 -0
- package/dist/ui/components/Reveal/Reveal.mjs +18 -0
- package/dist/ui/components/Reveal/Reveal.mjs.map +1 -0
- package/dist/ui/components/Reveal/index.d.mts +2 -0
- package/dist/ui/components/Reveal/index.mjs +2 -0
- package/dist/ui/components/SearchInput/SearchInput.d.mts +15 -0
- package/dist/ui/components/SearchInput/SearchInput.d.mts.map +1 -0
- package/dist/ui/components/SearchInput/SearchInput.mjs +28 -0
- package/dist/ui/components/SearchInput/SearchInput.mjs.map +1 -0
- package/dist/ui/components/SearchInput/index.d.mts +2 -0
- package/dist/ui/components/SearchInput/index.mjs +2 -0
- package/dist/ui/components/Select/Select.d.mts +34 -0
- package/dist/ui/components/Select/Select.d.mts.map +1 -0
- package/dist/ui/components/Select/Select.mjs +167 -0
- package/dist/ui/components/Select/Select.mjs.map +1 -0
- package/dist/ui/components/Select/index.d.mts +2 -0
- package/dist/ui/components/Select/index.mjs +2 -0
- package/dist/ui/components/Sheet/Sheet.d.mts +19 -0
- package/dist/ui/components/Sheet/Sheet.d.mts.map +1 -0
- package/dist/ui/components/Sheet/Sheet.mjs +59 -0
- package/dist/ui/components/Sheet/Sheet.mjs.map +1 -0
- package/dist/ui/components/Sheet/index.d.mts +2 -0
- package/dist/ui/components/Sheet/index.mjs +2 -0
- package/dist/ui/components/StaggerReveal/StaggerReveal.d.mts +10 -0
- package/dist/ui/components/StaggerReveal/StaggerReveal.d.mts.map +1 -0
- package/dist/ui/components/StaggerReveal/StaggerReveal.mjs +31 -0
- package/dist/ui/components/StaggerReveal/StaggerReveal.mjs.map +1 -0
- package/dist/ui/components/StaggerReveal/index.d.mts +2 -0
- package/dist/ui/components/StaggerReveal/index.mjs +2 -0
- package/dist/ui/components/Stepper/Stepper.d.mts +15 -0
- package/dist/ui/components/Stepper/Stepper.d.mts.map +1 -0
- package/dist/ui/components/Stepper/Stepper.mjs +38 -0
- package/dist/ui/components/Stepper/Stepper.mjs.map +1 -0
- package/dist/ui/components/Stepper/index.d.mts +2 -0
- package/dist/ui/components/Stepper/index.mjs +2 -0
- package/dist/ui/components/Switch/Switch.d.mts +12 -0
- package/dist/ui/components/Switch/Switch.d.mts.map +1 -0
- package/dist/ui/components/Switch/Switch.mjs +34 -0
- package/dist/ui/components/Switch/Switch.mjs.map +1 -0
- package/dist/ui/components/Switch/index.d.mts +2 -0
- package/dist/ui/components/Switch/index.mjs +2 -0
- package/dist/ui/components/TextButton/TextButton.d.mts +9 -0
- package/dist/ui/components/TextButton/TextButton.d.mts.map +1 -0
- package/dist/ui/components/TextButton/TextButton.mjs +16 -0
- package/dist/ui/components/TextButton/TextButton.mjs.map +1 -0
- package/dist/ui/components/TextButton/index.d.mts +2 -0
- package/dist/ui/components/TextButton/index.mjs +2 -0
- package/dist/ui/components/Textarea/Textarea.d.mts +9 -0
- package/dist/ui/components/Textarea/Textarea.d.mts.map +1 -0
- package/dist/ui/components/Textarea/Textarea.mjs +27 -0
- package/dist/ui/components/Textarea/Textarea.mjs.map +1 -0
- package/dist/ui/components/Textarea/index.d.mts +2 -0
- package/dist/ui/components/Textarea/index.mjs +2 -0
- package/dist/ui/components/Toast/Toast.d.mts +20 -0
- package/dist/ui/components/Toast/Toast.d.mts.map +1 -0
- package/dist/ui/components/Toast/Toast.mjs +128 -0
- package/dist/ui/components/Toast/Toast.mjs.map +1 -0
- package/dist/ui/components/Toast/index.d.mts +2 -0
- package/dist/ui/components/Toast/index.mjs +2 -0
- package/dist/ui/components/Tooltip/Tooltip.d.mts +11 -0
- package/dist/ui/components/Tooltip/Tooltip.d.mts.map +1 -0
- package/dist/ui/components/Tooltip/Tooltip.mjs +20 -0
- package/dist/ui/components/Tooltip/Tooltip.mjs.map +1 -0
- package/dist/ui/components/Tooltip/index.d.mts +2 -0
- package/dist/ui/components/Tooltip/index.mjs +2 -0
- package/dist/ui/components/VisuallyHidden/VisuallyHidden.d.mts +7 -0
- package/dist/ui/components/VisuallyHidden/VisuallyHidden.d.mts.map +1 -0
- package/dist/ui/components/VisuallyHidden/VisuallyHidden.mjs +13 -0
- package/dist/ui/components/VisuallyHidden/VisuallyHidden.mjs.map +1 -0
- package/dist/ui/components/VisuallyHidden/index.d.mts +2 -0
- package/dist/ui/components/VisuallyHidden/index.mjs +2 -0
- package/dist/ui/hooks/index.d.mts +2 -0
- package/dist/ui/hooks/index.mjs +2 -0
- package/dist/ui/hooks/useInView.d.mts +13 -0
- package/dist/ui/hooks/useInView.d.mts.map +1 -0
- package/dist/ui/hooks/useInView.mjs +37 -0
- package/dist/ui/hooks/useInView.mjs.map +1 -0
- package/dist/ui/index.d.mts +81 -0
- package/dist/ui/index.mjs +40 -0
- package/dist/ui/theme/preset.d.mts +170 -0
- package/dist/ui/theme/preset.d.mts.map +1 -0
- package/dist/ui/theme/preset.mjs +143 -0
- package/dist/ui/theme/preset.mjs.map +1 -0
- package/dist/ui/utils/cn.d.mts +6 -0
- package/dist/ui/utils/cn.d.mts.map +1 -0
- package/dist/ui/utils/cn.mjs +42 -0
- package/dist/ui/utils/cn.mjs.map +1 -0
- package/dist/ui/utils/index.d.mts +2 -0
- package/dist/ui/utils/index.mjs +2 -0
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.mjs +2 -2
- package/dist/{utils-CVVQQltg.mjs → utils.mjs} +1 -1
- package/dist/utils.mjs.map +1 -0
- package/package.json +76 -7
- package/src/ui/theme/preset.css +53 -0
- package/src/ui/theme/preset.ts +131 -0
- package/src/ui/theme/theme.css +12 -0
- package/src/ui/theme/tokens.css +57 -0
- package/dist/cms-5bS91IRZ.mjs.map +0 -1
- package/dist/i18n-Dy3VrbBw.mjs.map +0 -1
- package/dist/index-9B8SfwdR.d.mts +0 -214
- package/dist/index-9B8SfwdR.d.mts.map +0 -1
- package/dist/index-D36IEwUg.d.mts.map +0 -1
- package/dist/index-Dyi7DDoO.d.mts.map +0 -1
- package/dist/index-tTs9h9BS.d.mts.map +0 -1
- package/dist/logger-BPURnavq.mjs.map +0 -1
- package/dist/readMediaBuffer-1C3QTpkO.d.mts.map +0 -1
- package/dist/readMediaBuffer-DWkTbYVn.mjs.map +0 -1
- package/dist/seo-e5XjgQ7l.mjs.map +0 -1
- package/dist/utils-CVVQQltg.mjs.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PaginationItem.mjs","names":[],"sources":["../../../../src/ui/components/PaginationItem/PaginationItem.tsx"],"sourcesContent":["'use client'\n\nimport { Slot } from '@radix-ui/react-slot'\n\nimport { cn } from '../../utils/cn.js'\n\nimport type { ReactNode } from 'react'\n\nexport type PaginationItemProps = {\n href?: string\n active?: boolean\n ariaLabel: string\n rel?: 'prev' | 'next'\n asChild?: boolean\n className?: string\n children: ReactNode\n}\n\nfunction PaginationItem({\n href,\n active = false,\n ariaLabel,\n rel,\n asChild = false,\n className,\n children,\n}: PaginationItemProps) {\n const cls = cn(\n 'flex size-9 items-center justify-center rounded-btn text-btn font-semibold transition-colors',\n active ? 'bg-accent text-accent-foreground' : 'border border-border bg-card text-secondary',\n href ? 'cursor-pointer hover:text-foreground' : 'cursor-not-allowed opacity-40',\n className\n )\n\n if (!href) {\n return (\n <button type=\"button\" disabled className={cls} aria-label={ariaLabel}>\n {children}\n </button>\n )\n }\n\n if (asChild) {\n return (\n <Slot\n className={cls}\n aria-label={ariaLabel}\n aria-current={active ? 'page' : undefined}\n rel={rel}\n >\n {children}\n </Slot>\n )\n }\n\n return (\n <a\n href={href}\n aria-label={ariaLabel}\n aria-current={active ? 'page' : undefined}\n rel={rel}\n className={cls}\n >\n {children}\n </a>\n )\n}\n\nexport { PaginationItem }\n"],"mappings":";;;;;AAkBA,SAAS,eAAe,EACtB,MACA,SAAS,OACT,WACA,KACA,UAAU,OACV,WACA,YACsB;CACtB,MAAM,MAAM,GACV,gGACA,SAAS,qCAAqC,+CAC9C,OAAO,yCAAyC,iCAChD,SACF;CAEA,IAAI,CAAC,MACH,OACE,oBAAC,UAAD;EAAQ,MAAK;EAAS,UAAA;EAAS,WAAW;EAAK,cAAY;EACxD;CACK,CAAA;CAIZ,IAAI,SACF,OACE,oBAAC,MAAD;EACE,WAAW;EACX,cAAY;EACZ,gBAAc,SAAS,SAAS;EAC3B;EAEJ;CACG,CAAA;CAIV,OACE,oBAAC,KAAD;EACQ;EACN,cAAY;EACZ,gBAAc,SAAS,SAAS;EAC3B;EACL,WAAW;EAEV;CACA,CAAA;AAEP"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { InputProps } from "../Input/Input.mjs";
|
|
2
|
+
//#region src/ui/components/PasswordInput/PasswordInput.d.ts
|
|
3
|
+
type PasswordInputProps = InputProps & {
|
|
4
|
+
showLabel: string;
|
|
5
|
+
hideLabel: string;
|
|
6
|
+
};
|
|
7
|
+
declare function PasswordInput({ showLabel, hideLabel, className, leftIcon, rightIcon: _rightIcon, ref, ...props }: PasswordInputProps): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { PasswordInput, PasswordInputProps };
|
|
10
|
+
//# sourceMappingURL=PasswordInput.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordInput.d.mts","names":[],"sources":["../../../../src/ui/components/PasswordInput/PasswordInput.tsx"],"mappings":";;KAQY,qBAAqB;EAC/B;EACA;;iBAGO,gBACP,WACA,WACA,WACA,UACA,WAAW,YACX,QACG,SACF,qCAAkB,IAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { Input } from "../Input/Input.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useState } from "react";
|
|
6
|
+
import { MdLockOutline, MdVisibility, MdVisibilityOff } from "react-icons/md";
|
|
7
|
+
//#region src/ui/components/PasswordInput/PasswordInput.tsx
|
|
8
|
+
function PasswordInput({ showLabel, hideLabel, className, leftIcon, rightIcon: _rightIcon, ref, ...props }) {
|
|
9
|
+
const [shown, setShown] = useState(false);
|
|
10
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
11
|
+
...props,
|
|
12
|
+
ref,
|
|
13
|
+
type: shown ? "text" : "password",
|
|
14
|
+
className: cn(className),
|
|
15
|
+
leftIcon: leftIcon ?? /* @__PURE__ */ jsx(MdLockOutline, {
|
|
16
|
+
size: 18,
|
|
17
|
+
className: "text-muted",
|
|
18
|
+
"aria-hidden": "true"
|
|
19
|
+
}),
|
|
20
|
+
rightIcon: /* @__PURE__ */ jsx("button", {
|
|
21
|
+
type: "button",
|
|
22
|
+
onClick: () => setShown((prev) => !prev),
|
|
23
|
+
"aria-label": shown ? hideLabel : showLabel,
|
|
24
|
+
"aria-pressed": shown,
|
|
25
|
+
className: cn("flex size-[18px] items-center justify-center", "text-muted transition-colors hover:text-foreground", "focus-visible:text-foreground focus-visible:outline-none"),
|
|
26
|
+
children: shown ? /* @__PURE__ */ jsx(MdVisibilityOff, {
|
|
27
|
+
size: 18,
|
|
28
|
+
"aria-hidden": "true"
|
|
29
|
+
}) : /* @__PURE__ */ jsx(MdVisibility, {
|
|
30
|
+
size: 18,
|
|
31
|
+
"aria-hidden": "true"
|
|
32
|
+
})
|
|
33
|
+
})
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { PasswordInput };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=PasswordInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PasswordInput.mjs","names":[],"sources":["../../../../src/ui/components/PasswordInput/PasswordInput.tsx"],"sourcesContent":["'use client'\n\nimport { useState } from 'react'\nimport { MdLockOutline, MdVisibility, MdVisibilityOff } from 'react-icons/md'\n\nimport { Input, type InputProps } from '../Input/Input.js'\nimport { cn } from '../../utils/cn.js'\n\nexport type PasswordInputProps = InputProps & {\n showLabel: string\n hideLabel: string\n}\n\nfunction PasswordInput({\n showLabel,\n hideLabel,\n className,\n leftIcon,\n rightIcon: _rightIcon,\n ref,\n ...props\n}: PasswordInputProps) {\n const [shown, setShown] = useState(false)\n\n return (\n <Input\n {...props}\n ref={ref}\n type={shown ? 'text' : 'password'}\n className={cn(className)}\n leftIcon={leftIcon ?? <MdLockOutline size={18} className=\"text-muted\" aria-hidden=\"true\" />}\n rightIcon={\n <button\n type=\"button\"\n onClick={() => setShown((prev) => !prev)}\n aria-label={shown ? hideLabel : showLabel}\n aria-pressed={shown}\n className={cn(\n 'flex size-[18px] items-center justify-center',\n 'text-muted transition-colors hover:text-foreground',\n 'focus-visible:text-foreground focus-visible:outline-none'\n )}\n >\n {shown ? (\n <MdVisibilityOff size={18} aria-hidden=\"true\" />\n ) : (\n <MdVisibility size={18} aria-hidden=\"true\" />\n )}\n </button>\n }\n />\n )\n}\n\nexport { PasswordInput }\n"],"mappings":";;;;;;;AAaA,SAAS,cAAc,EACrB,WACA,WACA,WACA,UACA,WAAW,YACX,KACA,GAAG,SACkB;CACrB,MAAM,CAAC,OAAO,YAAY,SAAS,KAAK;CAExC,OACE,oBAAC,OAAD;EACE,GAAI;EACC;EACL,MAAM,QAAQ,SAAS;EACvB,WAAW,GAAG,SAAS;EACvB,UAAU,YAAY,oBAAC,eAAD;GAAe,MAAM;GAAI,WAAU;GAAa,eAAY;EAAQ,CAAA;EAC1F,WACE,oBAAC,UAAD;GACE,MAAK;GACL,eAAe,UAAU,SAAS,CAAC,IAAI;GACvC,cAAY,QAAQ,YAAY;GAChC,gBAAc;GACd,WAAW,GACT,gDACA,sDACA,0DACF;GAEC,UAAA,QACC,oBAAC,iBAAD;IAAiB,MAAM;IAAI,eAAY;GAAQ,CAAA,IAE/C,oBAAC,cAAD;IAAc,MAAM;IAAI,eAAY;GAAQ,CAAA;EAExC,CAAA;CAEX,CAAA;AAEL"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/ui/components/ProgressStepper/ProgressStepper.d.ts
|
|
3
|
+
declare const segmentVariants: (props?: ({
|
|
4
|
+
complete?: boolean | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
|
+
type ProgressStepperProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
|
+
/** Accessible name for the stepper. Apps own i18n. */
|
|
8
|
+
ariaLabel: string;
|
|
9
|
+
/** Ordered step ids; `value` must match one of them. */
|
|
10
|
+
steps: string[];
|
|
11
|
+
value: string;
|
|
12
|
+
/** Optional title shown above the segments. */
|
|
13
|
+
title?: ReactNode;
|
|
14
|
+
/** Optional count text (e.g. "2 / 5"). Apps own formatting/i18n. */
|
|
15
|
+
count?: ReactNode;
|
|
16
|
+
};
|
|
17
|
+
declare function ProgressStepper({ ariaLabel, steps, value, title, count, className, ...props }: ProgressStepperProps): import("react").JSX.Element;
|
|
18
|
+
//#endregion
|
|
19
|
+
export { ProgressStepper, ProgressStepperProps, segmentVariants };
|
|
20
|
+
//# sourceMappingURL=ProgressStepper.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressStepper.d.mts","names":[],"sources":["../../../../src/ui/components/ProgressStepper/ProgressStepper.tsx"],"mappings":";;cAQa,kBAAe;;6CAU1B;KAEU,uBAAuB,eAAe;;EAEhD;;EAEA;EACA;;EAEA,QAAQ;;EAER,QAAQ;;iBAGD,kBACP,WACA,OACA,OACA,OACA,OACA,cACG,SACF,uCAAoB,IAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { cva } from "class-variance-authority";
|
|
5
|
+
//#region src/ui/components/ProgressStepper/ProgressStepper.tsx
|
|
6
|
+
const segmentVariants = cva("h-0.5 flex-1 rounded-full transition-colors", {
|
|
7
|
+
variants: { complete: {
|
|
8
|
+
true: "bg-accent",
|
|
9
|
+
false: "bg-muted"
|
|
10
|
+
} },
|
|
11
|
+
defaultVariants: { complete: false }
|
|
12
|
+
});
|
|
13
|
+
function ProgressStepper({ ariaLabel, steps, value, title, count, className, ...props }) {
|
|
14
|
+
const activeIndex = Math.max(0, steps.findIndex((step) => step === value));
|
|
15
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
16
|
+
role: "group",
|
|
17
|
+
"aria-label": ariaLabel,
|
|
18
|
+
className: cn("flex w-full flex-col gap-3", className),
|
|
19
|
+
...props,
|
|
20
|
+
children: [title || count ? /* @__PURE__ */ jsxs("div", {
|
|
21
|
+
className: "flex items-center justify-between gap-3",
|
|
22
|
+
children: [title ? /* @__PURE__ */ jsx("div", {
|
|
23
|
+
className: "text-sm font-semibold text-foreground",
|
|
24
|
+
children: title
|
|
25
|
+
}) : null, count ? /* @__PURE__ */ jsx("div", {
|
|
26
|
+
className: "text-sm text-secondary",
|
|
27
|
+
children: count
|
|
28
|
+
}) : null]
|
|
29
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
30
|
+
className: "flex w-full gap-1.5",
|
|
31
|
+
"aria-hidden": true,
|
|
32
|
+
children: steps.map((step, index) => /* @__PURE__ */ jsx("span", { className: cn(segmentVariants({ complete: index <= activeIndex })) }, step))
|
|
33
|
+
})]
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
//#endregion
|
|
37
|
+
export { ProgressStepper, segmentVariants };
|
|
38
|
+
|
|
39
|
+
//# sourceMappingURL=ProgressStepper.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProgressStepper.mjs","names":[],"sources":["../../../../src/ui/components/ProgressStepper/ProgressStepper.tsx"],"sourcesContent":["'use client'\n\nimport { cva } from 'class-variance-authority'\n\nimport { cn } from '../../utils/cn.js'\n\nimport type { HTMLAttributes, ReactNode } from 'react'\n\nexport const segmentVariants = cva('h-0.5 flex-1 rounded-full transition-colors', {\n variants: {\n complete: {\n true: 'bg-accent',\n false: 'bg-muted',\n },\n },\n defaultVariants: {\n complete: false,\n },\n})\n\nexport type ProgressStepperProps = HTMLAttributes<HTMLDivElement> & {\n /** Accessible name for the stepper. Apps own i18n. */\n ariaLabel: string\n /** Ordered step ids; `value` must match one of them. */\n steps: string[]\n value: string\n /** Optional title shown above the segments. */\n title?: ReactNode\n /** Optional count text (e.g. \"2 / 5\"). Apps own formatting/i18n. */\n count?: ReactNode\n}\n\nfunction ProgressStepper({\n ariaLabel,\n steps,\n value,\n title,\n count,\n className,\n ...props\n}: ProgressStepperProps) {\n const activeIndex = Math.max(\n 0,\n steps.findIndex((step) => step === value)\n )\n\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel}\n className={cn('flex w-full flex-col gap-3', className)}\n {...props}\n >\n {title || count ? (\n <div className=\"flex items-center justify-between gap-3\">\n {title ? <div className=\"text-sm font-semibold text-foreground\">{title}</div> : null}\n {count ? <div className=\"text-sm text-secondary\">{count}</div> : null}\n </div>\n ) : null}\n <div className=\"flex w-full gap-1.5\" aria-hidden>\n {steps.map((step, index) => (\n <span key={step} className={cn(segmentVariants({ complete: index <= activeIndex }))} />\n ))}\n </div>\n </div>\n )\n}\n\nexport { ProgressStepper }\n"],"mappings":";;;;;AAQA,MAAa,kBAAkB,IAAI,+CAA+C;CAChF,UAAU,EACR,UAAU;EACR,MAAM;EACN,OAAO;CACT,EACF;CACA,iBAAiB,EACf,UAAU,MACZ;AACF,CAAC;AAcD,SAAS,gBAAgB,EACvB,WACA,OACA,OACA,OACA,OACA,WACA,GAAG,SACoB;CACvB,MAAM,cAAc,KAAK,IACvB,GACA,MAAM,WAAW,SAAS,SAAS,KAAK,CAC1C;CAEA,OACE,qBAAC,OAAD;EACE,MAAK;EACL,cAAY;EACZ,WAAW,GAAG,8BAA8B,SAAS;EACrD,GAAI;EAJN,UAAA,CAMG,SAAS,QACR,qBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACG,QAAQ,oBAAC,OAAD;IAAK,WAAU;IAAyC,UAAA;GAAW,CAAA,IAAI,MAC/E,QAAQ,oBAAC,OAAD;IAAK,WAAU;IAA0B,UAAA;GAAW,CAAA,IAAI,IAC9D;EACH,CAAA,IAAA,MACJ,oBAAC,OAAD;GAAK,WAAU;GAAsB,eAAA;GAClC,UAAA,MAAM,KAAK,MAAM,UAChB,oBAAC,QAAD,EAAiB,WAAW,GAAG,gBAAgB,EAAE,UAAU,SAAS,YAAY,CAAC,CAAC,EAAI,GAA3E,IAA2E,CACvF;EACE,CAAA,CACF;;AAET"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HTMLAttributes, ReactNode } from "react";
|
|
2
|
+
//#region src/ui/components/Prose/Prose.d.ts
|
|
3
|
+
type ProseProps = HTMLAttributes<HTMLDivElement> & {
|
|
4
|
+
html?: string;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
};
|
|
7
|
+
declare function Prose({ className, html, children, ...rest }: ProseProps): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Prose, ProseProps };
|
|
10
|
+
//# sourceMappingURL=Prose.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prose.d.mts","names":[],"sources":["../../../../src/ui/components/Prose/Prose.tsx"],"mappings":";;KAIY,aAAa,eAAe;EACtC;EACA,WAAW;;iBAGJ,QAAQ,WAAW,MAAM,aAAa,QAAQ,6BAAU,IAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { cn } from "../../utils/cn.mjs";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
//#region src/ui/components/Prose/Prose.tsx
|
|
4
|
+
function Prose({ className, html, children, ...rest }) {
|
|
5
|
+
if (html != null) return /* @__PURE__ */ jsx("div", {
|
|
6
|
+
className: cn("prose", className),
|
|
7
|
+
dangerouslySetInnerHTML: { __html: html },
|
|
8
|
+
...rest
|
|
9
|
+
});
|
|
10
|
+
return /* @__PURE__ */ jsx("div", {
|
|
11
|
+
className: cn("prose", className),
|
|
12
|
+
...rest,
|
|
13
|
+
children
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { Prose };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=Prose.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prose.mjs","names":[],"sources":["../../../../src/ui/components/Prose/Prose.tsx"],"sourcesContent":["import { cn } from '../../utils/cn.js'\n\nimport type { HTMLAttributes, ReactNode } from 'react'\n\nexport type ProseProps = HTMLAttributes<HTMLDivElement> & {\n html?: string\n children?: ReactNode\n}\n\nfunction Prose({ className, html, children, ...rest }: ProseProps) {\n if (html != null) {\n return (\n <div\n className={cn('prose', className)}\n dangerouslySetInnerHTML={{ __html: html }}\n {...rest}\n />\n )\n }\n\n return (\n <div className={cn('prose', className)} {...rest}>\n {children}\n </div>\n )\n}\n\nexport { Prose }\n"],"mappings":";;;AASA,SAAS,MAAM,EAAE,WAAW,MAAM,UAAU,GAAG,QAAoB;CACjE,IAAI,QAAQ,MACV,OACE,oBAAC,OAAD;EACE,WAAW,GAAG,SAAS,SAAS;EAChC,yBAAyB,EAAE,QAAQ,KAAK;EACxC,GAAI;CACL,CAAA;CAIL,OACE,oBAAC,OAAD;EAAK,WAAW,GAAG,SAAS,SAAS;EAAG,GAAI;EACzC;CACE,CAAA;AAET"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
3
|
+
//#region src/ui/components/Radio/Radio.d.ts
|
|
4
|
+
type RadioProps = Omit<ComponentProps<typeof Primitive.input>, 'type'>;
|
|
5
|
+
declare function Radio({ className, ref, ...props }: RadioProps): import("react").JSX.Element;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { Radio, RadioProps };
|
|
8
|
+
//# sourceMappingURL=Radio.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.d.mts","names":[],"sources":["../../../../src/ui/components/Radio/Radio.tsx"],"mappings":";;;KASY,aAAa,KAAK,sBAAsB,UAAU;iBAErD,QAAQ,WAAW,QAAQ,SAAS,6BAAU,IAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { focusRingClassName } from "../../a11y/focus.mjs";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { Primitive } from "@radix-ui/react-primitive";
|
|
6
|
+
//#region src/ui/components/Radio/Radio.tsx
|
|
7
|
+
function Radio({ className, ref, ...props }) {
|
|
8
|
+
return /* @__PURE__ */ jsxs("span", {
|
|
9
|
+
className: "relative inline-flex shrink-0 items-center justify-center",
|
|
10
|
+
children: [/* @__PURE__ */ jsx(Primitive.input, {
|
|
11
|
+
type: "radio",
|
|
12
|
+
ref,
|
|
13
|
+
"data-slot": "radio",
|
|
14
|
+
className: cn("peer size-5 shrink-0 appearance-none rounded-full border border-border bg-surface", "cursor-pointer transition-colors", "hover:border-accent", "checked:border-2 checked:border-accent", "disabled:cursor-not-allowed disabled:opacity-50", focusRingClassName, className),
|
|
15
|
+
...props
|
|
16
|
+
}), /* @__PURE__ */ jsx("span", {
|
|
17
|
+
"aria-hidden": true,
|
|
18
|
+
className: "pointer-events-none absolute size-2 rounded-full bg-accent opacity-0 transition-opacity peer-checked:opacity-100"
|
|
19
|
+
})]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
//#endregion
|
|
23
|
+
export { Radio };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=Radio.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Radio.mjs","names":[],"sources":["../../../../src/ui/components/Radio/Radio.tsx"],"sourcesContent":["'use client'\n\nimport { Primitive } from '@radix-ui/react-primitive'\n\nimport { focusRingClassName } from '../../a11y/focus.js'\nimport { cn } from '../../utils/cn.js'\n\nimport type { ComponentProps } from 'react'\n\nexport type RadioProps = Omit<ComponentProps<typeof Primitive.input>, 'type'>\n\nfunction Radio({ className, ref, ...props }: RadioProps) {\n return (\n <span className=\"relative inline-flex shrink-0 items-center justify-center\">\n <Primitive.input\n type=\"radio\"\n ref={ref}\n data-slot=\"radio\"\n className={cn(\n 'peer size-5 shrink-0 appearance-none rounded-full border border-border bg-surface',\n 'cursor-pointer transition-colors',\n 'hover:border-accent',\n 'checked:border-2 checked:border-accent',\n 'disabled:cursor-not-allowed disabled:opacity-50',\n focusRingClassName,\n className\n )}\n {...props}\n />\n <span\n aria-hidden\n className=\"pointer-events-none absolute size-2 rounded-full bg-accent opacity-0 transition-opacity peer-checked:opacity-100\"\n />\n </span>\n )\n}\n\nexport { Radio }\n"],"mappings":";;;;;;AAWA,SAAS,MAAM,EAAE,WAAW,KAAK,GAAG,SAAqB;CACvD,OACE,qBAAC,QAAD;EAAM,WAAU;EAAhB,UAAA,CACE,oBAAC,UAAU,OAAX;GACE,MAAK;GACA;GACL,aAAU;GACV,WAAW,GACT,qFACA,oCACA,uBACA,0CACA,mDACA,oBACA,SACF;GACA,GAAI;EACL,CAAA,GACD,oBAAC,QAAD;GACE,eAAA;GACA,WAAU;EACX,CAAA,CACG;;AAEV"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
//#region src/ui/components/Reveal/Reveal.d.ts
|
|
3
|
+
type RevealProps = ComponentProps<'div'> & {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
delay?: string;
|
|
6
|
+
};
|
|
7
|
+
declare function Reveal({ asChild, delay, className, ...props }: RevealProps): import("react").JSX.Element;
|
|
8
|
+
//#endregion
|
|
9
|
+
export { Reveal, RevealProps };
|
|
10
|
+
//# sourceMappingURL=Reveal.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reveal.d.mts","names":[],"sources":["../../../../src/ui/components/Reveal/Reveal.tsx"],"mappings":";;KASY,cAAc;EACxB;EACA;;iBAGO,SAAS,SAAiB,OAAO,cAAc,SAAS,8BAAW,IAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { useInView } from "../../hooks/useInView.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Slot } from "@radix-ui/react-slot";
|
|
6
|
+
//#region src/ui/components/Reveal/Reveal.tsx
|
|
7
|
+
function Reveal({ asChild = false, delay, className, ...props }) {
|
|
8
|
+
const { ref, inView } = useInView();
|
|
9
|
+
return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
|
|
10
|
+
ref,
|
|
11
|
+
className: cn("transition-all duration-[550ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none", delay, inView ? "translate-y-0 opacity-100" : "translate-y-6 opacity-0 motion-reduce:translate-y-0 motion-reduce:opacity-100", className),
|
|
12
|
+
...props
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { Reveal };
|
|
17
|
+
|
|
18
|
+
//# sourceMappingURL=Reveal.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reveal.mjs","names":[],"sources":["../../../../src/ui/components/Reveal/Reveal.tsx"],"sourcesContent":["'use client'\n\nimport { Slot } from '@radix-ui/react-slot'\n\nimport { useInView } from '../../hooks/useInView.js'\nimport { cn } from '../../utils/cn.js'\n\nimport type { ComponentProps } from 'react'\n\nexport type RevealProps = ComponentProps<'div'> & {\n asChild?: boolean\n delay?: string\n}\n\nfunction Reveal({ asChild = false, delay, className, ...props }: RevealProps) {\n const { ref, inView } = useInView<HTMLDivElement>()\n const Comp = asChild ? Slot : 'div'\n\n return (\n <Comp\n ref={ref}\n className={cn(\n 'transition-all duration-[550ms] ease-[cubic-bezier(0.16,1,0.3,1)] motion-reduce:transition-none',\n delay,\n inView\n ? 'translate-y-0 opacity-100'\n : 'translate-y-6 opacity-0 motion-reduce:translate-y-0 motion-reduce:opacity-100',\n className\n )}\n {...props}\n />\n )\n}\n\nexport { Reveal }\n"],"mappings":";;;;;;AAcA,SAAS,OAAO,EAAE,UAAU,OAAO,OAAO,WAAW,GAAG,SAAsB;CAC5E,MAAM,EAAE,KAAK,WAAW,UAA0B;CAGlD,OACE,oBAHW,UAAU,OAAO,OAG5B;EACO;EACL,WAAW,GACT,mGACA,OACA,SACI,8BACA,iFACJ,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/ui/components/SearchInput/SearchInput.d.ts
|
|
2
|
+
type SearchInputProps = {
|
|
3
|
+
'value': string;
|
|
4
|
+
'onChange': (value: string) => void;
|
|
5
|
+
'placeholder'?: string;
|
|
6
|
+
'className'?: string;
|
|
7
|
+
'id'?: string;
|
|
8
|
+
'name'?: string;
|
|
9
|
+
'disabled'?: boolean;
|
|
10
|
+
'aria-label'?: string;
|
|
11
|
+
};
|
|
12
|
+
declare function SearchInput({ value, onChange, placeholder, className, id, name, disabled, 'aria-label': ariaLabel }: SearchInputProps): import("react").JSX.Element;
|
|
13
|
+
//#endregion
|
|
14
|
+
export { SearchInput, SearchInputProps };
|
|
15
|
+
//# sourceMappingURL=SearchInput.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.d.mts","names":[],"sources":["../../../../src/ui/components/SearchInput/SearchInput.tsx"],"mappings":";KAOY;EACV;EACA,aAAa;EACb;EACA;EACA;EACA;EACA;EACA;;iBAGO,cACP,OACA,UACA,aACA,WACA,IACA,MACA,wBACc,aACb,mCAAgB,IAAA"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { Input } from "../Input/Input.mjs";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { MdSearch } from "react-icons/md";
|
|
6
|
+
//#region src/ui/components/SearchInput/SearchInput.tsx
|
|
7
|
+
function SearchInput({ value, onChange, placeholder, className, id, name, disabled, "aria-label": ariaLabel }) {
|
|
8
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
9
|
+
id,
|
|
10
|
+
name,
|
|
11
|
+
type: "search",
|
|
12
|
+
value,
|
|
13
|
+
disabled,
|
|
14
|
+
"aria-label": ariaLabel,
|
|
15
|
+
placeholder,
|
|
16
|
+
onChange: (e) => onChange(e.target.value),
|
|
17
|
+
className: cn("font-semibold placeholder:font-normal", className),
|
|
18
|
+
leftIcon: /* @__PURE__ */ jsx(MdSearch, {
|
|
19
|
+
size: 16,
|
|
20
|
+
className: "text-muted",
|
|
21
|
+
"aria-hidden": "true"
|
|
22
|
+
})
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { SearchInput };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=SearchInput.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchInput.mjs","names":[],"sources":["../../../../src/ui/components/SearchInput/SearchInput.tsx"],"sourcesContent":["'use client'\n\nimport { MdSearch } from 'react-icons/md'\n\nimport { Input } from '../Input/Input.js'\nimport { cn } from '../../utils/cn.js'\n\nexport type SearchInputProps = {\n 'value': string\n 'onChange': (value: string) => void\n 'placeholder'?: string\n 'className'?: string\n 'id'?: string\n 'name'?: string\n 'disabled'?: boolean\n 'aria-label'?: string\n}\n\nfunction SearchInput({\n value,\n onChange,\n placeholder,\n className,\n id,\n name,\n disabled,\n 'aria-label': ariaLabel,\n}: SearchInputProps) {\n return (\n <Input\n id={id}\n name={name}\n type=\"search\"\n value={value}\n disabled={disabled}\n aria-label={ariaLabel}\n placeholder={placeholder}\n onChange={(e) => onChange(e.target.value)}\n className={cn('font-semibold placeholder:font-normal', className)}\n leftIcon={<MdSearch size={16} className=\"text-muted\" aria-hidden=\"true\" />}\n />\n )\n}\n\nexport { SearchInput }\n"],"mappings":";;;;;;AAkBA,SAAS,YAAY,EACnB,OACA,UACA,aACA,WACA,IACA,MACA,UACA,cAAc,aACK;CACnB,OACE,oBAAC,OAAD;EACM;EACE;EACN,MAAK;EACE;EACG;EACV,cAAY;EACC;EACb,WAAW,MAAM,SAAS,EAAE,OAAO,KAAK;EACxC,WAAW,GAAG,yCAAyC,SAAS;EAChE,UAAU,oBAAC,UAAD;GAAU,MAAM;GAAI,WAAU;GAAa,eAAY;EAAQ,CAAA;CAC1E,CAAA;AAEL"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
//#region src/ui/components/Select/Select.d.ts
|
|
2
|
+
type SelectOption = {
|
|
3
|
+
value: string;
|
|
4
|
+
label: string;
|
|
5
|
+
};
|
|
6
|
+
type CommonProps = {
|
|
7
|
+
'id'?: string;
|
|
8
|
+
'options': SelectOption[];
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
'disabled'?: boolean;
|
|
11
|
+
'error'?: boolean | string;
|
|
12
|
+
'className'?: string;
|
|
13
|
+
'triggerClassName'?: string;
|
|
14
|
+
};
|
|
15
|
+
type SingleProps = CommonProps & {
|
|
16
|
+
multiple?: false;
|
|
17
|
+
value: string;
|
|
18
|
+
onChange: (value: string) => void;
|
|
19
|
+
label?: string;
|
|
20
|
+
placeholder?: string;
|
|
21
|
+
};
|
|
22
|
+
type MultiProps = CommonProps & {
|
|
23
|
+
multiple: true;
|
|
24
|
+
value: string[];
|
|
25
|
+
onChange: (value: string[]) => void;
|
|
26
|
+
addLabel: string;
|
|
27
|
+
emptyLabel?: string;
|
|
28
|
+
removeChipLabel: (label: string) => string;
|
|
29
|
+
};
|
|
30
|
+
type SelectProps = SingleProps | MultiProps;
|
|
31
|
+
declare function Select(props: SelectProps): import("react").JSX.Element;
|
|
32
|
+
//#endregion
|
|
33
|
+
export { Select, SelectOption, SelectProps };
|
|
34
|
+
//# sourceMappingURL=Select.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.d.mts","names":[],"sources":["../../../../src/ui/components/Select/Select.tsx"],"mappings":";KAOY;EACV;EACA;;KAGG;EACH;EACA,WAAW;EACX;EACA;EACA;EACA;EACA;;KAGG,cAAc;EACjB;EACA;EACA,WAAW;EACX;EACA;;KAGG,aAAa;EAChB;EACA;EACA,WAAW;EACX;EACA;EACA,kBAAkB;;KAGR,cAAc,cAAc;iBAoD/B,OAAO,OAAO,8BAAW,IAAA"}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { cn } from "../../utils/cn.mjs";
|
|
3
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
|
+
import { useRef, useState } from "react";
|
|
5
|
+
import * as DropdownMenu from "@radix-ui/react-dropdown-menu";
|
|
6
|
+
//#region src/ui/components/Select/Select.tsx
|
|
7
|
+
function ChevronIcon({ className }) {
|
|
8
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
9
|
+
"aria-hidden": "true",
|
|
10
|
+
viewBox: "0 0 18 18",
|
|
11
|
+
width: "18",
|
|
12
|
+
height: "18",
|
|
13
|
+
fill: "none",
|
|
14
|
+
className,
|
|
15
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
16
|
+
d: "M4.5 6.75 9 11.25l4.5-4.5",
|
|
17
|
+
stroke: "currentColor",
|
|
18
|
+
strokeWidth: "1.5",
|
|
19
|
+
strokeLinecap: "round",
|
|
20
|
+
strokeLinejoin: "round"
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function CheckIcon() {
|
|
25
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
26
|
+
"aria-hidden": "true",
|
|
27
|
+
viewBox: "0 0 16 16",
|
|
28
|
+
width: "16",
|
|
29
|
+
height: "16",
|
|
30
|
+
fill: "none",
|
|
31
|
+
className: "shrink-0 text-accent",
|
|
32
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
33
|
+
d: "M3 8.2 6.2 11l6.5-7",
|
|
34
|
+
stroke: "currentColor",
|
|
35
|
+
strokeWidth: "1.5",
|
|
36
|
+
strokeLinecap: "round",
|
|
37
|
+
strokeLinejoin: "round"
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
function CloseIcon() {
|
|
42
|
+
return /* @__PURE__ */ jsx("svg", {
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
viewBox: "0 0 10 10",
|
|
45
|
+
width: "10",
|
|
46
|
+
height: "10",
|
|
47
|
+
fill: "none",
|
|
48
|
+
children: /* @__PURE__ */ jsx("path", {
|
|
49
|
+
d: "M2 2l6 6M8 2L2 8",
|
|
50
|
+
stroke: "currentColor",
|
|
51
|
+
strokeWidth: "1.25",
|
|
52
|
+
strokeLinecap: "round"
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
function Select(props) {
|
|
57
|
+
const { id, options, disabled, error, className, triggerClassName } = props;
|
|
58
|
+
const ariaLabel = props["aria-label"];
|
|
59
|
+
const multiContainerRef = useRef(null);
|
|
60
|
+
const [multiMenuWidth, setMultiMenuWidth] = useState();
|
|
61
|
+
const errorId = id ? `${id}-error` : void 0;
|
|
62
|
+
const hasError = Boolean(error);
|
|
63
|
+
const errorMessage = typeof error === "string" ? error : void 0;
|
|
64
|
+
const selectedSet = new Set(props.multiple ? props.value : props.value ? [props.value] : []);
|
|
65
|
+
const selectedChips = props.multiple ? props.value.map((v) => options.find((o) => o.value === v) ?? {
|
|
66
|
+
value: v,
|
|
67
|
+
label: v
|
|
68
|
+
}) : [];
|
|
69
|
+
const availableOptions = props.multiple ? options.filter((o) => !selectedSet.has(o.value)) : options;
|
|
70
|
+
const allSelected = Boolean(props.multiple && availableOptions.length === 0);
|
|
71
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
72
|
+
className: cn("flex w-full flex-col gap-1", !props.multiple && className),
|
|
73
|
+
children: [/* @__PURE__ */ jsxs(DropdownMenu.Root, {
|
|
74
|
+
modal: false,
|
|
75
|
+
onOpenChange: (open) => {
|
|
76
|
+
if (!props.multiple || !open) return;
|
|
77
|
+
const width = multiContainerRef.current?.getBoundingClientRect().width;
|
|
78
|
+
if (width) setMultiMenuWidth(width);
|
|
79
|
+
},
|
|
80
|
+
children: [props.multiple ? /* @__PURE__ */ jsxs("div", {
|
|
81
|
+
ref: multiContainerRef,
|
|
82
|
+
"data-slot": "select-multi",
|
|
83
|
+
"aria-describedby": hasError && errorId ? errorId : void 0,
|
|
84
|
+
className: cn("group/select flex w-full flex-wrap items-center gap-2 rounded-btn border border-border bg-background px-3 py-2.5 text-left transition-colors", "hover:border-accent/60", hasError && "border-destructive", disabled && "cursor-not-allowed opacity-50", className),
|
|
85
|
+
children: [selectedChips.map((option, idx) => /* @__PURE__ */ jsxs("span", {
|
|
86
|
+
"data-slot": "select-chip",
|
|
87
|
+
className: "inline-flex items-center gap-1.5 rounded-btn border border-border bg-card py-1 pr-2 pl-2.5 text-xs font-medium text-foreground",
|
|
88
|
+
children: [option.label, /* @__PURE__ */ jsx("button", {
|
|
89
|
+
type: "button",
|
|
90
|
+
"aria-label": props.removeChipLabel(option.label),
|
|
91
|
+
disabled,
|
|
92
|
+
onClick: () => {
|
|
93
|
+
if (disabled) return;
|
|
94
|
+
props.onChange(props.value.filter((_, i) => i !== idx));
|
|
95
|
+
},
|
|
96
|
+
className: "inline-flex cursor-pointer items-center justify-center text-muted transition-colors hover:text-foreground disabled:pointer-events-none",
|
|
97
|
+
children: /* @__PURE__ */ jsx(CloseIcon, {})
|
|
98
|
+
})]
|
|
99
|
+
}, `${option.value}-${idx}`)), /* @__PURE__ */ jsx(DropdownMenu.Trigger, {
|
|
100
|
+
asChild: true,
|
|
101
|
+
disabled: disabled || allSelected,
|
|
102
|
+
children: /* @__PURE__ */ jsx("button", {
|
|
103
|
+
id,
|
|
104
|
+
type: "button",
|
|
105
|
+
"data-slot": "select-multi-add",
|
|
106
|
+
"aria-label": ariaLabel,
|
|
107
|
+
className: "cursor-pointer text-sm font-normal text-muted transition-colors hover:text-foreground data-[state=open]:text-foreground focus-visible:outline-none",
|
|
108
|
+
children: allSelected && props.emptyLabel ? props.emptyLabel : props.addLabel
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
111
|
+
}) : /* @__PURE__ */ jsx(DropdownMenu.Trigger, {
|
|
112
|
+
asChild: true,
|
|
113
|
+
children: /* @__PURE__ */ jsxs("button", {
|
|
114
|
+
id,
|
|
115
|
+
type: "button",
|
|
116
|
+
disabled,
|
|
117
|
+
"aria-label": ariaLabel,
|
|
118
|
+
"aria-describedby": hasError && errorId ? errorId : void 0,
|
|
119
|
+
"data-slot": "select-trigger",
|
|
120
|
+
className: cn("group/select inline-flex h-11 w-full shrink-0 cursor-pointer items-center gap-2 rounded-btn border border-border bg-background pr-3.5 pl-4 text-left transition-colors", "hover:border-accent/60 data-[state=open]:border-accent", "focus-visible:border-accent focus-visible:outline-none", hasError && "border-destructive data-[state=open]:border-destructive", disabled && "cursor-not-allowed opacity-50", triggerClassName),
|
|
121
|
+
children: [
|
|
122
|
+
props.label ? /* @__PURE__ */ jsx("span", {
|
|
123
|
+
className: "shrink-0 text-sm text-muted",
|
|
124
|
+
children: props.label
|
|
125
|
+
}) : null,
|
|
126
|
+
/* @__PURE__ */ jsx("span", {
|
|
127
|
+
className: "flex-1 truncate text-sm font-semibold text-foreground",
|
|
128
|
+
children: options.find((o) => o.value === props.value)?.label ?? props.placeholder ?? ""
|
|
129
|
+
}),
|
|
130
|
+
/* @__PURE__ */ jsx(ChevronIcon, { className: "shrink-0 text-foreground transition-transform group-data-[state=open]/select:rotate-180" })
|
|
131
|
+
]
|
|
132
|
+
})
|
|
133
|
+
}), /* @__PURE__ */ jsx(DropdownMenu.Portal, { children: /* @__PURE__ */ jsx(DropdownMenu.Content, {
|
|
134
|
+
align: "start",
|
|
135
|
+
sideOffset: 8,
|
|
136
|
+
style: props.multiple && multiMenuWidth ? { width: multiMenuWidth } : void 0,
|
|
137
|
+
className: cn("z-50 overflow-hidden rounded-card border border-border bg-card-elevated py-1.5 shadow-lg", "focus:outline-none", !props.multiple && "w-(--radix-dropdown-menu-trigger-width)"),
|
|
138
|
+
children: availableOptions.map((option) => {
|
|
139
|
+
const isSelected = !props.multiple && props.value === option.value;
|
|
140
|
+
return /* @__PURE__ */ jsxs(DropdownMenu.Item, {
|
|
141
|
+
onSelect: (event) => {
|
|
142
|
+
if (props.multiple) {
|
|
143
|
+
event.preventDefault();
|
|
144
|
+
props.onChange([...props.value, option.value]);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
props.onChange(option.value);
|
|
148
|
+
},
|
|
149
|
+
className: cn("flex cursor-pointer items-center justify-between gap-3 px-3.5 py-2.5 text-sm font-medium text-secondary transition-colors outline-none", "data-[highlighted]:bg-card data-[highlighted]:text-foreground", isSelected && "bg-card font-semibold text-foreground"),
|
|
150
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
151
|
+
className: "truncate",
|
|
152
|
+
children: option.label
|
|
153
|
+
}), isSelected ? /* @__PURE__ */ jsx(CheckIcon, {}) : null]
|
|
154
|
+
}, option.value);
|
|
155
|
+
})
|
|
156
|
+
}) })]
|
|
157
|
+
}), errorMessage ? /* @__PURE__ */ jsx("p", {
|
|
158
|
+
id: errorId,
|
|
159
|
+
className: "text-xs text-destructive",
|
|
160
|
+
children: errorMessage
|
|
161
|
+
}) : null]
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
//#endregion
|
|
165
|
+
export { Select };
|
|
166
|
+
|
|
167
|
+
//# sourceMappingURL=Select.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Select.mjs","names":[],"sources":["../../../../src/ui/components/Select/Select.tsx"],"sourcesContent":["'use client'\n\nimport { useRef, useState } from 'react'\nimport * as DropdownMenu from '@radix-ui/react-dropdown-menu'\n\nimport { cn } from '../../utils/cn.js'\n\nexport type SelectOption = {\n value: string\n label: string\n}\n\ntype CommonProps = {\n 'id'?: string\n 'options': SelectOption[]\n 'aria-label'?: string\n 'disabled'?: boolean\n 'error'?: boolean | string\n 'className'?: string\n 'triggerClassName'?: string\n}\n\ntype SingleProps = CommonProps & {\n multiple?: false\n value: string\n onChange: (value: string) => void\n label?: string\n placeholder?: string\n}\n\ntype MultiProps = CommonProps & {\n multiple: true\n value: string[]\n onChange: (value: string[]) => void\n addLabel: string\n emptyLabel?: string\n removeChipLabel: (label: string) => string\n}\n\nexport type SelectProps = SingleProps | MultiProps\n\nfunction ChevronIcon({ className }: { className?: string }) {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 18 18\"\n width=\"18\"\n height=\"18\"\n fill=\"none\"\n className={className}\n >\n <path\n d=\"M4.5 6.75 9 11.25l4.5-4.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nfunction CheckIcon() {\n return (\n <svg\n aria-hidden=\"true\"\n viewBox=\"0 0 16 16\"\n width=\"16\"\n height=\"16\"\n fill=\"none\"\n className=\"shrink-0 text-accent\"\n >\n <path\n d=\"M3 8.2 6.2 11l6.5-7\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n )\n}\n\nfunction CloseIcon() {\n return (\n <svg aria-hidden=\"true\" viewBox=\"0 0 10 10\" width=\"10\" height=\"10\" fill=\"none\">\n <path d=\"M2 2l6 6M8 2L2 8\" stroke=\"currentColor\" strokeWidth=\"1.25\" strokeLinecap=\"round\" />\n </svg>\n )\n}\n\nfunction Select(props: SelectProps) {\n const { id, options, disabled, error, className, triggerClassName } = props\n const ariaLabel = props['aria-label']\n const multiContainerRef = useRef<HTMLDivElement>(null)\n const [multiMenuWidth, setMultiMenuWidth] = useState<number>()\n\n const errorId = id ? `${id}-error` : undefined\n const hasError = Boolean(error)\n const errorMessage = typeof error === 'string' ? error : undefined\n\n const selectedSet = new Set(props.multiple ? props.value : props.value ? [props.value] : [])\n const selectedChips = props.multiple\n ? props.value.map((v) => options.find((o) => o.value === v) ?? { value: v, label: v })\n : []\n const availableOptions = props.multiple\n ? options.filter((o) => !selectedSet.has(o.value))\n : options\n const allSelected = Boolean(props.multiple && availableOptions.length === 0)\n\n return (\n <div className={cn('flex w-full flex-col gap-1', !props.multiple && className)}>\n <DropdownMenu.Root\n modal={false}\n onOpenChange={(open) => {\n if (!props.multiple || !open) return\n const width = multiContainerRef.current?.getBoundingClientRect().width\n if (width) setMultiMenuWidth(width)\n }}\n >\n {props.multiple ? (\n <div\n ref={multiContainerRef}\n data-slot=\"select-multi\"\n aria-describedby={hasError && errorId ? errorId : undefined}\n className={cn(\n 'group/select flex w-full flex-wrap items-center gap-2 rounded-btn border border-border bg-background px-3 py-2.5 text-left transition-colors',\n 'hover:border-accent/60',\n hasError && 'border-destructive',\n disabled && 'cursor-not-allowed opacity-50',\n className\n )}\n >\n {selectedChips.map((option, idx) => (\n <span\n key={`${option.value}-${idx}`}\n data-slot=\"select-chip\"\n className=\"inline-flex items-center gap-1.5 rounded-btn border border-border bg-card py-1 pr-2 pl-2.5 text-xs font-medium text-foreground\"\n >\n {option.label}\n <button\n type=\"button\"\n aria-label={props.removeChipLabel(option.label)}\n disabled={disabled}\n onClick={() => {\n if (disabled) return\n props.onChange(props.value.filter((_, i) => i !== idx))\n }}\n className=\"inline-flex cursor-pointer items-center justify-center text-muted transition-colors hover:text-foreground disabled:pointer-events-none\"\n >\n <CloseIcon />\n </button>\n </span>\n ))}\n\n <DropdownMenu.Trigger asChild disabled={disabled || allSelected}>\n <button\n id={id}\n type=\"button\"\n data-slot=\"select-multi-add\"\n aria-label={ariaLabel}\n className=\"cursor-pointer text-sm font-normal text-muted transition-colors hover:text-foreground data-[state=open]:text-foreground focus-visible:outline-none\"\n >\n {allSelected && props.emptyLabel ? props.emptyLabel : props.addLabel}\n </button>\n </DropdownMenu.Trigger>\n </div>\n ) : (\n <DropdownMenu.Trigger asChild>\n <button\n id={id}\n type=\"button\"\n disabled={disabled}\n aria-label={ariaLabel}\n aria-describedby={hasError && errorId ? errorId : undefined}\n data-slot=\"select-trigger\"\n className={cn(\n 'group/select inline-flex h-11 w-full shrink-0 cursor-pointer items-center gap-2 rounded-btn border border-border bg-background pr-3.5 pl-4 text-left transition-colors',\n 'hover:border-accent/60 data-[state=open]:border-accent',\n 'focus-visible:border-accent focus-visible:outline-none',\n hasError && 'border-destructive data-[state=open]:border-destructive',\n disabled && 'cursor-not-allowed opacity-50',\n triggerClassName\n )}\n >\n {props.label ? (\n <span className=\"shrink-0 text-sm text-muted\">{props.label}</span>\n ) : null}\n <span className=\"flex-1 truncate text-sm font-semibold text-foreground\">\n {options.find((o) => o.value === props.value)?.label ?? props.placeholder ?? ''}\n </span>\n <ChevronIcon className=\"shrink-0 text-foreground transition-transform group-data-[state=open]/select:rotate-180\" />\n </button>\n </DropdownMenu.Trigger>\n )}\n\n <DropdownMenu.Portal>\n <DropdownMenu.Content\n align=\"start\"\n sideOffset={8}\n style={props.multiple && multiMenuWidth ? { width: multiMenuWidth } : undefined}\n className={cn(\n 'z-50 overflow-hidden rounded-card border border-border bg-card-elevated py-1.5 shadow-lg',\n 'focus:outline-none',\n !props.multiple && 'w-(--radix-dropdown-menu-trigger-width)'\n )}\n >\n {availableOptions.map((option) => {\n const isSelected = !props.multiple && props.value === option.value\n return (\n <DropdownMenu.Item\n key={option.value}\n onSelect={(event) => {\n if (props.multiple) {\n event.preventDefault()\n props.onChange([...props.value, option.value])\n return\n }\n props.onChange(option.value)\n }}\n className={cn(\n 'flex cursor-pointer items-center justify-between gap-3 px-3.5 py-2.5 text-sm font-medium text-secondary transition-colors outline-none',\n 'data-[highlighted]:bg-card data-[highlighted]:text-foreground',\n isSelected && 'bg-card font-semibold text-foreground'\n )}\n >\n <span className=\"truncate\">{option.label}</span>\n {isSelected ? <CheckIcon /> : null}\n </DropdownMenu.Item>\n )\n })}\n </DropdownMenu.Content>\n </DropdownMenu.Portal>\n </DropdownMenu.Root>\n\n {errorMessage ? (\n <p id={errorId} className=\"text-xs text-destructive\">\n {errorMessage}\n </p>\n ) : null}\n </div>\n )\n}\n\nexport { Select }\n"],"mappings":"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"}
|