@acronis-platform/ui-react 0.62.0 → 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/components/ui/alert/alert.js +115 -57
- package/dist/components/ui/alert/alert.js.map +1 -1
- package/dist/components/ui/button-group/button-group.js +57 -0
- package/dist/components/ui/button-group/button-group.js.map +1 -0
- package/dist/components/ui/button-icon-menu/button-icon-menu.js +26 -0
- package/dist/components/ui/button-icon-menu/button-icon-menu.js.map +1 -0
- package/dist/components/ui/calendar-panel/calendar-panel.js.map +1 -1
- package/dist/components/ui/chip/chip.js +33 -33
- package/dist/components/ui/chip/chip.js.map +1 -1
- package/dist/components/ui/date-range-picker/date-range-picker-utils.js +11 -23
- package/dist/components/ui/date-range-picker/date-range-picker-utils.js.map +1 -1
- package/dist/components/ui/date-range-picker/date-range-picker.js +94 -134
- package/dist/components/ui/date-range-picker/date-range-picker.js.map +1 -1
- package/dist/components/ui/dropdown-menu/dropdown-menu.js +129 -72
- package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
- package/dist/components/ui/filter-chips/filter-chips.js +44 -0
- package/dist/components/ui/filter-chips/filter-chips.js.map +1 -0
- package/dist/components/ui/filter-search/filter-search.js +184 -138
- package/dist/components/ui/filter-search/filter-search.js.map +1 -1
- package/dist/components/ui/fitted-actions/fitted-actions.js +139 -0
- package/dist/components/ui/fitted-actions/fitted-actions.js.map +1 -0
- package/dist/components/ui/input-date-picker/input-date-picker.js +103 -93
- package/dist/components/ui/input-date-picker/input-date-picker.js.map +1 -1
- package/dist/components/ui/input-password/input-password.js +76 -66
- package/dist/components/ui/input-password/input-password.js.map +1 -1
- package/dist/components/ui/input-search/input-search.js +9 -9
- package/dist/components/ui/input-search/input-search.js.map +1 -1
- package/dist/components/ui/input-select/input-select.js +8 -8
- package/dist/components/ui/input-select/input-select.js.map +1 -1
- package/dist/components/ui/input-text/input-text.js +77 -66
- package/dist/components/ui/input-text/input-text.js.map +1 -1
- package/dist/components/ui/input-text-area/input-text-area.js +76 -66
- package/dist/components/ui/input-text-area/input-text-area.js.map +1 -1
- package/dist/components/ui/link/link.js +50 -35
- package/dist/components/ui/link/link.js.map +1 -1
- package/dist/components/ui/number-field/number-field.js +1 -1
- package/dist/components/ui/number-field/number-field.js.map +1 -1
- package/dist/components/ui/popover/popover.js +75 -56
- package/dist/components/ui/popover/popover.js.map +1 -1
- package/dist/components/ui/scroll-area/scroll-area.js +46 -30
- package/dist/components/ui/scroll-area/scroll-area.js.map +1 -1
- package/dist/components/ui/timer/timer.js +47 -0
- package/dist/components/ui/timer/timer.js.map +1 -0
- package/dist/components/ui/toast/toast.js +168 -61
- package/dist/components/ui/toast/toast.js.map +1 -1
- package/dist/components/ui/truncate-text/middle-truncate.js +20 -0
- package/dist/components/ui/truncate-text/middle-truncate.js.map +1 -0
- package/dist/components/ui/truncate-text/text-width.js +12 -0
- package/dist/components/ui/truncate-text/text-width.js.map +1 -0
- package/dist/components/ui/truncate-text/truncate-text.js +152 -0
- package/dist/components/ui/truncate-text/truncate-text.js.map +1 -0
- package/dist/index.js +505 -473
- package/dist/index.js.map +1 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/addDays.js +5 -5
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/addDays.js.map +1 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/constants.js +3 -6
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/constants.js.map +1 -1
- package/dist/react.js +505 -473
- package/dist/react.js.map +1 -1
- package/dist/src/components/ui/alert/alert.d.ts +34 -3
- package/dist/src/components/ui/alert/index.d.ts +2 -2
- package/dist/src/components/ui/button/button.d.ts +1 -1
- package/dist/src/components/ui/button-group/button-group.d.ts +38 -0
- package/dist/src/components/ui/button-group/index.d.ts +1 -0
- package/dist/src/components/ui/button-icon/button-icon.d.ts +1 -1
- package/dist/src/components/ui/button-icon-menu/button-icon-menu.d.ts +28 -0
- package/dist/src/components/ui/button-icon-menu/index.d.ts +1 -0
- package/dist/src/components/ui/button-menu/button-menu.d.ts +1 -1
- package/dist/src/components/ui/calendar-panel/calendar-panel.d.ts +2 -2
- package/dist/src/components/ui/chip/chip.d.ts +1 -1
- package/dist/src/components/ui/date-range-picker/date-range-picker-utils.d.ts +10 -16
- package/dist/src/components/ui/date-range-picker/date-range-picker.d.ts +46 -2
- package/dist/src/components/ui/dropdown-menu/dropdown-menu.d.ts +8 -1
- package/dist/src/components/ui/dropdown-menu/index.d.ts +1 -1
- package/dist/src/components/ui/filter-chips/filter-chips.d.ts +25 -0
- package/dist/src/components/ui/filter-chips/index.d.ts +1 -0
- package/dist/src/components/ui/filter-search/filter-search.d.ts +39 -1
- package/dist/src/components/ui/fitted-actions/fitted-actions.d.ts +50 -0
- package/dist/src/components/ui/fitted-actions/fitted-actions.docs.d.ts +45 -0
- package/dist/src/components/ui/fitted-actions/index.d.ts +1 -0
- package/dist/src/components/ui/link/index.d.ts +1 -1
- package/dist/src/components/ui/link/link.d.ts +22 -4
- package/dist/src/components/ui/metric/metric.d.ts +1 -1
- package/dist/src/components/ui/popover/popover.d.ts +30 -1
- package/dist/src/components/ui/popover/popover.docs.d.ts +27 -2
- package/dist/src/components/ui/scroll-area/scroll-area.d.ts +24 -0
- package/dist/src/components/ui/tag/tag.d.ts +1 -1
- package/dist/src/components/ui/timer/index.d.ts +1 -0
- package/dist/src/components/ui/timer/timer.d.ts +28 -0
- package/dist/src/components/ui/toast/index.d.ts +1 -1
- package/dist/src/components/ui/toast/toast.d.ts +51 -18
- package/dist/src/components/ui/toast/toast.docs.d.ts +4 -0
- package/dist/src/components/ui/trend-indicator/trend-indicator.d.ts +1 -1
- package/dist/src/components/ui/truncate-text/__tests__/middle-truncate.test.d.ts +1 -0
- package/dist/src/components/ui/truncate-text/index.d.ts +3 -0
- package/dist/src/components/ui/truncate-text/middle-truncate.d.ts +13 -0
- package/dist/src/components/ui/truncate-text/text-width.d.ts +11 -0
- package/dist/src/components/ui/truncate-text/truncate-text.d.ts +45 -0
- package/dist/src/components/ui/truncate-text/truncate-text.docs.d.ts +35 -0
- package/dist/src/index.d.ts +6 -0
- package/dist/ui-react.css +1 -1
- package/package.json +3 -3
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/getDefaultOptions.js +0 -8
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/getDefaultOptions.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/getISODay.js +0 -9
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/getISODay.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/Parser.js +0 -23
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/Parser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/Setter.js +0 -42
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/Setter.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/constants.js +0 -50
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/constants.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js +0 -50
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/AMPMMidnightParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js +0 -50
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/AMPMParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/DateParser.js +0 -62
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/DateParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js +0 -52
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/DayOfYearParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/DayParser.js +0 -50
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/DayParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js +0 -50
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/DayPeriodParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/EraParser.js +0 -34
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/EraParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js +0 -22
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ExtendedYearParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js +0 -23
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/FractionOfSecondParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js +0 -33
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/Hour0To11Parser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js +0 -33
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/Hour0to23Parser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js +0 -34
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/Hour1To24Parser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js +0 -34
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/Hour1to12Parser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js +0 -106
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISODayParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js +0 -49
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js +0 -49
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISOTimezoneWithZParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js +0 -50
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js +0 -41
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/ISOWeekYearParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js +0 -81
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/LocalDayParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js +0 -49
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js +0 -70
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/LocalWeekYearParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js +0 -33
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/MinuteParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/MonthParser.js +0 -78
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/MonthParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js +0 -76
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/QuarterParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/SecondParser.js +0 -33
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/SecondParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js +0 -81
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/StandAloneLocalDayParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js +0 -78
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/StandAloneMonthParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js +0 -76
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/StandAloneQuarterParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js +0 -23
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/TimestampMillisecondsParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js +0 -23
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/TimestampSecondsParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/YearParser.js +0 -50
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers/YearParser.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers.js +0 -68
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/parsers.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/utils.js +0 -104
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse/_lib/utils.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse.js +0 -86
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/parse.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/setDay.js +0 -12
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/setDay.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/setISODay.js +0 -11
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/setISODay.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/setISOWeek.js +0 -10
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/setISOWeek.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/setWeek.js +0 -10
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/setWeek.js.map +0 -1
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/transpose.js +0 -18
- package/dist/node_modules/.pnpm/date-fns@4.3.0/node_modules/date-fns/transpose.js.map +0 -1
|
@@ -1,112 +1,169 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs as c, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as d from "react";
|
|
3
|
-
import { Menu as
|
|
4
|
-
import { ChevronRightIcon as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { usePortalContainer as
|
|
7
|
-
const
|
|
8
|
-
|
|
3
|
+
import { Menu as t } from "@base-ui/react/menu";
|
|
4
|
+
import { CheckIcon as N, ChevronRightIcon as M } from "@acronis-platform/icons-react/stroke-mono";
|
|
5
|
+
import { cn as i } from "../../../lib/utils.js";
|
|
6
|
+
import { usePortalContainer as D } from "../../../lib/portal-container.js";
|
|
7
|
+
const B = t.Root, E = t.Trigger, y = d.forwardRef(({ className: o, ...n }, e) => /* @__PURE__ */ r(
|
|
8
|
+
t.Group,
|
|
9
9
|
{
|
|
10
|
-
ref:
|
|
11
|
-
className:
|
|
10
|
+
ref: e,
|
|
11
|
+
className: i(
|
|
12
12
|
"flex flex-col items-start overflow-clip gap-[var(--ui-button-menu-dropdown-section-list-gap)] px-[var(--ui-button-menu-dropdown-section-container-padding-x)] py-[var(--ui-button-menu-dropdown-section-container-padding-y)] [&:not(:first-child)]:border-t [&:not(:first-child)]:border-[length:var(--ui-button-menu-dropdown-section-container-border-width)] [&:not(:first-child)]:border-[var(--ui-button-menu-dropdown-section-container-border-color)]",
|
|
13
|
-
|
|
13
|
+
o
|
|
14
14
|
),
|
|
15
|
-
...
|
|
15
|
+
...n
|
|
16
16
|
}
|
|
17
17
|
));
|
|
18
|
-
|
|
19
|
-
const
|
|
18
|
+
y.displayName = "DropdownMenuGroup";
|
|
19
|
+
const F = t.Portal, H = t.SubmenuRoot, l = "z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden flex flex-col gap-[var(--ui-button-menu-dropdown-container-gap)] bg-[var(--ui-button-menu-dropdown-container-color)] border-solid border-[length:var(--ui-button-menu-dropdown-container-border-width)] border-[var(--ui-button-menu-dropdown-container-border-color)] rounded-[var(--ui-button-menu-dropdown-container-border-radius)] px-[var(--ui-button-menu-dropdown-container-padding-x)] py-[var(--ui-button-menu-dropdown-container-padding-y)] shadow-md outline-none duration-200 data-[open]:animate-in data-[closed]:animate-out data-[open]:fade-in-0 data-[closed]:fade-out-0 data-[open]:zoom-in-95 data-[closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2", u = "relative flex w-full shrink-0 cursor-default select-none items-start gap-[var(--ui-button-menu-dropdown-item-container-gap)] min-h-[var(--ui-button-menu-dropdown-item-container-height)] px-[var(--ui-button-menu-dropdown-item-container-padding-x)] py-[var(--ui-button-menu-dropdown-item-container-padding-y)] text-sm font-semibold leading-6 outline-none transition-colors bg-[var(--ui-button-menu-dropdown-item-container-color-idle)] text-[var(--ui-button-menu-dropdown-item-label-color)] [&_svg]:text-[var(--ui-button-menu-dropdown-item-icon-color)] data-[highlighted]:bg-[var(--ui-button-menu-dropdown-item-container-color-hover)] data-[highlighted]:active:bg-[var(--ui-button-menu-dropdown-item-container-color-active)] [&:focus-visible:not(:hover)]:rounded-[3px] [&:focus-visible:not(:hover)]:ring-[3px] [&:focus-visible:not(:hover)]:ring-inset [&:focus-visible:not(:hover)]:ring-[var(--ui-focus-primary)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0", b = "flex h-6 w-4 shrink-0 items-center justify-center text-[var(--ui-button-menu-dropdown-item-icon-color)]", p = "ps-[calc(var(--ui-button-menu-dropdown-item-container-padding-x)+1rem+var(--ui-button-menu-dropdown-item-container-gap))]", R = d.forwardRef(
|
|
20
20
|
({
|
|
21
|
-
className:
|
|
22
|
-
side:
|
|
23
|
-
align:
|
|
24
|
-
sideOffset:
|
|
25
|
-
portal:
|
|
26
|
-
portalContainer:
|
|
27
|
-
keepMounted:
|
|
28
|
-
...
|
|
29
|
-
},
|
|
30
|
-
const
|
|
31
|
-
|
|
21
|
+
className: o,
|
|
22
|
+
side: n,
|
|
23
|
+
align: e,
|
|
24
|
+
sideOffset: a = 4,
|
|
25
|
+
portal: s = !0,
|
|
26
|
+
portalContainer: w,
|
|
27
|
+
keepMounted: v,
|
|
28
|
+
...f
|
|
29
|
+
}, g) => {
|
|
30
|
+
const h = D(), x = w ?? h, m = /* @__PURE__ */ r(
|
|
31
|
+
t.Positioner,
|
|
32
32
|
{
|
|
33
|
-
side:
|
|
34
|
-
align:
|
|
35
|
-
sideOffset:
|
|
33
|
+
side: n,
|
|
34
|
+
align: e,
|
|
35
|
+
sideOffset: a,
|
|
36
36
|
className: "z-50",
|
|
37
37
|
children: /* @__PURE__ */ r(
|
|
38
|
-
|
|
38
|
+
t.Popup,
|
|
39
39
|
{
|
|
40
|
-
ref:
|
|
41
|
-
className:
|
|
42
|
-
...
|
|
40
|
+
ref: g,
|
|
41
|
+
className: i(l, o),
|
|
42
|
+
...f
|
|
43
43
|
}
|
|
44
44
|
)
|
|
45
45
|
}
|
|
46
46
|
);
|
|
47
|
-
return
|
|
47
|
+
return s ? /* @__PURE__ */ r(t.Portal, { container: x, keepMounted: v, children: m }) : m;
|
|
48
48
|
}
|
|
49
49
|
);
|
|
50
|
-
|
|
51
|
-
const
|
|
52
|
-
|
|
50
|
+
R.displayName = "DropdownMenuContent";
|
|
51
|
+
const C = d.forwardRef(({ className: o, sideOffset: n = 4, ...e }, a) => /* @__PURE__ */ r(t.Positioner, { sideOffset: n, className: "z-50", children: /* @__PURE__ */ r(
|
|
52
|
+
t.Popup,
|
|
53
53
|
{
|
|
54
|
-
ref:
|
|
55
|
-
className:
|
|
56
|
-
...
|
|
54
|
+
ref: a,
|
|
55
|
+
className: i(l, o),
|
|
56
|
+
...e
|
|
57
57
|
}
|
|
58
58
|
) }));
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
59
|
+
C.displayName = "DropdownMenuSubContent";
|
|
60
|
+
const I = d.forwardRef(({ className: o, inset: n, ...e }, a) => /* @__PURE__ */ r(
|
|
61
|
+
t.Item,
|
|
62
62
|
{
|
|
63
|
-
ref:
|
|
64
|
-
className:
|
|
65
|
-
...
|
|
63
|
+
ref: a,
|
|
64
|
+
className: i(u, n && p, o),
|
|
65
|
+
...e
|
|
66
66
|
}
|
|
67
67
|
));
|
|
68
|
-
|
|
69
|
-
const
|
|
70
|
-
|
|
68
|
+
I.displayName = "DropdownMenuItem";
|
|
69
|
+
const S = d.forwardRef(({ className: o, inset: n, children: e, ...a }, s) => /* @__PURE__ */ c(
|
|
70
|
+
t.SubmenuTrigger,
|
|
71
71
|
{
|
|
72
|
-
ref:
|
|
73
|
-
className:
|
|
74
|
-
|
|
72
|
+
ref: s,
|
|
73
|
+
className: i(
|
|
74
|
+
u,
|
|
75
75
|
"data-[popup-open]:bg-[var(--ui-button-menu-dropdown-item-container-color-active)]",
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
n && p,
|
|
77
|
+
o
|
|
78
78
|
),
|
|
79
|
-
...
|
|
79
|
+
...a,
|
|
80
80
|
children: [
|
|
81
|
-
|
|
82
|
-
/* @__PURE__ */ r(
|
|
81
|
+
e,
|
|
82
|
+
/* @__PURE__ */ r(M, { className: "ms-auto self-center text-[var(--ui-button-menu-dropdown-extras-cascade-icon-color)] rtl:rotate-180" })
|
|
83
83
|
]
|
|
84
84
|
}
|
|
85
85
|
));
|
|
86
|
-
|
|
87
|
-
function
|
|
88
|
-
className:
|
|
89
|
-
...
|
|
86
|
+
S.displayName = "DropdownMenuSubTrigger";
|
|
87
|
+
function k({
|
|
88
|
+
className: o,
|
|
89
|
+
...n
|
|
90
90
|
}) {
|
|
91
91
|
return /* @__PURE__ */ r(
|
|
92
92
|
"span",
|
|
93
93
|
{
|
|
94
|
-
className:
|
|
95
|
-
...
|
|
94
|
+
className: i("ms-auto shrink-0 text-sm font-normal leading-6 text-[var(--ui-button-menu-dropdown-extras-shortcut-label-color)]", o),
|
|
95
|
+
...n
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
}
|
|
99
|
-
|
|
99
|
+
k.displayName = "DropdownMenuShortcut";
|
|
100
|
+
const z = d.forwardRef(({ className: o, children: n, ...e }, a) => /* @__PURE__ */ c(
|
|
101
|
+
t.CheckboxItem,
|
|
102
|
+
{
|
|
103
|
+
ref: a,
|
|
104
|
+
className: i(u, o),
|
|
105
|
+
...e,
|
|
106
|
+
children: [
|
|
107
|
+
/* @__PURE__ */ r("span", { className: b, children: /* @__PURE__ */ r(t.CheckboxItemIndicator, { className: "flex", children: /* @__PURE__ */ r(N, { className: "size-4" }) }) }),
|
|
108
|
+
n
|
|
109
|
+
]
|
|
110
|
+
}
|
|
111
|
+
));
|
|
112
|
+
z.displayName = "DropdownMenuCheckboxItem";
|
|
113
|
+
const J = t.RadioGroup, P = d.forwardRef(({ className: o, children: n, ...e }, a) => /* @__PURE__ */ c(
|
|
114
|
+
t.RadioItem,
|
|
115
|
+
{
|
|
116
|
+
ref: a,
|
|
117
|
+
className: i(u, o),
|
|
118
|
+
...e,
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ r("span", { className: b, children: /* @__PURE__ */ r(t.RadioItemIndicator, { className: "block size-2 rounded-full bg-current" }) }),
|
|
121
|
+
n
|
|
122
|
+
]
|
|
123
|
+
}
|
|
124
|
+
));
|
|
125
|
+
P.displayName = "DropdownMenuRadioItem";
|
|
126
|
+
const G = d.forwardRef(({ className: o, inset: n, ...e }, a) => /* @__PURE__ */ r(
|
|
127
|
+
"div",
|
|
128
|
+
{
|
|
129
|
+
ref: a,
|
|
130
|
+
className: i(
|
|
131
|
+
"px-[var(--ui-button-menu-dropdown-item-container-padding-x)] py-[var(--ui-button-menu-dropdown-item-container-padding-y)] text-sm font-semibold leading-6 text-[var(--ui-button-menu-dropdown-item-label-color)]",
|
|
132
|
+
n && p,
|
|
133
|
+
o
|
|
134
|
+
),
|
|
135
|
+
...e
|
|
136
|
+
}
|
|
137
|
+
));
|
|
138
|
+
G.displayName = "DropdownMenuLabel";
|
|
139
|
+
const T = d.forwardRef(({ className: o, ...n }, e) => /* @__PURE__ */ r(
|
|
140
|
+
"div",
|
|
141
|
+
{
|
|
142
|
+
ref: e,
|
|
143
|
+
role: "separator",
|
|
144
|
+
className: i(
|
|
145
|
+
"my-[var(--ui-button-menu-dropdown-section-list-gap)] h-[var(--ui-button-menu-dropdown-section-container-border-width)] bg-[var(--ui-button-menu-dropdown-section-container-border-color)]",
|
|
146
|
+
o
|
|
147
|
+
),
|
|
148
|
+
...n
|
|
149
|
+
}
|
|
150
|
+
));
|
|
151
|
+
T.displayName = "DropdownMenuSeparator";
|
|
100
152
|
export {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
y as
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
153
|
+
B as DropdownMenu,
|
|
154
|
+
z as DropdownMenuCheckboxItem,
|
|
155
|
+
R as DropdownMenuContent,
|
|
156
|
+
y as DropdownMenuGroup,
|
|
157
|
+
I as DropdownMenuItem,
|
|
158
|
+
G as DropdownMenuLabel,
|
|
159
|
+
F as DropdownMenuPortal,
|
|
160
|
+
J as DropdownMenuRadioGroup,
|
|
161
|
+
P as DropdownMenuRadioItem,
|
|
162
|
+
T as DropdownMenuSeparator,
|
|
163
|
+
k as DropdownMenuShortcut,
|
|
164
|
+
H as DropdownMenuSub,
|
|
165
|
+
C as DropdownMenuSubContent,
|
|
166
|
+
S as DropdownMenuSubTrigger,
|
|
167
|
+
E as DropdownMenuTrigger
|
|
111
168
|
};
|
|
112
169
|
//# sourceMappingURL=dropdown-menu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown-menu.js","sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { ChevronRightIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { usePortalContainer } from '@/lib/portal-container';\n\n// A menu of actions anchored to a trigger, built on the Base UI Menu primitive\n// (positioning, focus management, typeahead, outside-press / Esc dismissal,\n// ARIA). Themed from the `--ui-button-menu-dropdown-*` token tier generated by\n// @acronis-platform/tokens-pd (ButtonMenu/default.css). Enter/exit animations\n// use `tw-animate-css` keyed to data-[open]/[closed]/[side].\n\nconst DropdownMenu = MenuPrimitive.Root;\nconst DropdownMenuTrigger = MenuPrimitive.Trigger;\nconst DropdownMenuGroup = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <MenuPrimitive.Group\n ref={ref}\n className={cn(\n 'flex flex-col items-start overflow-clip gap-[var(--ui-button-menu-dropdown-section-list-gap)] px-[var(--ui-button-menu-dropdown-section-container-padding-x)] py-[var(--ui-button-menu-dropdown-section-container-padding-y)] [&:not(:first-child)]:border-t [&:not(:first-child)]:border-[length:var(--ui-button-menu-dropdown-section-container-border-width)] [&:not(:first-child)]:border-[var(--ui-button-menu-dropdown-section-container-border-color)]',\n className\n )}\n {...props}\n />\n));\nDropdownMenuGroup.displayName = 'DropdownMenuGroup';\nconst DropdownMenuPortal = MenuPrimitive.Portal;\nconst DropdownMenuSub = MenuPrimitive.SubmenuRoot;\n\nconst popupClassName =\n 'z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden flex flex-col gap-[var(--ui-button-menu-dropdown-container-gap)] bg-[var(--ui-button-menu-dropdown-container-color)] border-solid border-[length:var(--ui-button-menu-dropdown-container-border-width)] border-[var(--ui-button-menu-dropdown-container-border-color)] rounded-[var(--ui-button-menu-dropdown-container-border-radius)] px-[var(--ui-button-menu-dropdown-container-padding-x)] py-[var(--ui-button-menu-dropdown-container-padding-y)] shadow-md outline-none duration-200 data-[open]:animate-in data-[closed]:animate-out data-[open]:fade-in-0 data-[closed]:fade-out-0 data-[open]:zoom-in-95 data-[closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2';\n\nconst itemClassName =\n 'relative flex w-full shrink-0 cursor-default select-none items-start gap-[var(--ui-button-menu-dropdown-item-container-gap)] min-h-[var(--ui-button-menu-dropdown-item-container-height)] px-[var(--ui-button-menu-dropdown-item-container-padding-x)] py-[var(--ui-button-menu-dropdown-item-container-padding-y)] text-sm font-semibold leading-6 outline-none transition-colors bg-[var(--ui-button-menu-dropdown-item-container-color-idle)] text-[var(--ui-button-menu-dropdown-item-label-color)] [&_svg]:text-[var(--ui-button-menu-dropdown-item-icon-color)] data-[highlighted]:bg-[var(--ui-button-menu-dropdown-item-container-color-hover)] data-[highlighted]:active:bg-[var(--ui-button-menu-dropdown-item-container-color-active)] [&:focus-visible:not(:hover)]:rounded-[3px] [&:focus-visible:not(:hover)]:ring-[3px] [&:focus-visible:not(:hover)]:ring-inset [&:focus-visible:not(:hover)]:ring-[var(--ui-focus-primary)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0';\n\nexport interface DropdownMenuContentProps\n extends React.ComponentPropsWithoutRef<typeof MenuPrimitive.Popup> {\n side?: MenuPrimitive.Positioner.Props['side'];\n align?: MenuPrimitive.Positioner.Props['align'];\n sideOffset?: number;\n /** Render inside a portal (default `true`). */\n portal?: boolean;\n /** Portal container — pass a shadow-root mount for isolated-style previews. */\n portalContainer?: MenuPrimitive.Portal.Props['container'];\n keepMounted?: MenuPrimitive.Portal.Props['keepMounted'];\n}\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.Popup>,\n DropdownMenuContentProps\n>(\n (\n {\n className,\n side,\n align,\n sideOffset = 4,\n portal = true,\n portalContainer,\n keepMounted,\n ...props\n },\n ref\n ) => {\n const ctxContainer = usePortalContainer();\n const resolvedContainer = portalContainer ?? ctxContainer;\n\n const positioner = (\n <MenuPrimitive.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n className=\"z-50\"\n >\n <MenuPrimitive.Popup\n ref={ref}\n className={cn(popupClassName, className)}\n {...props}\n />\n </MenuPrimitive.Positioner>\n );\n return portal ? (\n <MenuPrimitive.Portal container={resolvedContainer} keepMounted={keepMounted}>\n {positioner}\n </MenuPrimitive.Portal>\n ) : (\n positioner\n );\n }\n);\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.Popup>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.Popup> & {\n sideOffset?: number;\n }\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <MenuPrimitive.Positioner sideOffset={sideOffset} className=\"z-50\">\n <MenuPrimitive.Popup\n ref={ref}\n className={cn(popupClassName, className)}\n {...props}\n />\n </MenuPrimitive.Positioner>\n));\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.Item> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <MenuPrimitive.Item\n ref={ref}\n className={cn(itemClassName, inset && 'ps-8', className)}\n {...props}\n />\n));\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.SubmenuTrigger>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.SubmenuTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenuPrimitive.SubmenuTrigger\n ref={ref}\n className={cn(\n itemClassName,\n 'data-[popup-open]:bg-[var(--ui-button-menu-dropdown-item-container-color-active)]',\n inset && 'ps-8',\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ms-auto self-center text-[var(--ui-button-menu-dropdown-extras-cascade-icon-color)] rtl:rotate-180\" />\n </MenuPrimitive.SubmenuTrigger>\n));\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ms-auto shrink-0 text-sm font-normal leading-6 text-[var(--ui-button-menu-dropdown-extras-shortcut-label-color)]', className)}\n {...props}\n />\n );\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuPortal,\n};\n"],"names":["DropdownMenu","MenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","React","className","props","ref","jsx","cn","DropdownMenuPortal","DropdownMenuSub","popupClassName","itemClassName","DropdownMenuContent","side","align","sideOffset","portal","portalContainer","keepMounted","ctxContainer","usePortalContainer","resolvedContainer","positioner","DropdownMenuSubContent","DropdownMenuItem","inset","DropdownMenuSubTrigger","children","jsxs","ChevronRightIcon","DropdownMenuShortcut"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"dropdown-menu.js","sources":["../../../../src/components/ui/dropdown-menu/dropdown-menu.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Menu as MenuPrimitive } from '@base-ui/react/menu';\nimport { CheckIcon, ChevronRightIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { usePortalContainer } from '@/lib/portal-container';\n\n// A menu of actions anchored to a trigger, built on the Base UI Menu primitive\n// (positioning, focus management, typeahead, outside-press / Esc dismissal,\n// ARIA). Themed from the `--ui-button-menu-dropdown-*` token tier generated by\n// @acronis-platform/tokens-pd (ButtonMenu/default.css). Enter/exit animations\n// use `tw-animate-css` keyed to data-[open]/[closed]/[side].\n\nconst DropdownMenu = MenuPrimitive.Root;\nconst DropdownMenuTrigger = MenuPrimitive.Trigger;\nconst DropdownMenuGroup = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <MenuPrimitive.Group\n ref={ref}\n className={cn(\n 'flex flex-col items-start overflow-clip gap-[var(--ui-button-menu-dropdown-section-list-gap)] px-[var(--ui-button-menu-dropdown-section-container-padding-x)] py-[var(--ui-button-menu-dropdown-section-container-padding-y)] [&:not(:first-child)]:border-t [&:not(:first-child)]:border-[length:var(--ui-button-menu-dropdown-section-container-border-width)] [&:not(:first-child)]:border-[var(--ui-button-menu-dropdown-section-container-border-color)]',\n className\n )}\n {...props}\n />\n));\nDropdownMenuGroup.displayName = 'DropdownMenuGroup';\nconst DropdownMenuPortal = MenuPrimitive.Portal;\nconst DropdownMenuSub = MenuPrimitive.SubmenuRoot;\n\nconst popupClassName =\n 'z-50 min-w-[8rem] overflow-y-auto overflow-x-hidden flex flex-col gap-[var(--ui-button-menu-dropdown-container-gap)] bg-[var(--ui-button-menu-dropdown-container-color)] border-solid border-[length:var(--ui-button-menu-dropdown-container-border-width)] border-[var(--ui-button-menu-dropdown-container-border-color)] rounded-[var(--ui-button-menu-dropdown-container-border-radius)] px-[var(--ui-button-menu-dropdown-container-padding-x)] py-[var(--ui-button-menu-dropdown-container-padding-y)] shadow-md outline-none duration-200 data-[open]:animate-in data-[closed]:animate-out data-[open]:fade-in-0 data-[closed]:fade-out-0 data-[open]:zoom-in-95 data-[closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2';\n\nconst itemClassName =\n 'relative flex w-full shrink-0 cursor-default select-none items-start gap-[var(--ui-button-menu-dropdown-item-container-gap)] min-h-[var(--ui-button-menu-dropdown-item-container-height)] px-[var(--ui-button-menu-dropdown-item-container-padding-x)] py-[var(--ui-button-menu-dropdown-item-container-padding-y)] text-sm font-semibold leading-6 outline-none transition-colors bg-[var(--ui-button-menu-dropdown-item-container-color-idle)] text-[var(--ui-button-menu-dropdown-item-label-color)] [&_svg]:text-[var(--ui-button-menu-dropdown-item-icon-color)] data-[highlighted]:bg-[var(--ui-button-menu-dropdown-item-container-color-hover)] data-[highlighted]:active:bg-[var(--ui-button-menu-dropdown-item-container-color-active)] [&:focus-visible:not(:hover)]:rounded-[3px] [&:focus-visible:not(:hover)]:ring-[3px] [&:focus-visible:not(:hover)]:ring-inset [&:focus-visible:not(:hover)]:ring-[var(--ui-focus-primary)] data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0';\n\n// A checkbox/radio indicator lives in the same in-flow leading slot a menu-item\n// icon would occupy, so its label lands on the item gap grid (padding-x + 16px\n// glyph + gap) instead of a hardcoded indent. `h-6` matches the item's\n// line-height so the glyph centers on the first line of a wrapping label.\nconst indicatorSlotClassName =\n 'flex h-6 w-4 shrink-0 items-center justify-center text-[var(--ui-button-menu-dropdown-item-icon-color)]';\n\n// Indent for plain items/labels that must line up with the labels of sibling\n// checkbox/radio items.\nconst indicatorInsetClassName =\n 'ps-[calc(var(--ui-button-menu-dropdown-item-container-padding-x)+1rem+var(--ui-button-menu-dropdown-item-container-gap))]';\n\nexport interface DropdownMenuContentProps\n extends React.ComponentPropsWithoutRef<typeof MenuPrimitive.Popup> {\n side?: MenuPrimitive.Positioner.Props['side'];\n align?: MenuPrimitive.Positioner.Props['align'];\n sideOffset?: number;\n /** Render inside a portal (default `true`). */\n portal?: boolean;\n /** Portal container — pass a shadow-root mount for isolated-style previews. */\n portalContainer?: MenuPrimitive.Portal.Props['container'];\n keepMounted?: MenuPrimitive.Portal.Props['keepMounted'];\n}\n\nconst DropdownMenuContent = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.Popup>,\n DropdownMenuContentProps\n>(\n (\n {\n className,\n side,\n align,\n sideOffset = 4,\n portal = true,\n portalContainer,\n keepMounted,\n ...props\n },\n ref\n ) => {\n const ctxContainer = usePortalContainer();\n const resolvedContainer = portalContainer ?? ctxContainer;\n\n const positioner = (\n <MenuPrimitive.Positioner\n side={side}\n align={align}\n sideOffset={sideOffset}\n className=\"z-50\"\n >\n <MenuPrimitive.Popup\n ref={ref}\n className={cn(popupClassName, className)}\n {...props}\n />\n </MenuPrimitive.Positioner>\n );\n return portal ? (\n <MenuPrimitive.Portal container={resolvedContainer} keepMounted={keepMounted}>\n {positioner}\n </MenuPrimitive.Portal>\n ) : (\n positioner\n );\n }\n);\nDropdownMenuContent.displayName = 'DropdownMenuContent';\n\nconst DropdownMenuSubContent = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.Popup>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.Popup> & {\n sideOffset?: number;\n }\n>(({ className, sideOffset = 4, ...props }, ref) => (\n <MenuPrimitive.Positioner sideOffset={sideOffset} className=\"z-50\">\n <MenuPrimitive.Popup\n ref={ref}\n className={cn(popupClassName, className)}\n {...props}\n />\n </MenuPrimitive.Positioner>\n));\nDropdownMenuSubContent.displayName = 'DropdownMenuSubContent';\n\nconst DropdownMenuItem = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.Item>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.Item> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <MenuPrimitive.Item\n ref={ref}\n className={cn(itemClassName, inset && indicatorInsetClassName, className)}\n {...props}\n />\n));\nDropdownMenuItem.displayName = 'DropdownMenuItem';\n\nconst DropdownMenuSubTrigger = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.SubmenuTrigger>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.SubmenuTrigger> & {\n inset?: boolean;\n }\n>(({ className, inset, children, ...props }, ref) => (\n <MenuPrimitive.SubmenuTrigger\n ref={ref}\n className={cn(\n itemClassName,\n 'data-[popup-open]:bg-[var(--ui-button-menu-dropdown-item-container-color-active)]',\n inset && indicatorInsetClassName,\n className\n )}\n {...props}\n >\n {children}\n <ChevronRightIcon className=\"ms-auto self-center text-[var(--ui-button-menu-dropdown-extras-cascade-icon-color)] rtl:rotate-180\" />\n </MenuPrimitive.SubmenuTrigger>\n));\nDropdownMenuSubTrigger.displayName = 'DropdownMenuSubTrigger';\n\n\nfunction DropdownMenuShortcut({\n className,\n ...props\n}: React.HTMLAttributes<HTMLSpanElement>) {\n return (\n <span\n className={cn('ms-auto shrink-0 text-sm font-normal leading-6 text-[var(--ui-button-menu-dropdown-extras-shortcut-label-color)]', className)}\n {...props}\n />\n );\n}\nDropdownMenuShortcut.displayName = 'DropdownMenuShortcut';\n\nconst DropdownMenuCheckboxItem = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.CheckboxItem>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.CheckboxItem>\n>(({ className, children, ...props }, ref) => (\n <MenuPrimitive.CheckboxItem\n ref={ref}\n className={cn(itemClassName, className)}\n {...props}\n >\n <span className={indicatorSlotClassName}>\n <MenuPrimitive.CheckboxItemIndicator className=\"flex\">\n <CheckIcon className=\"size-4\" />\n </MenuPrimitive.CheckboxItemIndicator>\n </span>\n {children}\n </MenuPrimitive.CheckboxItem>\n));\nDropdownMenuCheckboxItem.displayName = 'DropdownMenuCheckboxItem';\n\nconst DropdownMenuRadioGroup = MenuPrimitive.RadioGroup;\n\nconst DropdownMenuRadioItem = React.forwardRef<\n React.ElementRef<typeof MenuPrimitive.RadioItem>,\n React.ComponentPropsWithoutRef<typeof MenuPrimitive.RadioItem>\n>(({ className, children, ...props }, ref) => (\n <MenuPrimitive.RadioItem\n ref={ref}\n className={cn(itemClassName, className)}\n {...props}\n >\n <span className={indicatorSlotClassName}>\n {/* The dot is the indicator element itself — Base UI renders it as a\n `<span>`, and an inline wrapper would collapse a sized child to 0. */}\n <MenuPrimitive.RadioItemIndicator className=\"block size-2 rounded-full bg-current\" />\n </span>\n {children}\n </MenuPrimitive.RadioItem>\n));\nDropdownMenuRadioItem.displayName = 'DropdownMenuRadioItem';\n\nconst DropdownMenuLabel = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & { inset?: boolean }\n>(({ className, inset, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'px-[var(--ui-button-menu-dropdown-item-container-padding-x)] py-[var(--ui-button-menu-dropdown-item-container-padding-y)] text-sm font-semibold leading-6 text-[var(--ui-button-menu-dropdown-item-label-color)]',\n inset && indicatorInsetClassName,\n className\n )}\n {...props}\n />\n));\nDropdownMenuLabel.displayName = 'DropdownMenuLabel';\n\nconst DropdownMenuSeparator = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n role=\"separator\"\n className={cn(\n 'my-[var(--ui-button-menu-dropdown-section-list-gap)] h-[var(--ui-button-menu-dropdown-section-container-border-width)] bg-[var(--ui-button-menu-dropdown-section-container-border-color)]',\n className\n )}\n {...props}\n />\n));\nDropdownMenuSeparator.displayName = 'DropdownMenuSeparator';\n\nexport {\n DropdownMenu,\n DropdownMenuTrigger,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuCheckboxItem,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuShortcut,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuPortal,\n};\n"],"names":["DropdownMenu","MenuPrimitive","DropdownMenuTrigger","DropdownMenuGroup","React","className","props","ref","jsx","cn","DropdownMenuPortal","DropdownMenuSub","popupClassName","itemClassName","indicatorSlotClassName","indicatorInsetClassName","DropdownMenuContent","side","align","sideOffset","portal","portalContainer","keepMounted","ctxContainer","usePortalContainer","resolvedContainer","positioner","DropdownMenuSubContent","DropdownMenuItem","inset","DropdownMenuSubTrigger","children","jsxs","ChevronRightIcon","DropdownMenuShortcut","DropdownMenuCheckboxItem","CheckIcon","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuLabel","DropdownMenuSeparator"],"mappings":"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"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { mergeProps as m } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender as l } from "@base-ui/react/use-render";
|
|
5
|
+
import { cn as o } from "../../../lib/utils.js";
|
|
6
|
+
import { Button as f } from "../button/button.js";
|
|
7
|
+
const n = s.forwardRef(
|
|
8
|
+
({ className: e, render: r, ariaLabel: t = "Applied filters", ...i }, p) => l({
|
|
9
|
+
render: r,
|
|
10
|
+
ref: p,
|
|
11
|
+
defaultTagName: "div",
|
|
12
|
+
props: m(
|
|
13
|
+
{
|
|
14
|
+
role: "group",
|
|
15
|
+
"aria-label": t,
|
|
16
|
+
className: o("flex items-center gap-[var(--ui-gap-16)]", e)
|
|
17
|
+
},
|
|
18
|
+
i
|
|
19
|
+
)
|
|
20
|
+
})
|
|
21
|
+
);
|
|
22
|
+
n.displayName = "FilterChips";
|
|
23
|
+
const c = s.forwardRef(
|
|
24
|
+
({ className: e, ...r }, t) => /* @__PURE__ */ a(
|
|
25
|
+
"div",
|
|
26
|
+
{
|
|
27
|
+
ref: t,
|
|
28
|
+
className: o(
|
|
29
|
+
"flex min-w-0 flex-wrap content-center items-center gap-[var(--ui-gap-8)]",
|
|
30
|
+
e
|
|
31
|
+
),
|
|
32
|
+
...r
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
);
|
|
36
|
+
c.displayName = "FilterChipsList";
|
|
37
|
+
const d = s.forwardRef(({ children: e = "Reset filters", type: r = "button", ...t }, i) => /* @__PURE__ */ a(f, { ref: i, type: r, variant: "ghost", ...t, children: e }));
|
|
38
|
+
d.displayName = "FilterChipsReset";
|
|
39
|
+
export {
|
|
40
|
+
n as FilterChips,
|
|
41
|
+
c as FilterChipsList,
|
|
42
|
+
d as FilterChipsReset
|
|
43
|
+
};
|
|
44
|
+
//# sourceMappingURL=filter-chips.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-chips.js","sources":["../../../../src/components/ui/filter-chips/filter-chips.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\n\nimport { cn } from '@/lib/utils';\nimport { Button } from '../button';\n\n// Composable applied-filter row mirroring the Figma \"FilterChips\" component:\n// a wrapping list of removable `Chip`s closed by a ghost \"Reset filters\" action\n// that clears them all at once.\n//\n// There is no `--ui-filter-chips-*` tier, and none is needed — the design\n// references exactly two primitive gap tokens: `--ui-gap-16` between the root's\n// children and `--ui-gap-8` between the items inside the list. Every other token\n// in the node belongs to `Chip` (`--ui-chip-*`) or `Button`\n// (`--ui-button-ghost-*`), which already own them.\n//\n// Figma models the chip area as a single `ListChips` slot, so the chips are the\n// consumer's children rather than a data prop. The \"Reset filters\" button sits\n// *inside* that slot — the design measures 8px, not 16px, between the last chip\n// and the button — so compose `FilterChipsReset` as the last child of\n// `FilterChipsList`. The root's 16px gap is for anything a consumer places\n// beside the list as a whole.\n//\n// Chips are 24px tall and the ghost button is 32px, so the row is 32px tall with\n// the chips centered in it (`items-center`).\n\nexport interface FilterChipsProps extends React.ComponentPropsWithoutRef<'div'> {\n /**\n * Replace the rendered `<div>` with another element or component\n * (Base UI composition). Accepts a React element or a render function.\n */\n render?: useRender.RenderProp;\n /** Accessible name for the applied-filter region. */\n ariaLabel?: string;\n}\n\nconst FilterChips = React.forwardRef<HTMLDivElement, FilterChipsProps>(\n ({ className, render, ariaLabel = 'Applied filters', ...props }, ref) =>\n useRender({\n render,\n ref,\n defaultTagName: 'div',\n props: mergeProps<'div'>(\n {\n role: 'group',\n 'aria-label': ariaLabel,\n className: cn('flex items-center gap-[var(--ui-gap-16)]', className),\n },\n props\n ),\n })\n);\nFilterChips.displayName = 'FilterChips';\n\nexport type FilterChipsListProps = React.ComponentPropsWithoutRef<'div'>;\n\nconst FilterChipsList = React.forwardRef<HTMLDivElement, FilterChipsListProps>(\n ({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\n 'flex min-w-0 flex-wrap content-center items-center gap-[var(--ui-gap-8)]',\n className\n )}\n {...props}\n />\n )\n);\nFilterChipsList.displayName = 'FilterChipsList';\n\nexport interface FilterChipsResetProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement> {\n /**\n * Replace the rendered `<button>` with another element or component\n * (Base UI composition). Accepts a React element or a render function.\n */\n render?: useRender.RenderProp;\n /** Label for the reset action. */\n children?: React.ReactNode;\n}\n\nconst FilterChipsReset = React.forwardRef<\n HTMLButtonElement,\n FilterChipsResetProps\n>(({ children = 'Reset filters', type = 'button', ...props }, ref) => (\n <Button ref={ref} type={type} variant=\"ghost\" {...props}>\n {children}\n </Button>\n));\nFilterChipsReset.displayName = 'FilterChipsReset';\n\nexport { FilterChips, FilterChipsList, FilterChipsReset };\n"],"names":["FilterChips","React","className","render","ariaLabel","props","ref","useRender","mergeProps","cn","FilterChipsList","jsx","FilterChipsReset","children","type","Button"],"mappings":";;;;;;AAqCA,MAAMA,IAAcC,EAAM;AAAA,EACxB,CAAC,EAAE,WAAAC,GAAW,QAAAC,GAAQ,WAAAC,IAAY,mBAAmB,GAAGC,EAAA,GAASC,MAC/DC,EAAU;AAAA,IACR,QAAAJ;AAAA,IACA,KAAAG;AAAA,IACA,gBAAgB;AAAA,IAChB,OAAOE;AAAA,MACL;AAAA,QACE,MAAM;AAAA,QACN,cAAcJ;AAAA,QACd,WAAWK,EAAG,4CAA4CP,CAAS;AAAA,MAAA;AAAA,MAErEG;AAAA,IAAA;AAAA,EACF,CACD;AACL;AACAL,EAAY,cAAc;AAI1B,MAAMU,IAAkBT,EAAM;AAAA,EAC5B,CAAC,EAAE,WAAAC,GAAW,GAAGG,EAAA,GAASC,MACxB,gBAAAK;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,KAAAL;AAAA,MACA,WAAWG;AAAA,QACT;AAAA,QACAP;AAAA,MAAA;AAAA,MAED,GAAGG;AAAA,IAAA;AAAA,EAAA;AAGV;AACAK,EAAgB,cAAc;AAa9B,MAAME,IAAmBX,EAAM,WAG7B,CAAC,EAAE,UAAAY,IAAW,iBAAiB,MAAAC,IAAO,UAAU,GAAGT,EAAA,GAASC,MAC5D,gBAAAK,EAACI,KAAO,KAAAT,GAAU,MAAAQ,GAAY,SAAQ,SAAS,GAAGT,GAC/C,UAAAQ,GACH,CACD;AACDD,EAAiB,cAAc;"}
|