@zimyo/ui 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_rollupPluginBabelHelpers.js +11 -0
- package/dist/components/index.d.ts +59 -0
- package/dist/components/ui/accordion.d.ts +9 -0
- package/dist/components/ui/accordion.js +53 -0
- package/dist/components/ui/alert-dialog.d.ts +16 -0
- package/dist/components/ui/alert-dialog.js +107 -0
- package/dist/components/ui/alert.d.ts +12 -0
- package/dist/components/ui/alert.js +53 -0
- package/dist/components/ui/aspect-ratio.d.ts +6 -0
- package/dist/components/ui/aspect-ratio.js +12 -0
- package/dist/components/ui/avatar.d.ts +8 -0
- package/dist/components/ui/avatar.js +38 -0
- package/dist/components/ui/badge.d.ts +12 -0
- package/dist/components/ui/badge.js +37 -0
- package/dist/components/ui/breadcrumb.d.ts +13 -0
- package/dist/components/ui/breadcrumb.js +90 -0
- package/dist/components/ui/button.d.ts +13 -0
- package/dist/components/ui/button.js +49 -0
- package/dist/components/ui/calendar.d.ts +12 -0
- package/dist/components/ui/calendar.js +134 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/card.js +77 -0
- package/dist/components/ui/carousel.d.ts +24 -0
- package/dist/components/ui/carousel.js +163 -0
- package/dist/components/ui/chart.d.ts +43 -0
- package/dist/components/ui/chart.js +187 -0
- package/dist/components/ui/checkbox.d.ts +6 -0
- package/dist/components/ui/checkbox.js +24 -0
- package/dist/components/ui/collapsible.d.ts +8 -0
- package/dist/components/ui/collapsible.js +24 -0
- package/dist/components/ui/command.d.ts +21 -0
- package/dist/components/ui/command.js +110 -0
- package/dist/components/ui/context-menu.d.ts +27 -0
- package/dist/components/ui/context-menu.js +158 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dialog.js +102 -0
- package/dist/components/ui/drawer.d.ts +15 -0
- package/dist/components/ui/drawer.js +97 -0
- package/dist/components/ui/dropdown-menu.d.ts +27 -0
- package/dist/components/ui/dropdown-menu.js +160 -0
- package/dist/components/ui/form.d.ts +26 -0
- package/dist/components/ui/form.js +125 -0
- package/dist/components/ui/hover-card.d.ts +8 -0
- package/dist/components/ui/hover-card.js +36 -0
- package/dist/components/ui/input-otp.d.ts +13 -0
- package/dist/components/ui/input-otp.js +61 -0
- package/dist/components/ui/input.d.ts +5 -0
- package/dist/components/ui/input.js +19 -0
- package/dist/components/ui/label.d.ts +6 -0
- package/dist/components/ui/label.js +18 -0
- package/dist/components/ui/menubar.d.ts +28 -0
- package/dist/components/ui/menubar.js +178 -0
- package/dist/components/ui/navigation-menu.d.ts +17 -0
- package/dist/components/ui/navigation-menu.js +102 -0
- package/dist/components/ui/pagination.d.ts +17 -0
- package/dist/components/ui/pagination.js +95 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/popover.js +40 -0
- package/dist/components/ui/progress.d.ts +6 -0
- package/dist/components/ui/progress.js +25 -0
- package/dist/components/ui/radio-group.d.ts +7 -0
- package/dist/components/ui/radio-group.js +34 -0
- package/dist/components/ui/resizable.d.ts +10 -0
- package/dist/components/ui/resizable.js +40 -0
- package/dist/components/ui/scroll-area.d.ts +7 -0
- package/dist/components/ui/scroll-area.js +37 -0
- package/dist/components/ui/select.d.ts +17 -0
- package/dist/components/ui/select.js +118 -0
- package/dist/components/ui/separator.d.ts +6 -0
- package/dist/components/ui/separator.js +22 -0
- package/dist/components/ui/sheet.d.ts +15 -0
- package/dist/components/ui/sheet.js +101 -0
- package/dist/components/ui/sidebar.d.ts +73 -0
- package/dist/components/ui/sidebar.js +484 -0
- package/dist/components/ui/skeleton.d.ts +5 -0
- package/dist/components/ui/skeleton.js +16 -0
- package/dist/components/ui/slider.d.ts +6 -0
- package/dist/components/ui/slider.js +39 -0
- package/dist/components/ui/sonner.d.ts +6 -0
- package/dist/components/ui/sonner.js +18 -0
- package/dist/components/ui/switch.d.ts +6 -0
- package/dist/components/ui/switch.js +21 -0
- package/dist/components/ui/table.d.ts +12 -0
- package/dist/components/ui/table.js +90 -0
- package/dist/components/ui/tabs.d.ts +9 -0
- package/dist/components/ui/tabs.js +48 -0
- package/dist/components/ui/textarea.d.ts +5 -0
- package/dist/components/ui/textarea.js +17 -0
- package/dist/components/ui/toggle-group.d.ts +10 -0
- package/dist/components/ui/toggle-group.js +52 -0
- package/dist/components/ui/toggle.d.ts +12 -0
- package/dist/components/ui/toggle.js +42 -0
- package/dist/components/ui/tooltip.d.ts +9 -0
- package/dist/components/ui/tooltip.js +45 -0
- package/dist/index.d.ts +61 -0
- package/dist/index.js +47 -0
- package/dist/lib/utils.d.ts +5 -0
- package/dist/lib/utils.js +8 -0
- package/dist/node_modules/@date-fns/tz/date/index.js +101 -0
- package/dist/node_modules/@date-fns/tz/date/mini.js +207 -0
- package/dist/node_modules/@date-fns/tz/tzOffset/index.js +43 -0
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +11 -0
- package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +39 -0
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +79 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +321 -0
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +211 -0
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +29 -0
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +207 -0
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +15 -0
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +130 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +43 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +89 -0
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +70 -0
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +18 -0
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +7 -0
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +137 -0
- package/dist/node_modules/class-variance-authority/dist/index.js +44 -0
- package/dist/node_modules/clsx/dist/clsx.js +3 -0
- package/dist/node_modules/cmdk/dist/chunk-NZJY6EH4.js +3 -0
- package/dist/node_modules/cmdk/dist/index.js +10 -0
- package/dist/node_modules/date-fns/_lib/addLeadingZeros.js +7 -0
- package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
- package/dist/node_modules/date-fns/_lib/format/formatters.js +775 -0
- package/dist/node_modules/date-fns/_lib/format/lightFormatters.js +94 -0
- package/dist/node_modules/date-fns/_lib/format/longFormatters.js +66 -0
- package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +31 -0
- package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
- package/dist/node_modules/date-fns/_lib/normalizeInterval.js +8 -0
- package/dist/node_modules/date-fns/_lib/protectedTokens.js +25 -0
- package/dist/node_modules/date-fns/addDays.js +41 -0
- package/dist/node_modules/date-fns/addMonths.js +75 -0
- package/dist/node_modules/date-fns/addWeeks.js +33 -0
- package/dist/node_modules/date-fns/addYears.js +33 -0
- package/dist/node_modules/date-fns/constants.js +46 -0
- package/dist/node_modules/date-fns/constructFrom.js +49 -0
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +62 -0
- package/dist/node_modules/date-fns/differenceInCalendarMonths.js +42 -0
- package/dist/node_modules/date-fns/eachMonthOfInterval.js +65 -0
- package/dist/node_modules/date-fns/endOfISOWeek.js +35 -0
- package/dist/node_modules/date-fns/endOfMonth.js +37 -0
- package/dist/node_modules/date-fns/endOfWeek.js +53 -0
- package/dist/node_modules/date-fns/endOfYear.js +37 -0
- package/dist/node_modules/date-fns/format.js +423 -0
- package/dist/node_modules/date-fns/getDayOfYear.js +34 -0
- package/dist/node_modules/date-fns/getDaysInMonth.js +36 -0
- package/dist/node_modules/date-fns/getISOWeek.js +40 -0
- package/dist/node_modules/date-fns/getISOWeekYear.js +52 -0
- package/dist/node_modules/date-fns/getMonth.js +29 -0
- package/dist/node_modules/date-fns/getWeek.js +54 -0
- package/dist/node_modules/date-fns/getWeekYear.js +75 -0
- package/dist/node_modules/date-fns/getYear.js +29 -0
- package/dist/node_modules/date-fns/isAfter.js +25 -0
- package/dist/node_modules/date-fns/isBefore.js +25 -0
- package/dist/node_modules/date-fns/isDate.js +41 -0
- package/dist/node_modules/date-fns/isSameDay.js +46 -0
- package/dist/node_modules/date-fns/isSameMonth.js +43 -0
- package/dist/node_modules/date-fns/isSameYear.js +35 -0
- package/dist/node_modules/date-fns/isValid.js +39 -0
- package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +10 -0
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +64 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +59 -0
- package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +22 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +103 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +41 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +13 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +189 -0
- package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +134 -0
- package/dist/node_modules/date-fns/locale/en-US.js +28 -0
- package/dist/node_modules/date-fns/max.js +49 -0
- package/dist/node_modules/date-fns/min.js +49 -0
- package/dist/node_modules/date-fns/setMonth.js +46 -0
- package/dist/node_modules/date-fns/setYear.js +40 -0
- package/dist/node_modules/date-fns/startOfDay.js +35 -0
- package/dist/node_modules/date-fns/startOfISOWeek.js +35 -0
- package/dist/node_modules/date-fns/startOfISOWeekYear.js +42 -0
- package/dist/node_modules/date-fns/startOfMonth.js +37 -0
- package/dist/node_modules/date-fns/startOfWeek.js +53 -0
- package/dist/node_modules/date-fns/startOfWeekYear.js +64 -0
- package/dist/node_modules/date-fns/startOfYear.js +36 -0
- package/dist/node_modules/date-fns/toDate.js +46 -0
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1669 -0
- package/dist/node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js +37 -0
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +38 -0
- package/dist/node_modules/get-nonce/dist/es2015/index.js +8 -0
- package/dist/node_modules/input-otp/dist/index.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/DayPicker.js +285 -0
- package/dist/node_modules/react-day-picker/dist/esm/UI.js +122 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarDay.js +30 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/classes/DateLib.js +522 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Button.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/CaptionLabel.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Chevron.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Day.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DayButton.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Dropdown.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/DropdownNav.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Footer.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Month.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthCaption.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthGrid.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Months.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Nav.js +31 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/NextMonthButton.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Option.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Root.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Select.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Week.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumber.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekday.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weekdays.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/Weeks.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/YearsDropdown.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/components/custom-components.js +26 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatCaption.js +25 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatDay.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.js +23 -0
- package/dist/node_modules/react-day-picker/dist/esm/formatters/index.js +7 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.js +73 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.js +95 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.js +22 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.js +33 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getComponents.js +20 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDates.js +51 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDays.js +19 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js +33 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.js +46 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getFormatters.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.js +28 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.js +33 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getMonths.js +69 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.js +51 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.js +39 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.js +36 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.js +37 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getWeeks.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.js +38 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.js +27 -0
- package/dist/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.js +31 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/index.js +11 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelDayButton.js +32 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGrid.js +24 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelGridcell.js +22 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNav.js +13 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelNext.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelPrevious.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.js +15 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelWeekday.js +18 -0
- package/dist/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.js +14 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useMulti.js +57 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useRange.js +45 -0
- package/dist/node_modules/react-day-picker/dist/esm/selection/useSingle.js +44 -0
- package/dist/node_modules/react-day-picker/dist/esm/useAnimation.js +175 -0
- package/dist/node_modules/react-day-picker/dist/esm/useCalendar.js +85 -0
- package/dist/node_modules/react-day-picker/dist/esm/useDayPicker.js +25 -0
- package/dist/node_modules/react-day-picker/dist/esm/useFocus.js +50 -0
- package/dist/node_modules/react-day-picker/dist/esm/useSelection.js +31 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/addToRange.js +92 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.js +62 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.js +30 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.js +74 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.js +35 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.js +21 -0
- package/dist/node_modules/react-day-picker/dist/esm/utils/typeguards.js +66 -0
- package/dist/node_modules/react-hook-form/dist/index.esm.js +507 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/Combination.js +9 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +160 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/UI.js +38 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +21 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +110 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/medium.js +5 -0
- package/dist/node_modules/react-remove-scroll/dist/es2015/sidecar.js +7 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/component.js +56 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/constants.js +10 -0
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +31 -0
- package/dist/node_modules/react-resizable-panels/dist/react-resizable-panels.js +2407 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/component.js +19 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/hook.js +25 -0
- package/dist/node_modules/react-style-singleton/dist/es2015/singleton.js +51 -0
- package/dist/node_modules/sonner/dist/index.js +1125 -0
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +2956 -0
- package/dist/node_modules/tslib/tslib.es6.js +56 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/assignRef.js +24 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +48 -0
- package/dist/node_modules/use-callback-ref/dist/es2015/useRef.js +42 -0
- package/dist/node_modules/use-sidecar/dist/es2015/exports.js +21 -0
- package/dist/node_modules/use-sidecar/dist/es2015/medium.js +77 -0
- package/dist/node_modules/vaul/dist/index.js +1627 -0
- package/dist/styles.css +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
3
|
+
import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from 'lucide-react';
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { buttonVariants, Button } from './button.js';
|
|
6
|
+
import { cn } from '../../lib/utils.js';
|
|
7
|
+
import { getDefaultClassNames } from '../../node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.js';
|
|
8
|
+
import { DayPicker } from '../../node_modules/react-day-picker/dist/esm/DayPicker.js';
|
|
9
|
+
|
|
10
|
+
function Calendar(_a) {
|
|
11
|
+
var {
|
|
12
|
+
className,
|
|
13
|
+
classNames,
|
|
14
|
+
showOutsideDays = true,
|
|
15
|
+
captionLayout = "label",
|
|
16
|
+
buttonVariant = "ghost",
|
|
17
|
+
formatters,
|
|
18
|
+
components
|
|
19
|
+
} = _a,
|
|
20
|
+
props = __rest(_a, ["className", "classNames", "showOutsideDays", "captionLayout", "buttonVariant", "formatters", "components"]);
|
|
21
|
+
const defaultClassNames = getDefaultClassNames();
|
|
22
|
+
return /*#__PURE__*/React.createElement(DayPicker, _extends({
|
|
23
|
+
showOutsideDays: showOutsideDays,
|
|
24
|
+
className: cn("bg-background group/calendar p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent", String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`, String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`, className),
|
|
25
|
+
captionLayout: captionLayout,
|
|
26
|
+
formatters: Object.assign({
|
|
27
|
+
formatMonthDropdown: date => date.toLocaleString("default", {
|
|
28
|
+
month: "short"
|
|
29
|
+
})
|
|
30
|
+
}, formatters),
|
|
31
|
+
classNames: Object.assign({
|
|
32
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
33
|
+
months: cn("relative flex flex-col gap-4 md:flex-row", defaultClassNames.months),
|
|
34
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
35
|
+
nav: cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1", defaultClassNames.nav),
|
|
36
|
+
button_previous: cn(buttonVariants({
|
|
37
|
+
variant: buttonVariant
|
|
38
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_previous),
|
|
39
|
+
button_next: cn(buttonVariants({
|
|
40
|
+
variant: buttonVariant
|
|
41
|
+
}), "size-(--cell-size) p-0 select-none aria-disabled:opacity-50", defaultClassNames.button_next),
|
|
42
|
+
month_caption: cn("flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)", defaultClassNames.month_caption),
|
|
43
|
+
dropdowns: cn("flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium", defaultClassNames.dropdowns),
|
|
44
|
+
dropdown_root: cn("has-focus:border-ring border-input has-focus:ring-ring/50 relative rounded-md border shadow-xs has-focus:ring-[3px]", defaultClassNames.dropdown_root),
|
|
45
|
+
dropdown: cn("absolute inset-0 opacity-0", defaultClassNames.dropdown),
|
|
46
|
+
caption_label: cn("font-medium select-none", captionLayout === "label" ? "text-sm" : "[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pr-1 pl-2 text-sm [&>svg]:size-3.5", defaultClassNames.caption_label),
|
|
47
|
+
table: "w-full border-collapse",
|
|
48
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
49
|
+
weekday: cn("text-muted-foreground flex-1 rounded-md text-[0.8rem] font-normal select-none", defaultClassNames.weekday),
|
|
50
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
51
|
+
week_number_header: cn("w-(--cell-size) select-none", defaultClassNames.week_number_header),
|
|
52
|
+
week_number: cn("text-muted-foreground text-[0.8rem] select-none", defaultClassNames.week_number),
|
|
53
|
+
day: cn("group/day relative aspect-square h-full w-full p-0 text-center select-none [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md", defaultClassNames.day),
|
|
54
|
+
range_start: cn("bg-accent rounded-l-md", defaultClassNames.range_start),
|
|
55
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
56
|
+
range_end: cn("bg-accent rounded-r-md", defaultClassNames.range_end),
|
|
57
|
+
today: cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none", defaultClassNames.today),
|
|
58
|
+
outside: cn("text-muted-foreground aria-selected:text-muted-foreground", defaultClassNames.outside),
|
|
59
|
+
disabled: cn("text-muted-foreground opacity-50", defaultClassNames.disabled),
|
|
60
|
+
hidden: cn("invisible", defaultClassNames.hidden)
|
|
61
|
+
}, classNames),
|
|
62
|
+
components: Object.assign({
|
|
63
|
+
Root: _a => {
|
|
64
|
+
var {
|
|
65
|
+
className,
|
|
66
|
+
rootRef
|
|
67
|
+
} = _a,
|
|
68
|
+
props = __rest(_a, ["className", "rootRef"]);
|
|
69
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
70
|
+
"data-slot": "calendar",
|
|
71
|
+
ref: rootRef,
|
|
72
|
+
className: cn(className)
|
|
73
|
+
}, props));
|
|
74
|
+
},
|
|
75
|
+
Chevron: _a => {
|
|
76
|
+
var {
|
|
77
|
+
className,
|
|
78
|
+
orientation
|
|
79
|
+
} = _a,
|
|
80
|
+
props = __rest(_a, ["className", "orientation"]);
|
|
81
|
+
if (orientation === "left") {
|
|
82
|
+
return /*#__PURE__*/React.createElement(ChevronLeftIcon, _extends({
|
|
83
|
+
className: cn("size-4", className)
|
|
84
|
+
}, props));
|
|
85
|
+
}
|
|
86
|
+
if (orientation === "right") {
|
|
87
|
+
return /*#__PURE__*/React.createElement(ChevronRightIcon, _extends({
|
|
88
|
+
className: cn("size-4", className)
|
|
89
|
+
}, props));
|
|
90
|
+
}
|
|
91
|
+
return /*#__PURE__*/React.createElement(ChevronDownIcon, _extends({
|
|
92
|
+
className: cn("size-4", className)
|
|
93
|
+
}, props));
|
|
94
|
+
},
|
|
95
|
+
DayButton: CalendarDayButton,
|
|
96
|
+
WeekNumber: _a => {
|
|
97
|
+
var {
|
|
98
|
+
children
|
|
99
|
+
} = _a,
|
|
100
|
+
props = __rest(_a, ["children"]);
|
|
101
|
+
return /*#__PURE__*/React.createElement("td", props, /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: "flex size-(--cell-size) items-center justify-center text-center"
|
|
103
|
+
}, children));
|
|
104
|
+
}
|
|
105
|
+
}, components)
|
|
106
|
+
}, props));
|
|
107
|
+
}
|
|
108
|
+
function CalendarDayButton(_a) {
|
|
109
|
+
var {
|
|
110
|
+
className,
|
|
111
|
+
day,
|
|
112
|
+
modifiers
|
|
113
|
+
} = _a,
|
|
114
|
+
props = __rest(_a, ["className", "day", "modifiers"]);
|
|
115
|
+
const defaultClassNames = getDefaultClassNames();
|
|
116
|
+
const ref = React.useRef(null);
|
|
117
|
+
React.useEffect(() => {
|
|
118
|
+
var _a;
|
|
119
|
+
if (modifiers.focused) (_a = ref.current) === null || _a === void 0 ? void 0 : _a.focus();
|
|
120
|
+
}, [modifiers.focused]);
|
|
121
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
122
|
+
ref: ref,
|
|
123
|
+
variant: "ghost",
|
|
124
|
+
size: "icon",
|
|
125
|
+
"data-day": day.date.toLocaleDateString(),
|
|
126
|
+
"data-selected-single": modifiers.selected && !modifiers.range_start && !modifiers.range_end && !modifiers.range_middle,
|
|
127
|
+
"data-range-start": modifiers.range_start,
|
|
128
|
+
"data-range-end": modifiers.range_end,
|
|
129
|
+
"data-range-middle": modifiers.range_middle,
|
|
130
|
+
className: cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 dark:hover:text-accent-foreground flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] data-[range-end=true]:rounded-md data-[range-end=true]:rounded-r-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md data-[range-start=true]:rounded-l-md [&>span]:text-xs [&>span]:opacity-70", defaultClassNames.day, className)
|
|
131
|
+
}, props));
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export { Calendar, CalendarDayButton };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
declare function Card({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
10
|
+
|
|
11
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { cn } from '../../lib/utils.js';
|
|
5
|
+
|
|
6
|
+
function Card(_a) {
|
|
7
|
+
var {
|
|
8
|
+
className
|
|
9
|
+
} = _a,
|
|
10
|
+
props = __rest(_a, ["className"]);
|
|
11
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
12
|
+
"data-slot": "card",
|
|
13
|
+
className: cn("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm", className)
|
|
14
|
+
}, props));
|
|
15
|
+
}
|
|
16
|
+
function CardHeader(_a) {
|
|
17
|
+
var {
|
|
18
|
+
className
|
|
19
|
+
} = _a,
|
|
20
|
+
props = __rest(_a, ["className"]);
|
|
21
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
22
|
+
"data-slot": "card-header",
|
|
23
|
+
className: cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6", className)
|
|
24
|
+
}, props));
|
|
25
|
+
}
|
|
26
|
+
function CardTitle(_a) {
|
|
27
|
+
var {
|
|
28
|
+
className
|
|
29
|
+
} = _a,
|
|
30
|
+
props = __rest(_a, ["className"]);
|
|
31
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
32
|
+
"data-slot": "card-title",
|
|
33
|
+
className: cn("leading-none font-semibold", className)
|
|
34
|
+
}, props));
|
|
35
|
+
}
|
|
36
|
+
function CardDescription(_a) {
|
|
37
|
+
var {
|
|
38
|
+
className
|
|
39
|
+
} = _a,
|
|
40
|
+
props = __rest(_a, ["className"]);
|
|
41
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
42
|
+
"data-slot": "card-description",
|
|
43
|
+
className: cn("text-muted-foreground text-sm", className)
|
|
44
|
+
}, props));
|
|
45
|
+
}
|
|
46
|
+
function CardAction(_a) {
|
|
47
|
+
var {
|
|
48
|
+
className
|
|
49
|
+
} = _a,
|
|
50
|
+
props = __rest(_a, ["className"]);
|
|
51
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
52
|
+
"data-slot": "card-action",
|
|
53
|
+
className: cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end", className)
|
|
54
|
+
}, props));
|
|
55
|
+
}
|
|
56
|
+
function CardContent(_a) {
|
|
57
|
+
var {
|
|
58
|
+
className
|
|
59
|
+
} = _a,
|
|
60
|
+
props = __rest(_a, ["className"]);
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
62
|
+
"data-slot": "card-content",
|
|
63
|
+
className: cn("px-6", className)
|
|
64
|
+
}, props));
|
|
65
|
+
}
|
|
66
|
+
function CardFooter(_a) {
|
|
67
|
+
var {
|
|
68
|
+
className
|
|
69
|
+
} = _a,
|
|
70
|
+
props = __rest(_a, ["className"]);
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
72
|
+
"data-slot": "card-footer",
|
|
73
|
+
className: cn("flex items-center px-6 [.border-t]:pt-6", className)
|
|
74
|
+
}, props));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import useEmblaCarousel, { UseEmblaCarouselType } from 'embla-carousel-react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { Button } from './button.js';
|
|
4
|
+
import 'class-variance-authority/dist/types';
|
|
5
|
+
import 'class-variance-authority';
|
|
6
|
+
|
|
7
|
+
type CarouselApi = UseEmblaCarouselType[1];
|
|
8
|
+
type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
|
|
9
|
+
type CarouselOptions = UseCarouselParameters[0];
|
|
10
|
+
type CarouselPlugin = UseCarouselParameters[1];
|
|
11
|
+
type CarouselProps = {
|
|
12
|
+
opts?: CarouselOptions;
|
|
13
|
+
plugins?: CarouselPlugin;
|
|
14
|
+
orientation?: "horizontal" | "vertical";
|
|
15
|
+
setApi?: (api: CarouselApi) => void;
|
|
16
|
+
};
|
|
17
|
+
declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): React.JSX.Element;
|
|
18
|
+
declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
19
|
+
declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
20
|
+
declare function CarouselPrevious({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
21
|
+
declare function CarouselNext({ className, variant, size, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
|
|
22
|
+
|
|
23
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious };
|
|
24
|
+
export type { CarouselApi };
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
3
|
+
import useEmblaCarousel from '../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js';
|
|
4
|
+
import { ArrowRight, ArrowLeft } from 'lucide-react';
|
|
5
|
+
import * as React from 'react';
|
|
6
|
+
import { Button } from './button.js';
|
|
7
|
+
import { cn } from '../../lib/utils.js';
|
|
8
|
+
|
|
9
|
+
const CarouselContext = /*#__PURE__*/React.createContext(null);
|
|
10
|
+
function useCarousel() {
|
|
11
|
+
const context = React.useContext(CarouselContext);
|
|
12
|
+
if (!context) {
|
|
13
|
+
throw new Error("useCarousel must be used within a <Carousel />");
|
|
14
|
+
}
|
|
15
|
+
return context;
|
|
16
|
+
}
|
|
17
|
+
function Carousel(_a) {
|
|
18
|
+
var {
|
|
19
|
+
orientation = "horizontal",
|
|
20
|
+
opts,
|
|
21
|
+
setApi,
|
|
22
|
+
plugins,
|
|
23
|
+
className,
|
|
24
|
+
children
|
|
25
|
+
} = _a,
|
|
26
|
+
props = __rest(_a, ["orientation", "opts", "setApi", "plugins", "className", "children"]);
|
|
27
|
+
const [carouselRef, api] = useEmblaCarousel(Object.assign(Object.assign({}, opts), {
|
|
28
|
+
axis: orientation === "horizontal" ? "x" : "y"
|
|
29
|
+
}), plugins);
|
|
30
|
+
const [canScrollPrev, setCanScrollPrev] = React.useState(false);
|
|
31
|
+
const [canScrollNext, setCanScrollNext] = React.useState(false);
|
|
32
|
+
const onSelect = React.useCallback(api => {
|
|
33
|
+
if (!api) return;
|
|
34
|
+
setCanScrollPrev(api.canScrollPrev());
|
|
35
|
+
setCanScrollNext(api.canScrollNext());
|
|
36
|
+
}, []);
|
|
37
|
+
const scrollPrev = React.useCallback(() => {
|
|
38
|
+
api === null || api === void 0 ? void 0 : api.scrollPrev();
|
|
39
|
+
}, [api]);
|
|
40
|
+
const scrollNext = React.useCallback(() => {
|
|
41
|
+
api === null || api === void 0 ? void 0 : api.scrollNext();
|
|
42
|
+
}, [api]);
|
|
43
|
+
const handleKeyDown = React.useCallback(event => {
|
|
44
|
+
if (event.key === "ArrowLeft") {
|
|
45
|
+
event.preventDefault();
|
|
46
|
+
scrollPrev();
|
|
47
|
+
} else if (event.key === "ArrowRight") {
|
|
48
|
+
event.preventDefault();
|
|
49
|
+
scrollNext();
|
|
50
|
+
}
|
|
51
|
+
}, [scrollPrev, scrollNext]);
|
|
52
|
+
React.useEffect(() => {
|
|
53
|
+
if (!api || !setApi) return;
|
|
54
|
+
setApi(api);
|
|
55
|
+
}, [api, setApi]);
|
|
56
|
+
React.useEffect(() => {
|
|
57
|
+
if (!api) return;
|
|
58
|
+
onSelect(api);
|
|
59
|
+
api.on("reInit", onSelect);
|
|
60
|
+
api.on("select", onSelect);
|
|
61
|
+
return () => {
|
|
62
|
+
api === null || api === void 0 ? void 0 : api.off("select", onSelect);
|
|
63
|
+
};
|
|
64
|
+
}, [api, onSelect]);
|
|
65
|
+
return /*#__PURE__*/React.createElement(CarouselContext.Provider, {
|
|
66
|
+
value: {
|
|
67
|
+
carouselRef,
|
|
68
|
+
api: api,
|
|
69
|
+
opts,
|
|
70
|
+
orientation: orientation || ((opts === null || opts === void 0 ? void 0 : opts.axis) === "y" ? "vertical" : "horizontal"),
|
|
71
|
+
scrollPrev,
|
|
72
|
+
scrollNext,
|
|
73
|
+
canScrollPrev,
|
|
74
|
+
canScrollNext
|
|
75
|
+
}
|
|
76
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
77
|
+
onKeyDownCapture: handleKeyDown,
|
|
78
|
+
className: cn("relative", className),
|
|
79
|
+
role: "region",
|
|
80
|
+
"aria-roledescription": "carousel",
|
|
81
|
+
"data-slot": "carousel"
|
|
82
|
+
}, props), children));
|
|
83
|
+
}
|
|
84
|
+
function CarouselContent(_a) {
|
|
85
|
+
var {
|
|
86
|
+
className
|
|
87
|
+
} = _a,
|
|
88
|
+
props = __rest(_a, ["className"]);
|
|
89
|
+
const {
|
|
90
|
+
carouselRef,
|
|
91
|
+
orientation
|
|
92
|
+
} = useCarousel();
|
|
93
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
94
|
+
ref: carouselRef,
|
|
95
|
+
className: "overflow-hidden",
|
|
96
|
+
"data-slot": "carousel-content"
|
|
97
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
98
|
+
className: cn("flex", orientation === "horizontal" ? "-ml-4" : "-mt-4 flex-col", className)
|
|
99
|
+
}, props)));
|
|
100
|
+
}
|
|
101
|
+
function CarouselItem(_a) {
|
|
102
|
+
var {
|
|
103
|
+
className
|
|
104
|
+
} = _a,
|
|
105
|
+
props = __rest(_a, ["className"]);
|
|
106
|
+
const {
|
|
107
|
+
orientation
|
|
108
|
+
} = useCarousel();
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
110
|
+
role: "group",
|
|
111
|
+
"aria-roledescription": "slide",
|
|
112
|
+
"data-slot": "carousel-item",
|
|
113
|
+
className: cn("min-w-0 shrink-0 grow-0 basis-full", orientation === "horizontal" ? "pl-4" : "pt-4", className)
|
|
114
|
+
}, props));
|
|
115
|
+
}
|
|
116
|
+
function CarouselPrevious(_a) {
|
|
117
|
+
var {
|
|
118
|
+
className,
|
|
119
|
+
variant = "outline",
|
|
120
|
+
size = "icon"
|
|
121
|
+
} = _a,
|
|
122
|
+
props = __rest(_a, ["className", "variant", "size"]);
|
|
123
|
+
const {
|
|
124
|
+
orientation,
|
|
125
|
+
scrollPrev,
|
|
126
|
+
canScrollPrev
|
|
127
|
+
} = useCarousel();
|
|
128
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
129
|
+
"data-slot": "carousel-previous",
|
|
130
|
+
variant: variant,
|
|
131
|
+
size: size,
|
|
132
|
+
className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -left-12 -translate-y-1/2" : "-top-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
133
|
+
disabled: !canScrollPrev,
|
|
134
|
+
onClick: scrollPrev
|
|
135
|
+
}, props), /*#__PURE__*/React.createElement(ArrowLeft, null), /*#__PURE__*/React.createElement("span", {
|
|
136
|
+
className: "sr-only"
|
|
137
|
+
}, "Previous slide"));
|
|
138
|
+
}
|
|
139
|
+
function CarouselNext(_a) {
|
|
140
|
+
var {
|
|
141
|
+
className,
|
|
142
|
+
variant = "outline",
|
|
143
|
+
size = "icon"
|
|
144
|
+
} = _a,
|
|
145
|
+
props = __rest(_a, ["className", "variant", "size"]);
|
|
146
|
+
const {
|
|
147
|
+
orientation,
|
|
148
|
+
scrollNext,
|
|
149
|
+
canScrollNext
|
|
150
|
+
} = useCarousel();
|
|
151
|
+
return /*#__PURE__*/React.createElement(Button, _extends({
|
|
152
|
+
"data-slot": "carousel-next",
|
|
153
|
+
variant: variant,
|
|
154
|
+
size: size,
|
|
155
|
+
className: cn("absolute size-8 rounded-full", orientation === "horizontal" ? "top-1/2 -right-12 -translate-y-1/2" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90", className),
|
|
156
|
+
disabled: !canScrollNext,
|
|
157
|
+
onClick: scrollNext
|
|
158
|
+
}, props), /*#__PURE__*/React.createElement(ArrowRight, null), /*#__PURE__*/React.createElement("span", {
|
|
159
|
+
className: "sr-only"
|
|
160
|
+
}, "Next slide"));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export { Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as RechartsPrimitive from 'recharts';
|
|
3
|
+
|
|
4
|
+
declare const THEMES: {
|
|
5
|
+
readonly light: "";
|
|
6
|
+
readonly dark: ".dark";
|
|
7
|
+
};
|
|
8
|
+
type ChartConfig = {
|
|
9
|
+
[k in string]: {
|
|
10
|
+
label?: React.ReactNode;
|
|
11
|
+
icon?: React.ComponentType;
|
|
12
|
+
} & ({
|
|
13
|
+
color?: string;
|
|
14
|
+
theme?: never;
|
|
15
|
+
} | {
|
|
16
|
+
color?: never;
|
|
17
|
+
theme: Record<keyof typeof THEMES, string>;
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
declare function ChartContainer({ id, className, children, config, ...props }: React.ComponentProps<"div"> & {
|
|
21
|
+
config: ChartConfig;
|
|
22
|
+
children: React.ComponentProps<typeof RechartsPrimitive.ResponsiveContainer>["children"];
|
|
23
|
+
}): React.JSX.Element;
|
|
24
|
+
declare const ChartStyle: ({ id, config }: {
|
|
25
|
+
id: string;
|
|
26
|
+
config: ChartConfig;
|
|
27
|
+
}) => React.JSX.Element | null;
|
|
28
|
+
declare const ChartTooltip: typeof RechartsPrimitive.Tooltip;
|
|
29
|
+
declare function ChartTooltipContent({ active, payload, className, indicator, hideLabel, hideIndicator, label, labelFormatter, labelClassName, formatter, color, nameKey, labelKey, }: React.ComponentProps<typeof RechartsPrimitive.Tooltip> & React.ComponentProps<"div"> & {
|
|
30
|
+
hideLabel?: boolean;
|
|
31
|
+
hideIndicator?: boolean;
|
|
32
|
+
indicator?: "line" | "dot" | "dashed";
|
|
33
|
+
nameKey?: string;
|
|
34
|
+
labelKey?: string;
|
|
35
|
+
}): React.JSX.Element | null;
|
|
36
|
+
declare const ChartLegend: typeof RechartsPrimitive.Legend;
|
|
37
|
+
declare function ChartLegendContent({ className, hideIcon, payload, verticalAlign, nameKey, }: React.ComponentProps<"div"> & Pick<RechartsPrimitive.LegendProps, "payload" | "verticalAlign"> & {
|
|
38
|
+
hideIcon?: boolean;
|
|
39
|
+
nameKey?: string;
|
|
40
|
+
}): React.JSX.Element | null;
|
|
41
|
+
|
|
42
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|
|
43
|
+
export type { ChartConfig };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { extends as _extends } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { __rest } from '../../node_modules/tslib/tslib.es6.js';
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import * as RechartsPrimitive from 'recharts';
|
|
5
|
+
import { cn } from '../../lib/utils.js';
|
|
6
|
+
|
|
7
|
+
// Format: { THEME_NAME: CSS_SELECTOR }
|
|
8
|
+
const THEMES = {
|
|
9
|
+
light: "",
|
|
10
|
+
dark: ".dark"
|
|
11
|
+
};
|
|
12
|
+
const ChartContext = /*#__PURE__*/React.createContext(null);
|
|
13
|
+
function useChart() {
|
|
14
|
+
const context = React.useContext(ChartContext);
|
|
15
|
+
if (!context) {
|
|
16
|
+
throw new Error("useChart must be used within a <ChartContainer />");
|
|
17
|
+
}
|
|
18
|
+
return context;
|
|
19
|
+
}
|
|
20
|
+
function ChartContainer(_a) {
|
|
21
|
+
var {
|
|
22
|
+
id,
|
|
23
|
+
className,
|
|
24
|
+
children,
|
|
25
|
+
config
|
|
26
|
+
} = _a,
|
|
27
|
+
props = __rest(_a, ["id", "className", "children", "config"]);
|
|
28
|
+
const uniqueId = React.useId();
|
|
29
|
+
const chartId = `chart-${id || uniqueId.replace(/:/g, "")}`;
|
|
30
|
+
return /*#__PURE__*/React.createElement(ChartContext.Provider, {
|
|
31
|
+
value: {
|
|
32
|
+
config
|
|
33
|
+
}
|
|
34
|
+
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
35
|
+
"data-slot": "chart",
|
|
36
|
+
"data-chart": chartId,
|
|
37
|
+
className: cn("[&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border flex aspect-video justify-center text-xs [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-hidden [&_.recharts-sector]:outline-hidden [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-surface]:outline-hidden", className)
|
|
38
|
+
}, props), /*#__PURE__*/React.createElement(ChartStyle, {
|
|
39
|
+
id: chartId,
|
|
40
|
+
config: config
|
|
41
|
+
}), /*#__PURE__*/React.createElement(RechartsPrimitive.ResponsiveContainer, null, children)));
|
|
42
|
+
}
|
|
43
|
+
const ChartStyle = ({
|
|
44
|
+
id,
|
|
45
|
+
config
|
|
46
|
+
}) => {
|
|
47
|
+
const colorConfig = Object.entries(config).filter(([, config]) => config.theme || config.color);
|
|
48
|
+
if (!colorConfig.length) {
|
|
49
|
+
return null;
|
|
50
|
+
}
|
|
51
|
+
return /*#__PURE__*/React.createElement("style", {
|
|
52
|
+
dangerouslySetInnerHTML: {
|
|
53
|
+
__html: Object.entries(THEMES).map(([theme, prefix]) => `
|
|
54
|
+
${prefix} [data-chart=${id}] {
|
|
55
|
+
${colorConfig.map(([key, itemConfig]) => {
|
|
56
|
+
var _a;
|
|
57
|
+
const color = ((_a = itemConfig.theme) === null || _a === void 0 ? void 0 : _a[theme]) || itemConfig.color;
|
|
58
|
+
return color ? ` --color-${key}: ${color};` : null;
|
|
59
|
+
}).join("\n")}
|
|
60
|
+
}
|
|
61
|
+
`).join("\n")
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
const ChartTooltip = RechartsPrimitive.Tooltip;
|
|
66
|
+
function ChartTooltipContent({
|
|
67
|
+
active,
|
|
68
|
+
payload,
|
|
69
|
+
className,
|
|
70
|
+
indicator = "dot",
|
|
71
|
+
hideLabel = false,
|
|
72
|
+
hideIndicator = false,
|
|
73
|
+
label,
|
|
74
|
+
labelFormatter,
|
|
75
|
+
labelClassName,
|
|
76
|
+
formatter,
|
|
77
|
+
color,
|
|
78
|
+
nameKey,
|
|
79
|
+
labelKey
|
|
80
|
+
}) {
|
|
81
|
+
const {
|
|
82
|
+
config
|
|
83
|
+
} = useChart();
|
|
84
|
+
const tooltipLabel = React.useMemo(() => {
|
|
85
|
+
var _a;
|
|
86
|
+
if (hideLabel || !(payload === null || payload === void 0 ? void 0 : payload.length)) {
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
89
|
+
const [item] = payload;
|
|
90
|
+
const key = `${labelKey || (item === null || item === void 0 ? void 0 : item.dataKey) || (item === null || item === void 0 ? void 0 : item.name) || "value"}`;
|
|
91
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
92
|
+
const value = !labelKey && typeof label === "string" ? ((_a = config[label]) === null || _a === void 0 ? void 0 : _a.label) || label : itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label;
|
|
93
|
+
if (labelFormatter) {
|
|
94
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: cn("font-medium", labelClassName)
|
|
96
|
+
}, labelFormatter(value, payload));
|
|
97
|
+
}
|
|
98
|
+
if (!value) {
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
102
|
+
className: cn("font-medium", labelClassName)
|
|
103
|
+
}, value);
|
|
104
|
+
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
105
|
+
if (!active || !(payload === null || payload === void 0 ? void 0 : payload.length)) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
const nestLabel = payload.length === 1 && indicator !== "dot";
|
|
109
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
|
+
className: cn("border-border/50 bg-background grid min-w-[8rem] items-start gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs shadow-xl", className)
|
|
111
|
+
}, !nestLabel ? tooltipLabel : null, /*#__PURE__*/React.createElement("div", {
|
|
112
|
+
className: "grid gap-1.5"
|
|
113
|
+
}, payload.map((item, index) => {
|
|
114
|
+
const key = `${nameKey || item.name || item.dataKey || "value"}`;
|
|
115
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
116
|
+
const indicatorColor = color || item.payload.fill || item.color;
|
|
117
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
key: item.dataKey,
|
|
119
|
+
className: cn("[&>svg]:text-muted-foreground flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5", indicator === "dot" && "items-center")
|
|
120
|
+
}, formatter && (item === null || item === void 0 ? void 0 : item.value) !== undefined && item.name ? formatter(item.value, item.name, item, index, item.payload) : /*#__PURE__*/React.createElement(React.Fragment, null, (itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.icon) ? /*#__PURE__*/React.createElement(itemConfig.icon, null) : !hideIndicator && /*#__PURE__*/React.createElement("div", {
|
|
121
|
+
className: cn("shrink-0 rounded-[2px] border-(--color-border) bg-(--color-bg)", {
|
|
122
|
+
"h-2.5 w-2.5": indicator === "dot",
|
|
123
|
+
"w-1": indicator === "line",
|
|
124
|
+
"w-0 border-[1.5px] border-dashed bg-transparent": indicator === "dashed",
|
|
125
|
+
"my-0.5": nestLabel && indicator === "dashed"
|
|
126
|
+
}),
|
|
127
|
+
style: {
|
|
128
|
+
"--color-bg": indicatorColor,
|
|
129
|
+
"--color-border": indicatorColor
|
|
130
|
+
}
|
|
131
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
132
|
+
className: cn("flex flex-1 justify-between leading-none", nestLabel ? "items-end" : "items-center")
|
|
133
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
134
|
+
className: "grid gap-1.5"
|
|
135
|
+
}, nestLabel ? tooltipLabel : null, /*#__PURE__*/React.createElement("span", {
|
|
136
|
+
className: "text-muted-foreground"
|
|
137
|
+
}, (itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label) || item.name)), item.value && /*#__PURE__*/React.createElement("span", {
|
|
138
|
+
className: "text-foreground font-mono font-medium tabular-nums"
|
|
139
|
+
}, item.value.toLocaleString()))));
|
|
140
|
+
})));
|
|
141
|
+
}
|
|
142
|
+
const ChartLegend = RechartsPrimitive.Legend;
|
|
143
|
+
function ChartLegendContent({
|
|
144
|
+
className,
|
|
145
|
+
hideIcon = false,
|
|
146
|
+
payload,
|
|
147
|
+
verticalAlign = "bottom",
|
|
148
|
+
nameKey
|
|
149
|
+
}) {
|
|
150
|
+
const {
|
|
151
|
+
config
|
|
152
|
+
} = useChart();
|
|
153
|
+
if (!(payload === null || payload === void 0 ? void 0 : payload.length)) {
|
|
154
|
+
return null;
|
|
155
|
+
}
|
|
156
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
className: cn("flex items-center justify-center gap-4", verticalAlign === "top" ? "pb-3" : "pt-3", className)
|
|
158
|
+
}, payload.map(item => {
|
|
159
|
+
const key = `${nameKey || item.dataKey || "value"}`;
|
|
160
|
+
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
161
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
162
|
+
key: item.value,
|
|
163
|
+
className: cn("[&>svg]:text-muted-foreground flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3")
|
|
164
|
+
}, (itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.icon) && !hideIcon ? /*#__PURE__*/React.createElement(itemConfig.icon, null) : /*#__PURE__*/React.createElement("div", {
|
|
165
|
+
className: "h-2 w-2 shrink-0 rounded-[2px]",
|
|
166
|
+
style: {
|
|
167
|
+
backgroundColor: item.color
|
|
168
|
+
}
|
|
169
|
+
}), itemConfig === null || itemConfig === void 0 ? void 0 : itemConfig.label);
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
// Helper to extract item config from a payload.
|
|
173
|
+
function getPayloadConfigFromPayload(config, payload, key) {
|
|
174
|
+
if (typeof payload !== "object" || payload === null) {
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
177
|
+
const payloadPayload = "payload" in payload && typeof payload.payload === "object" && payload.payload !== null ? payload.payload : undefined;
|
|
178
|
+
let configLabelKey = key;
|
|
179
|
+
if (key in payload && typeof payload[key] === "string") {
|
|
180
|
+
configLabelKey = payload[key];
|
|
181
|
+
} else if (payloadPayload && key in payloadPayload && typeof payloadPayload[key] === "string") {
|
|
182
|
+
configLabelKey = payloadPayload[key];
|
|
183
|
+
}
|
|
184
|
+
return configLabelKey in config ? config[configLabelKey] : config[key];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export { ChartContainer, ChartLegend, ChartLegendContent, ChartStyle, ChartTooltip, ChartTooltipContent };
|