@acronis-platform/ui-react 0.61.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-utils.js +63 -0
- package/dist/components/ui/calendar-panel/calendar-panel-utils.js.map +1 -0
- package/dist/components/ui/calendar-panel/calendar-panel.js +260 -0
- package/dist/components/ui/calendar-panel/calendar-panel.js.map +1 -0
- 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-cards/filter-cards.js +25 -0
- package/dist/components/ui/filter-cards/filter-cards.js.map +1 -0
- 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/resizable/resizable.js +23 -11
- package/dist/components/ui/resizable/resizable.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/sidebar-secondary/sidebar-secondary.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 +507 -469
- 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/node_modules/.pnpm/react-day-picker@10.0.1_@types_react@19.2.15_react@19.2.6/node_modules/react-day-picker/dist/esm/useDayPicker.js +3 -3
- package/dist/react.js +507 -469
- 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/__tests__/calendar-panel-utils.test.d.ts +1 -0
- package/dist/src/components/ui/calendar-panel/calendar-panel-utils.d.ts +55 -0
- package/dist/src/components/ui/calendar-panel/calendar-panel.d.ts +112 -0
- package/dist/src/components/ui/calendar-panel/index.d.ts +1 -0
- 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-cards/filter-cards.d.ts +11 -0
- package/dist/src/components/ui/filter-cards/index.d.ts +1 -0
- 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 +8 -0
- package/dist/ui-react.css +1 -1
- package/package.json +4 -4
- 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,87 +1,98 @@
|
|
|
1
1
|
import { jsxs as s, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as m from "react";
|
|
3
|
-
import { TimesIcon as
|
|
3
|
+
import { TimesIcon as C } from "@acronis-platform/icons-react/stroke-mono";
|
|
4
4
|
import { cn as c } from "../../../lib/utils.js";
|
|
5
|
-
import { InputBox as
|
|
6
|
-
const
|
|
5
|
+
import { InputBox as T } from "../input/input.js";
|
|
6
|
+
const k = m.forwardRef(
|
|
7
7
|
({
|
|
8
8
|
className: g,
|
|
9
|
+
style: v,
|
|
9
10
|
id: b,
|
|
10
11
|
label: i,
|
|
11
12
|
required: u,
|
|
12
|
-
description:
|
|
13
|
+
description: h,
|
|
13
14
|
error: o,
|
|
14
15
|
clearable: f,
|
|
15
|
-
onClear:
|
|
16
|
+
onClear: I,
|
|
16
17
|
disabled: e,
|
|
17
18
|
value: a,
|
|
18
|
-
...
|
|
19
|
-
},
|
|
20
|
-
const
|
|
21
|
-
return /* @__PURE__ */ s(
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
19
|
+
...N
|
|
20
|
+
}, y) => {
|
|
21
|
+
const w = m.useId(), r = b ?? w, d = `${r}-message`, n = o != null && o !== "", j = a != null && a !== "", p = !!f && j && !e, l = n ? o : h, x = l != null && l !== "";
|
|
22
|
+
return /* @__PURE__ */ s(
|
|
23
|
+
"div",
|
|
24
|
+
{
|
|
25
|
+
className: c(
|
|
26
|
+
"flex min-w-[var(--ui-input-text-global-container-width-min)] flex-col gap-[var(--ui-input-text-global-container-gap)]",
|
|
27
|
+
g
|
|
28
|
+
),
|
|
29
|
+
style: v,
|
|
30
|
+
children: [
|
|
31
|
+
i != null && i !== "" && /* @__PURE__ */ s(
|
|
32
|
+
"label",
|
|
33
|
+
{
|
|
34
|
+
htmlFor: r,
|
|
35
|
+
className: c(
|
|
36
|
+
"flex gap-[var(--ui-input-text-global-container-label-gap)] text-sm leading-4",
|
|
37
|
+
e ? "text-[var(--ui-input-text-global-label-color-disabled)]" : "text-[var(--ui-input-text-global-label-color-idle)]"
|
|
38
|
+
),
|
|
39
|
+
children: [
|
|
40
|
+
i,
|
|
41
|
+
u && /* @__PURE__ */ t(
|
|
42
|
+
"span",
|
|
43
|
+
{
|
|
44
|
+
"aria-hidden": "true",
|
|
45
|
+
className: "text-[var(--ui-input-text-global-required-color)]",
|
|
46
|
+
children: "*"
|
|
47
|
+
}
|
|
48
|
+
)
|
|
49
|
+
]
|
|
50
|
+
}
|
|
29
51
|
),
|
|
30
|
-
children: [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
52
|
+
/* @__PURE__ */ s("div", { className: "relative", children: [
|
|
53
|
+
/* @__PURE__ */ t(
|
|
54
|
+
T,
|
|
55
|
+
{
|
|
56
|
+
ref: y,
|
|
57
|
+
id: r,
|
|
58
|
+
disabled: e,
|
|
59
|
+
value: a,
|
|
60
|
+
"aria-invalid": n || void 0,
|
|
61
|
+
"aria-required": u || void 0,
|
|
62
|
+
"aria-describedby": x ? d : void 0,
|
|
63
|
+
className: p ? "pe-9" : void 0,
|
|
64
|
+
...N
|
|
65
|
+
}
|
|
66
|
+
),
|
|
67
|
+
p && /* @__PURE__ */ t(
|
|
68
|
+
"button",
|
|
34
69
|
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
70
|
+
type: "button",
|
|
71
|
+
onClick: I,
|
|
72
|
+
"aria-label": "Clear",
|
|
73
|
+
className: "absolute end-[var(--ui-input-text-global-box-padding-x)] top-1/2 flex size-5 -translate-y-1/2 cursor-pointer items-center justify-center rounded-[var(--ui-input-text-global-box-border-radius)] p-0.5 text-[var(--ui-button-icon-global-icon-color-idle)] outline-none hover:bg-[var(--ui-button-icon-global-container-color-hover)] active:bg-[var(--ui-button-icon-global-container-color-active)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] [&_svg]:size-4 [&_svg]:shrink-0",
|
|
74
|
+
children: /* @__PURE__ */ t(C, {})
|
|
38
75
|
}
|
|
39
76
|
)
|
|
40
|
-
]
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
...I
|
|
56
|
-
}
|
|
57
|
-
),
|
|
58
|
-
p && /* @__PURE__ */ t(
|
|
59
|
-
"button",
|
|
60
|
-
{
|
|
61
|
-
type: "button",
|
|
62
|
-
onClick: h,
|
|
63
|
-
"aria-label": "Clear",
|
|
64
|
-
className: "absolute end-[var(--ui-input-text-global-box-padding-x)] top-1/2 flex size-5 -translate-y-1/2 cursor-pointer items-center justify-center rounded-[var(--ui-input-text-global-box-border-radius)] p-0.5 text-[var(--ui-button-icon-global-icon-color-idle)] outline-none hover:bg-[var(--ui-button-icon-global-container-color-hover)] active:bg-[var(--ui-button-icon-global-container-color-active)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] [&_svg]:size-4 [&_svg]:shrink-0",
|
|
65
|
-
children: /* @__PURE__ */ t(j, {})
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
] }),
|
|
69
|
-
x && /* @__PURE__ */ t(
|
|
70
|
-
"p",
|
|
71
|
-
{
|
|
72
|
-
id: d,
|
|
73
|
-
className: c(
|
|
74
|
-
"text-xs leading-4",
|
|
75
|
-
l ? "text-[var(--ui-input-text-error-msg-error-color)]" : e ? "text-[var(--ui-input-text-normal-description-color-disabled)]" : "text-[var(--ui-input-text-normal-description-color-idle)]"
|
|
76
|
-
),
|
|
77
|
-
children: n
|
|
78
|
-
}
|
|
79
|
-
)
|
|
80
|
-
] });
|
|
77
|
+
] }),
|
|
78
|
+
x && /* @__PURE__ */ t(
|
|
79
|
+
"p",
|
|
80
|
+
{
|
|
81
|
+
id: d,
|
|
82
|
+
className: c(
|
|
83
|
+
"text-xs leading-4",
|
|
84
|
+
n ? "text-[var(--ui-input-text-error-msg-error-color)]" : e ? "text-[var(--ui-input-text-normal-description-color-disabled)]" : "text-[var(--ui-input-text-normal-description-color-idle)]"
|
|
85
|
+
),
|
|
86
|
+
children: l
|
|
87
|
+
}
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
81
92
|
}
|
|
82
93
|
);
|
|
83
|
-
|
|
94
|
+
k.displayName = "InputText";
|
|
84
95
|
export {
|
|
85
|
-
|
|
96
|
+
k as InputText
|
|
86
97
|
};
|
|
87
98
|
//# sourceMappingURL=input-text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-text.js","sources":["../../../../src/components/ui/input-text/input-text.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TimesIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { InputBox } from '../input';\n\n// Mirrors the Figma \"InputText\" component: a full single-line text field built\n// around the bare `InputBox` primitive (themed by the `--ui-input-text-*` tier). It\n// adds the field furniture: an optional `label` (with an optional `required` `*`),\n// an optional clear (✕) button, and an optional `description` or `error` message\n// below. Passing `error` switches the field to its error treatment — the box gets\n// the red error border (via the input's `aria-invalid` styling) and the red error\n// message replaces the description. The clear button appears only while `clearable`\n// is set and the (controlled) field has a value, and calls `onClear`. Colors come\n// from the `--ui-input-text-*` tokens — label/required/description/error — so brand\n// overrides are honored; the clear button is a ghost ButtonIcon (glyph\n// `--ui-button-icon-global-icon-color-idle`, since the input-text tier dropped its\n// own clear-icon token in the Figma sync) with a 3px `--ui-focus-primary` ring.\nexport interface InputTextProps\n extends Omit<React.ComponentPropsWithoutRef<'input'>, 'children'> {\n /** Field label, rendered above the input. */\n label?: React.ReactNode;\n /** Marks the field required — appends a `*` after the label. */\n required?: boolean;\n /** Helper text below the input. Hidden while `error` is set. */\n description?: React.ReactNode;\n /**\n * Error message below the input. Its presence switches the field to the error\n * treatment (red box border + red message).\n */\n error?: React.ReactNode;\n /** Show a clear (✕) button while the (controlled) field has a value. */\n clearable?: boolean;\n /** Called when the clear button is activated. */\n onClear?: () => void;\n}\n\nconst InputText = React.forwardRef<HTMLInputElement, InputTextProps>(\n (\n {\n className,\n id,\n label,\n required,\n description,\n error,\n clearable,\n onClear,\n disabled,\n value,\n ...props\n },\n ref\n ) => {\n const reactId = React.useId();\n const inputId = id ?? reactId;\n const messageId = `${inputId}-message`;\n\n const hasError = error != null && error !== '';\n const hasValue = value != null && value !== '';\n const showClear = Boolean(clearable) && hasValue && !disabled;\n const message = hasError ? error : description;\n const hasMessage = message != null && message !== '';\n\n return (\n <div
|
|
1
|
+
{"version":3,"file":"input-text.js","sources":["../../../../src/components/ui/input-text/input-text.tsx"],"sourcesContent":["import * as React from 'react';\nimport { TimesIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\nimport { InputBox } from '../input';\n\n// Mirrors the Figma \"InputText\" component: a full single-line text field built\n// around the bare `InputBox` primitive (themed by the `--ui-input-text-*` tier). It\n// adds the field furniture: an optional `label` (with an optional `required` `*`),\n// an optional clear (✕) button, and an optional `description` or `error` message\n// below. Passing `error` switches the field to its error treatment — the box gets\n// the red error border (via the input's `aria-invalid` styling) and the red error\n// message replaces the description. The clear button appears only while `clearable`\n// is set and the (controlled) field has a value, and calls `onClear`. Colors come\n// from the `--ui-input-text-*` tokens — label/required/description/error — so brand\n// overrides are honored; the clear button is a ghost ButtonIcon (glyph\n// `--ui-button-icon-global-icon-color-idle`, since the input-text tier dropped its\n// own clear-icon token in the Figma sync) with a 3px `--ui-focus-primary` ring.\n// `ref` targets the underlying `<input>`; `className` and `style` both target the\n// field wrapper (label + box + message), so sizing the field works the same way\n// whichever one a consumer reaches for.\nexport interface InputTextProps\n extends Omit<React.ComponentPropsWithoutRef<'input'>, 'children'> {\n /** Field label, rendered above the input. */\n label?: React.ReactNode;\n /** Marks the field required — appends a `*` after the label. */\n required?: boolean;\n /** Helper text below the input. Hidden while `error` is set. */\n description?: React.ReactNode;\n /**\n * Error message below the input. Its presence switches the field to the error\n * treatment (red box border + red message).\n */\n error?: React.ReactNode;\n /** Show a clear (✕) button while the (controlled) field has a value. */\n clearable?: boolean;\n /** Called when the clear button is activated. */\n onClear?: () => void;\n}\n\nconst InputText = React.forwardRef<HTMLInputElement, InputTextProps>(\n (\n {\n className,\n style,\n id,\n label,\n required,\n description,\n error,\n clearable,\n onClear,\n disabled,\n value,\n ...props\n },\n ref\n ) => {\n const reactId = React.useId();\n const inputId = id ?? reactId;\n const messageId = `${inputId}-message`;\n\n const hasError = error != null && error !== '';\n const hasValue = value != null && value !== '';\n const showClear = Boolean(clearable) && hasValue && !disabled;\n const message = hasError ? error : description;\n const hasMessage = message != null && message !== '';\n\n return (\n <div\n className={cn(\n 'flex min-w-[var(--ui-input-text-global-container-width-min)] flex-col gap-[var(--ui-input-text-global-container-gap)]',\n className\n )}\n style={style}\n >\n {label != null && label !== '' && (\n <label\n htmlFor={inputId}\n className={cn(\n 'flex gap-[var(--ui-input-text-global-container-label-gap)] text-sm leading-4',\n disabled\n ? 'text-[var(--ui-input-text-global-label-color-disabled)]'\n : 'text-[var(--ui-input-text-global-label-color-idle)]'\n )}\n >\n {label}\n {required && (\n <span\n aria-hidden=\"true\"\n className=\"text-[var(--ui-input-text-global-required-color)]\"\n >\n *\n </span>\n )}\n </label>\n )}\n\n <div className=\"relative\">\n <InputBox\n ref={ref}\n id={inputId}\n disabled={disabled}\n value={value}\n aria-invalid={hasError || undefined}\n aria-required={required || undefined}\n aria-describedby={hasMessage ? messageId : undefined}\n className={showClear ? 'pe-9' : undefined}\n {...props}\n />\n {showClear && (\n <button\n type=\"button\"\n onClick={onClear}\n aria-label=\"Clear\"\n className=\"absolute end-[var(--ui-input-text-global-box-padding-x)] top-1/2 flex size-5 -translate-y-1/2 cursor-pointer items-center justify-center rounded-[var(--ui-input-text-global-box-border-radius)] p-0.5 text-[var(--ui-button-icon-global-icon-color-idle)] outline-none hover:bg-[var(--ui-button-icon-global-container-color-hover)] active:bg-[var(--ui-button-icon-global-container-color-active)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] [&_svg]:size-4 [&_svg]:shrink-0\"\n >\n <TimesIcon />\n </button>\n )}\n </div>\n\n {hasMessage && (\n <p\n id={messageId}\n className={cn(\n 'text-xs leading-4',\n hasError\n ? 'text-[var(--ui-input-text-error-msg-error-color)]'\n : disabled\n ? 'text-[var(--ui-input-text-normal-description-color-disabled)]'\n : 'text-[var(--ui-input-text-normal-description-color-idle)]'\n )}\n >\n {message}\n </p>\n )}\n </div>\n );\n }\n);\nInputText.displayName = 'InputText';\n\nexport { InputText };\n"],"names":["InputText","React","className","style","id","label","required","description","error","clearable","onClear","disabled","value","props","ref","reactId","inputId","messageId","hasError","hasValue","showClear","message","hasMessage","jsxs","cn","jsx","InputBox","TimesIcon"],"mappings":";;;;;AAwCA,MAAMA,IAAYC,EAAM;AAAA,EACtB,CACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,IAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,WAAAC;AAAA,IACA,SAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUd,EAAM,MAAA,GAChBe,IAAUZ,KAAMW,GAChBE,IAAY,GAAGD,CAAO,YAEtBE,IAAWV,KAAS,QAAQA,MAAU,IACtCW,IAAWP,KAAS,QAAQA,MAAU,IACtCQ,IAAY,EAAQX,KAAcU,KAAY,CAACR,GAC/CU,IAAUH,IAAWV,IAAQD,GAC7Be,IAAaD,KAAW,QAAQA,MAAY;AAElD,WACE,gBAAAE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACAtB;AAAA,QAAA;AAAA,QAEF,OAAAC;AAAA,QAEC,UAAA;AAAA,UAAAE,KAAS,QAAQA,MAAU,MAC1B,gBAAAkB;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAASP;AAAA,cACT,WAAWQ;AAAA,gBACT;AAAA,gBACAb,IACI,4DACA;AAAA,cAAA;AAAA,cAGL,UAAA;AAAA,gBAAAN;AAAA,gBACAC,KACC,gBAAAmB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,eAAY;AAAA,oBACZ,WAAU;AAAA,oBACX,UAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAED;AAAA,YAAA;AAAA,UAAA;AAAA,UAKN,gBAAAF,EAAC,OAAA,EAAI,WAAU,YACb,UAAA;AAAA,YAAA,gBAAAE;AAAA,cAACC;AAAA,cAAA;AAAA,gBACC,KAAAZ;AAAA,gBACA,IAAIE;AAAA,gBACJ,UAAAL;AAAA,gBACA,OAAAC;AAAA,gBACA,gBAAcM,KAAY;AAAA,gBAC1B,iBAAeZ,KAAY;AAAA,gBAC3B,oBAAkBgB,IAAaL,IAAY;AAAA,gBAC3C,WAAWG,IAAY,SAAS;AAAA,gBAC/B,GAAGP;AAAA,cAAA;AAAA,YAAA;AAAA,YAELO,KACC,gBAAAK;AAAA,cAAC;AAAA,cAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAASf;AAAA,gBACT,cAAW;AAAA,gBACX,WAAU;AAAA,gBAEV,4BAACiB,GAAA,CAAA,CAAU;AAAA,cAAA;AAAA,YAAA;AAAA,UACb,GAEJ;AAAA,UAECL,KACC,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAIR;AAAA,cACJ,WAAWO;AAAA,gBACT;AAAA,gBACAN,IACI,sDACAP,IACE,kEACA;AAAA,cAAA;AAAA,cAGP,UAAAU;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACArB,EAAU,cAAc;"}
|
|
@@ -1,77 +1,87 @@
|
|
|
1
|
-
import { jsxs as x, jsx as
|
|
1
|
+
import { jsxs as x, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
const
|
|
3
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
4
|
+
const I = c.forwardRef(
|
|
5
5
|
({
|
|
6
6
|
className: v,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
style: p,
|
|
8
|
+
id: b,
|
|
9
|
+
label: r,
|
|
9
10
|
required: d,
|
|
10
|
-
description:
|
|
11
|
-
error:
|
|
12
|
-
disabled:
|
|
13
|
-
"aria-invalid":
|
|
14
|
-
...
|
|
15
|
-
},
|
|
16
|
-
const
|
|
17
|
-
return /* @__PURE__ */ x(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
description: h,
|
|
12
|
+
error: a,
|
|
13
|
+
disabled: i,
|
|
14
|
+
"aria-invalid": m,
|
|
15
|
+
...g
|
|
16
|
+
}, f) => {
|
|
17
|
+
const w = c.useId(), t = b ?? w, u = `${t}-message`, o = a != null && a !== "", y = o || m, l = o ? a : h, s = l != null && l !== "";
|
|
18
|
+
return /* @__PURE__ */ x(
|
|
19
|
+
"div",
|
|
20
|
+
{
|
|
21
|
+
className: e(
|
|
22
|
+
"flex min-w-[var(--ui-input-text-area-container-width-min)] flex-col gap-[var(--ui-input-text-area-container-gap)]",
|
|
23
|
+
v
|
|
24
|
+
),
|
|
25
|
+
style: p,
|
|
26
|
+
children: [
|
|
27
|
+
r != null && r !== "" && /* @__PURE__ */ x(
|
|
28
|
+
"label",
|
|
29
|
+
{
|
|
30
|
+
htmlFor: t,
|
|
31
|
+
className: e(
|
|
32
|
+
"flex gap-[var(--ui-input-text-area-container-label-gap)] text-sm leading-4",
|
|
33
|
+
i ? "text-[var(--ui-input-text-area-label-color-disabled)]" : "text-[var(--ui-input-text-area-label-color-idle)]"
|
|
34
|
+
),
|
|
35
|
+
children: [
|
|
36
|
+
r,
|
|
37
|
+
d && /* @__PURE__ */ n(
|
|
38
|
+
"span",
|
|
39
|
+
{
|
|
40
|
+
"aria-hidden": "true",
|
|
41
|
+
className: "text-[var(--ui-input-text-area-required-color)]",
|
|
42
|
+
children: "*"
|
|
43
|
+
}
|
|
44
|
+
)
|
|
45
|
+
]
|
|
46
|
+
}
|
|
25
47
|
),
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
disabled: a,
|
|
45
|
-
"aria-invalid": w || void 0,
|
|
46
|
-
"aria-required": d || void 0,
|
|
47
|
-
"aria-describedby": s ? u : void 0,
|
|
48
|
-
className: n(
|
|
49
|
-
"min-h-[var(--ui-input-text-area-box-height-min)] w-full min-w-0 resize-y rounded-[var(--ui-input-text-area-box-border-radius)] border bg-[var(--ui-input-text-area-box-color-idle)] border-[var(--ui-input-text-area-border-color-idle)] px-[var(--ui-input-text-area-box-padding-x)] py-[var(--ui-input-text-area-box-padding-y)] text-sm leading-6 text-[var(--ui-input-text-area-value-color-idle)] transition-colors placeholder:text-[var(--ui-input-text-area-placeholder-color-idle)] focus-visible:outline-none focus-visible:ring-[3px]",
|
|
50
|
-
"enabled:not-aria-[invalid=true]:hover:bg-[var(--ui-input-text-area-box-color-hover)] enabled:not-aria-[invalid=true]:hover:border-[var(--ui-input-text-area-border-color-hover)] enabled:hover:text-[var(--ui-input-text-area-value-color-hover)] enabled:hover:placeholder:text-[var(--ui-input-text-area-placeholder-color-hover)]",
|
|
51
|
-
"not-aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-border-color-focus)] not-aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-primary)]",
|
|
52
|
-
"aria-[invalid=true]:border-[var(--ui-input-text-area-error-msg-box-border-color-idle)] enabled:aria-[invalid=true]:hover:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-error)]",
|
|
53
|
-
"disabled:cursor-not-allowed disabled:border-[var(--ui-input-text-area-border-color-disabled)] disabled:bg-[var(--ui-input-text-area-box-color-disabled)] disabled:text-[var(--ui-input-text-area-value-color-disabled)] disabled:placeholder:text-[var(--ui-input-text-area-placeholder-color-disabled)]",
|
|
54
|
-
v
|
|
48
|
+
/* @__PURE__ */ n(
|
|
49
|
+
"textarea",
|
|
50
|
+
{
|
|
51
|
+
ref: f,
|
|
52
|
+
id: t,
|
|
53
|
+
disabled: i,
|
|
54
|
+
"aria-invalid": y || void 0,
|
|
55
|
+
"aria-required": d || void 0,
|
|
56
|
+
"aria-describedby": s ? u : void 0,
|
|
57
|
+
className: e(
|
|
58
|
+
"min-h-[var(--ui-input-text-area-box-height-min)] w-full min-w-0 resize-y rounded-[var(--ui-input-text-area-box-border-radius)] border bg-[var(--ui-input-text-area-box-color-idle)] border-[var(--ui-input-text-area-border-color-idle)] px-[var(--ui-input-text-area-box-padding-x)] py-[var(--ui-input-text-area-box-padding-y)] text-sm leading-6 text-[var(--ui-input-text-area-value-color-idle)] transition-colors placeholder:text-[var(--ui-input-text-area-placeholder-color-idle)] focus-visible:outline-none focus-visible:ring-[3px]",
|
|
59
|
+
"enabled:not-aria-[invalid=true]:hover:bg-[var(--ui-input-text-area-box-color-hover)] enabled:not-aria-[invalid=true]:hover:border-[var(--ui-input-text-area-border-color-hover)] enabled:hover:text-[var(--ui-input-text-area-value-color-hover)] enabled:hover:placeholder:text-[var(--ui-input-text-area-placeholder-color-hover)]",
|
|
60
|
+
"not-aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-border-color-focus)] not-aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-primary)]",
|
|
61
|
+
"aria-[invalid=true]:border-[var(--ui-input-text-area-error-msg-box-border-color-idle)] enabled:aria-[invalid=true]:hover:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-error)]",
|
|
62
|
+
"disabled:cursor-not-allowed disabled:border-[var(--ui-input-text-area-border-color-disabled)] disabled:bg-[var(--ui-input-text-area-box-color-disabled)] disabled:text-[var(--ui-input-text-area-value-color-disabled)] disabled:placeholder:text-[var(--ui-input-text-area-placeholder-color-disabled)]"
|
|
63
|
+
),
|
|
64
|
+
...g
|
|
65
|
+
}
|
|
55
66
|
),
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
)
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
] });
|
|
67
|
+
s && /* @__PURE__ */ n(
|
|
68
|
+
"p",
|
|
69
|
+
{
|
|
70
|
+
id: u,
|
|
71
|
+
className: e(
|
|
72
|
+
"text-xs leading-4",
|
|
73
|
+
o ? "text-[var(--ui-input-text-area-error-msg-error-color)]" : i ? "text-[var(--ui-input-text-area-description-color-disabled)]" : "text-[var(--ui-input-text-area-description-color-idle)]"
|
|
74
|
+
),
|
|
75
|
+
children: l
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
]
|
|
79
|
+
}
|
|
80
|
+
);
|
|
71
81
|
}
|
|
72
82
|
);
|
|
73
|
-
|
|
83
|
+
I.displayName = "InputTextArea";
|
|
74
84
|
export {
|
|
75
|
-
|
|
85
|
+
I as InputTextArea
|
|
76
86
|
};
|
|
77
87
|
//# sourceMappingURL=input-text-area.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"input-text-area.js","sources":["../../../../src/components/ui/input-text-area/input-text-area.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"InputTextArea\" component: a full multiline text field built\n// around a `<textarea>` (themed by the dedicated `--ui-input-text-area-*` tier). It\n// adds the field furniture: an optional `label` (with an optional required `*`) and\n// an optional `description` or `error` message below. Passing `error` switches the\n// field to its error treatment — the box gets the red error border (via the\n// textarea's `aria-invalid` styling) and the red error message replaces the\n// description. The box fill / border are wired per state: idle / hover / focus\n// (`border-color-focus` + a 3px `--ui-focus-primary` ring) / disabled; the error\n// state (driven by `aria-invalid`) swaps the border to\n// `error-msg-box-border-color-{idle,hover}` and the focus ring to `--ui-focus-error`.\n// Box geometry (96px min-height, 4px radius, 12px padding-x, 8px padding-y) comes\n// from `--ui-input-text-area-box-*`; it grows with vertical resize. `ref`
|
|
1
|
+
{"version":3,"file":"input-text-area.js","sources":["../../../../src/components/ui/input-text-area/input-text-area.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"InputTextArea\" component: a full multiline text field built\n// around a `<textarea>` (themed by the dedicated `--ui-input-text-area-*` tier). It\n// adds the field furniture: an optional `label` (with an optional required `*`) and\n// an optional `description` or `error` message below. Passing `error` switches the\n// field to its error treatment — the box gets the red error border (via the\n// textarea's `aria-invalid` styling) and the red error message replaces the\n// description. The box fill / border are wired per state: idle / hover / focus\n// (`border-color-focus` + a 3px `--ui-focus-primary` ring) / disabled; the error\n// state (driven by `aria-invalid`) swaps the border to\n// `error-msg-box-border-color-{idle,hover}` and the focus ring to `--ui-focus-error`.\n// Box geometry (96px min-height, 4px radius, 12px padding-x, 8px padding-y) comes\n// from `--ui-input-text-area-box-*`; it grows with vertical resize. `ref` targets\n// the underlying `<textarea>`; `className` targets the field wrapper (label + box\n// + message), as does `style`, so a consumer can size the whole field from a flex/grid\n// ancestor whichever one they reach for.\n// The bare usage (`<InputTextArea placeholder=… />`, no label) renders just the box.\nexport interface InputTextAreaProps\n extends Omit<React.ComponentPropsWithoutRef<'textarea'>, 'children'> {\n /** Field label, rendered above the textarea. */\n label?: React.ReactNode;\n /** Marks the field required — appends a `*` after the label. */\n required?: boolean;\n /** Helper text below the textarea. Hidden while `error` is set. */\n description?: React.ReactNode;\n /**\n * Error message below the textarea. Its presence switches the field to the error\n * treatment (red box border + red message).\n */\n error?: React.ReactNode;\n}\n\nconst InputTextArea = React.forwardRef<HTMLTextAreaElement, InputTextAreaProps>(\n (\n {\n className,\n style,\n id,\n label,\n required,\n description,\n error,\n disabled,\n 'aria-invalid': ariaInvalid,\n ...props\n },\n ref\n ) => {\n const reactId = React.useId();\n const inputId = id ?? reactId;\n const messageId = `${inputId}-message`;\n\n const hasError = error != null && error !== '';\n const invalid = hasError || ariaInvalid;\n const message = hasError ? error : description;\n const hasMessage = message != null && message !== '';\n\n return (\n <div\n className={cn(\n 'flex min-w-[var(--ui-input-text-area-container-width-min)] flex-col gap-[var(--ui-input-text-area-container-gap)]',\n className\n )}\n style={style}\n >\n {label != null && label !== '' && (\n <label\n htmlFor={inputId}\n className={cn(\n 'flex gap-[var(--ui-input-text-area-container-label-gap)] text-sm leading-4',\n disabled\n ? 'text-[var(--ui-input-text-area-label-color-disabled)]'\n : 'text-[var(--ui-input-text-area-label-color-idle)]'\n )}\n >\n {label}\n {required && (\n <span\n aria-hidden=\"true\"\n className=\"text-[var(--ui-input-text-area-required-color)]\"\n >\n *\n </span>\n )}\n </label>\n )}\n\n <textarea\n ref={ref}\n id={inputId}\n disabled={disabled}\n aria-invalid={invalid || undefined}\n aria-required={required || undefined}\n aria-describedby={hasMessage ? messageId : undefined}\n className={cn(\n 'min-h-[var(--ui-input-text-area-box-height-min)] w-full min-w-0 resize-y rounded-[var(--ui-input-text-area-box-border-radius)] border bg-[var(--ui-input-text-area-box-color-idle)] border-[var(--ui-input-text-area-border-color-idle)] px-[var(--ui-input-text-area-box-padding-x)] py-[var(--ui-input-text-area-box-padding-y)] text-sm leading-6 text-[var(--ui-input-text-area-value-color-idle)] transition-colors placeholder:text-[var(--ui-input-text-area-placeholder-color-idle)] focus-visible:outline-none focus-visible:ring-[3px]',\n 'enabled:not-aria-[invalid=true]:hover:bg-[var(--ui-input-text-area-box-color-hover)] enabled:not-aria-[invalid=true]:hover:border-[var(--ui-input-text-area-border-color-hover)] enabled:hover:text-[var(--ui-input-text-area-value-color-hover)] enabled:hover:placeholder:text-[var(--ui-input-text-area-placeholder-color-hover)]',\n 'not-aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-border-color-focus)] not-aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-primary)]',\n 'aria-[invalid=true]:border-[var(--ui-input-text-area-error-msg-box-border-color-idle)] enabled:aria-[invalid=true]:hover:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:border-[var(--ui-input-text-area-error-msg-box-border-color-hover)] aria-[invalid=true]:focus-visible:ring-[var(--ui-focus-error)]',\n 'disabled:cursor-not-allowed disabled:border-[var(--ui-input-text-area-border-color-disabled)] disabled:bg-[var(--ui-input-text-area-box-color-disabled)] disabled:text-[var(--ui-input-text-area-value-color-disabled)] disabled:placeholder:text-[var(--ui-input-text-area-placeholder-color-disabled)]'\n )}\n {...props}\n />\n\n {hasMessage && (\n <p\n id={messageId}\n className={cn(\n 'text-xs leading-4',\n hasError\n ? 'text-[var(--ui-input-text-area-error-msg-error-color)]'\n : disabled\n ? 'text-[var(--ui-input-text-area-description-color-disabled)]'\n : 'text-[var(--ui-input-text-area-description-color-idle)]'\n )}\n >\n {message}\n </p>\n )}\n </div>\n );\n }\n);\nInputTextArea.displayName = 'InputTextArea';\n\nexport { InputTextArea };\n"],"names":["InputTextArea","React","className","style","id","label","required","description","error","disabled","ariaInvalid","props","ref","reactId","inputId","messageId","hasError","invalid","message","hasMessage","jsxs","cn","jsx"],"mappings":";;;AAmCA,MAAMA,IAAgBC,EAAM;AAAA,EAC1B,CACE;AAAA,IACE,WAAAC;AAAA,IACA,OAAAC;AAAA,IACA,IAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,aAAAC;AAAA,IACA,OAAAC;AAAA,IACA,UAAAC;AAAA,IACA,gBAAgBC;AAAA,IAChB,GAAGC;AAAA,EAAA,GAELC,MACG;AACH,UAAMC,IAAUZ,EAAM,MAAA,GAChBa,IAAUV,KAAMS,GAChBE,IAAY,GAAGD,CAAO,YAEtBE,IAAWR,KAAS,QAAQA,MAAU,IACtCS,IAAUD,KAAYN,GACtBQ,IAAUF,IAAWR,IAAQD,GAC7BY,IAAaD,KAAW,QAAQA,MAAY;AAElD,WACE,gBAAAE;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,WAAWC;AAAA,UACT;AAAA,UACAnB;AAAA,QAAA;AAAA,QAEF,OAAAC;AAAA,QAEC,UAAA;AAAA,UAAAE,KAAS,QAAQA,MAAU,MAC1B,gBAAAe;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,SAASN;AAAA,cACT,WAAWO;AAAA,gBACT;AAAA,gBACAZ,IACI,0DACA;AAAA,cAAA;AAAA,cAGL,UAAA;AAAA,gBAAAJ;AAAA,gBACAC,KACC,gBAAAgB;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,eAAY;AAAA,oBACZ,WAAU;AAAA,oBACX,UAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAED;AAAA,YAAA;AAAA,UAAA;AAAA,UAKN,gBAAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,KAAAV;AAAA,cACA,IAAIE;AAAA,cACJ,UAAAL;AAAA,cACA,gBAAcQ,KAAW;AAAA,cACzB,iBAAeX,KAAY;AAAA,cAC3B,oBAAkBa,IAAaJ,IAAY;AAAA,cAC3C,WAAWM;AAAA,gBACT;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,gBACA;AAAA,cAAA;AAAA,cAED,GAAGV;AAAA,YAAA;AAAA,UAAA;AAAA,UAGLQ,KACC,gBAAAG;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,IAAIP;AAAA,cACJ,WAAWM;AAAA,gBACT;AAAA,gBACAL,IACI,2DACAP,IACE,gEACA;AAAA,cAAA;AAAA,cAGP,UAAAS;AAAA,YAAA;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA;AAAA,EAIR;AACF;AACAlB,EAAc,cAAc;"}
|
|
@@ -1,39 +1,54 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { mergeProps as
|
|
4
|
-
import { useRender as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
1
|
+
import { jsxs as d, Fragment as x, jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { mergeProps as g } from "@base-ui/react/merge-props";
|
|
4
|
+
import { useRender as k } from "@base-ui/react/use-render";
|
|
5
|
+
import { cva as b } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
|
|
6
|
+
import { SquareArrowUpRightIcon as p } from "@acronis-platform/icons-react/stroke-mono";
|
|
7
|
+
import { cn as f } from "../../../lib/utils.js";
|
|
8
|
+
const h = b(
|
|
9
|
+
"inline-flex items-center gap-[var(--ui-link-global-container-gap)] rounded-sm text-sm font-semibold leading-6 outline-none transition-colors [&_svg]:size-4 [&_svg]:shrink-0 [text-decoration:var(--ui-link-global-text-decoration-idle)] hover:[text-decoration:var(--ui-link-global-text-decoration-hover)] active:[text-decoration:var(--ui-link-global-text-decoration-active)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] aria-disabled:pointer-events-none aria-disabled:[text-decoration:var(--ui-link-global-text-decoration-disabled)]",
|
|
10
|
+
{
|
|
11
|
+
variants: {
|
|
12
|
+
variant: {
|
|
13
|
+
normal: "text-[var(--ui-link-normal-text-color-idle)] [&_svg]:text-[var(--ui-link-normal-external-icon-color-idle)] hover:text-[var(--ui-link-normal-text-color-hover)] hover:[&_svg]:text-[var(--ui-link-normal-external-icon-color-hover)] active:text-[var(--ui-link-normal-text-color-active)] active:[&_svg]:text-[var(--ui-link-normal-external-icon-color-active)] aria-disabled:text-[var(--ui-link-normal-text-color-disabled)] aria-disabled:[&_svg]:text-[var(--ui-link-normal-external-icon-color-disabled)]",
|
|
14
|
+
// Text color only — no icon classes (the surface has no external icon) and no
|
|
15
|
+
// `aria-disabled:` color: Figma marks the disabled state unsupported on a
|
|
16
|
+
// backdrop ("disable state not supported onBackdrop") and the tier ships no
|
|
17
|
+
// `--ui-link-inverse-*-disabled` token to reference. `disabled` still renders
|
|
18
|
+
// the link inert; only its color stays at the idle value.
|
|
19
|
+
inverse: "text-[var(--ui-link-inverse-text-color-idle)] hover:text-[var(--ui-link-inverse-text-color-hover)] active:text-[var(--ui-link-inverse-text-color-active)]"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
defaultVariants: {
|
|
23
|
+
variant: "normal"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
), _ = u.forwardRef(
|
|
27
|
+
({ className: o, variant: i, external: t, disabled: a, href: n, children: l, render: s, ...v }, c) => {
|
|
28
|
+
const r = i === "inverse", e = a && !r;
|
|
29
|
+
return k({
|
|
30
|
+
render: s,
|
|
31
|
+
ref: c,
|
|
32
|
+
defaultTagName: "a",
|
|
33
|
+
props: g(
|
|
34
|
+
{
|
|
35
|
+
className: f(h({ variant: i }), o),
|
|
36
|
+
href: e ? void 0 : n,
|
|
37
|
+
"aria-disabled": e || void 0,
|
|
38
|
+
tabIndex: e ? -1 : void 0,
|
|
39
|
+
children: /* @__PURE__ */ d(x, { children: [
|
|
40
|
+
l,
|
|
41
|
+
t && !r && /* @__PURE__ */ m(p, { size: 16 })
|
|
42
|
+
] })
|
|
43
|
+
},
|
|
44
|
+
v
|
|
45
|
+
)
|
|
46
|
+
});
|
|
47
|
+
}
|
|
34
48
|
);
|
|
35
|
-
|
|
49
|
+
_.displayName = "Link";
|
|
36
50
|
export {
|
|
37
|
-
|
|
51
|
+
_ as Link,
|
|
52
|
+
h as linkVariants
|
|
38
53
|
};
|
|
39
54
|
//# sourceMappingURL=link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sources":["../../../../src/components/ui/link/link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { SquareArrowUpRightIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"Link\" component: an inline text link (semibold, 14/24) with
|
|
1
|
+
{"version":3,"file":"link.js","sources":["../../../../src/components/ui/link/link.tsx"],"sourcesContent":["import * as React from 'react';\nimport { mergeProps } from '@base-ui/react/merge-props';\nimport { useRender } from '@base-ui/react/use-render';\nimport { cva, type VariantProps } from 'class-variance-authority';\nimport { SquareArrowUpRightIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Mirrors the Figma \"Link\" component set: an inline text link (semibold, 14/24) with\n// an optional trailing external-link icon (`external`). Themed by the `--ui-link-*`\n// tier, whose per-surface sets map to the Figma `background` variant — `normal` for\n// ordinary surfaces, `inverse` for links over a backdrop/scrim. Each state wires its\n// own text color (`--ui-link-<surface>-text-color-*`); on `normal` the external icon\n// gets its own color too (`--ui-link-normal-external-icon-color-*`, kept separate from\n// the text per the tier). Text decoration is shared across surfaces\n// (`--ui-link-global-text-decoration-*`; underline on hover only). Focus paints a 3px\n// `--ui-focus-primary` ring on both surfaces. Polymorphic via Base UI `useRender` —\n// pass `render` to render a router `Link` instead of the default `<a>`.\n//\n// Two things the `inverse` surface deliberately does NOT have, both per the Figma set,\n// and both therefore inert props there rather than half-applied ones:\n// - No external icon: the `SquareArrowUpRight` layer exists only in the five\n// `background=normal` variants, so `external` renders nothing — same as toggling\n// Figma's `External` on an inverse instance. tokens-pd does emit\n// `--ui-link-inverse-external-icon-color-*`, but the design never uses it, so it is\n// left unreferenced rather than used to invent an icon.\n// - No disabled state: the Figma set has only four enabled inverse variants and marks\n// the fifth unsupported (\"disable state not supported onBackdrop\"), so `disabled` is\n// discarded rather than applied without its color. Consumers that need an inert link\n// on a backdrop should omit it instead.\n//\n// The Figma container has a fixed 32px height for grid alignment\n// (`--ui-link-global-container-height`); it is intentionally NOT applied here so the\n// link flows inline within prose.\nconst linkVariants = cva(\n 'inline-flex items-center gap-[var(--ui-link-global-container-gap)] rounded-sm text-sm font-semibold leading-6 outline-none transition-colors [&_svg]:size-4 [&_svg]:shrink-0 [text-decoration:var(--ui-link-global-text-decoration-idle)] hover:[text-decoration:var(--ui-link-global-text-decoration-hover)] active:[text-decoration:var(--ui-link-global-text-decoration-active)] focus-visible:ring-[3px] focus-visible:ring-[var(--ui-focus-primary)] aria-disabled:pointer-events-none aria-disabled:[text-decoration:var(--ui-link-global-text-decoration-disabled)]',\n {\n variants: {\n variant: {\n normal:\n 'text-[var(--ui-link-normal-text-color-idle)] [&_svg]:text-[var(--ui-link-normal-external-icon-color-idle)] hover:text-[var(--ui-link-normal-text-color-hover)] hover:[&_svg]:text-[var(--ui-link-normal-external-icon-color-hover)] active:text-[var(--ui-link-normal-text-color-active)] active:[&_svg]:text-[var(--ui-link-normal-external-icon-color-active)] aria-disabled:text-[var(--ui-link-normal-text-color-disabled)] aria-disabled:[&_svg]:text-[var(--ui-link-normal-external-icon-color-disabled)]',\n // Text color only — no icon classes (the surface has no external icon) and no\n // `aria-disabled:` color: Figma marks the disabled state unsupported on a\n // backdrop (\"disable state not supported onBackdrop\") and the tier ships no\n // `--ui-link-inverse-*-disabled` token to reference. `disabled` still renders\n // the link inert; only its color stays at the idle value.\n inverse:\n 'text-[var(--ui-link-inverse-text-color-idle)] hover:text-[var(--ui-link-inverse-text-color-hover)] active:text-[var(--ui-link-inverse-text-color-active)]',\n },\n },\n defaultVariants: {\n variant: 'normal',\n },\n }\n);\n\nexport interface LinkProps\n extends React.AnchorHTMLAttributes<HTMLAnchorElement>,\n VariantProps<typeof linkVariants> {\n /**\n * Which surface the link sits on (Figma's `background`): `normal` for ordinary\n * surfaces, `inverse` for a backdrop/scrim or other dark brand surface.\n */\n variant?: 'normal' | 'inverse';\n /**\n * Append a trailing external-link icon (e.g. for links that leave the app).\n * Has no effect on `variant=\"inverse\"` — the design defines no external icon for\n * links on a backdrop.\n */\n external?: boolean;\n /**\n * Render the link inert: disabled color, removed from the tab order, no navigation.\n * Ignored entirely on `variant=\"inverse\"` — the design defines no disabled state on\n * a backdrop, so the link renders exactly as an enabled one (still navigable and\n * focusable). Omit the link, or use `variant=\"normal\"`, when you need it inert.\n */\n disabled?: boolean;\n /**\n * Replace the rendered `<a>` with another element or component (Base UI\n * composition) — e.g. a router `Link`. Props and class names are merged onto it.\n */\n render?: useRender.RenderProp;\n}\n\nconst Link = React.forwardRef<HTMLAnchorElement, LinkProps>(\n ({ className, variant, external, disabled, href, children, render, ...props }, ref) => {\n // The `inverse` surface exists only in the four enabled Figma variants, so neither\n // of the two props the design leaves out of it has any effect there: `disabled` is\n // discarded outright (the link stays navigable, focusable and hoverable, with no\n // `aria-disabled`) and `external` renders no icon.\n const isInverse = variant === 'inverse';\n const isDisabled = disabled && !isInverse;\n\n return useRender({\n render,\n ref,\n defaultTagName: 'a',\n props: mergeProps<'a'>(\n {\n className: cn(linkVariants({ variant }), className),\n href: isDisabled ? undefined : href,\n 'aria-disabled': isDisabled || undefined,\n tabIndex: isDisabled ? -1 : undefined,\n children: (\n <>\n {children}\n {external && !isInverse && <SquareArrowUpRightIcon size={16} />}\n </>\n ),\n },\n props\n ),\n });\n }\n);\nLink.displayName = 'Link';\n\nexport { Link, linkVariants };\n"],"names":["linkVariants","cva","Link","React","className","variant","external","disabled","href","children","render","props","ref","isInverse","isDisabled","useRender","mergeProps","cn","jsxs","Fragment","jsx","SquareArrowUpRightIcon"],"mappings":";;;;;;;AAkCA,MAAMA,IAAeC;AAAA,EACnB;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,QACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAMF,SACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,IAAA;AAAA,EACX;AAEJ,GA8BMC,IAAOC,EAAM;AAAA,EACjB,CAAC,EAAE,WAAAC,GAAW,SAAAC,GAAS,UAAAC,GAAU,UAAAC,GAAU,MAAAC,GAAM,UAAAC,GAAU,QAAAC,GAAQ,GAAGC,EAAA,GAASC,MAAQ;AAKrF,UAAMC,IAAYR,MAAY,WACxBS,IAAaP,KAAY,CAACM;AAEhC,WAAOE,EAAU;AAAA,MACf,QAAAL;AAAA,MACA,KAAAE;AAAA,MACA,gBAAgB;AAAA,MAChB,OAAOI;AAAA,QACL;AAAA,UACE,WAAWC,EAAGjB,EAAa,EAAE,SAAAK,EAAA,CAAS,GAAGD,CAAS;AAAA,UAClD,MAAMU,IAAa,SAAYN;AAAA,UAC/B,iBAAiBM,KAAc;AAAA,UAC/B,UAAUA,IAAa,KAAK;AAAA,UAC5B,UACE,gBAAAI,EAAAC,GAAA,EACG,UAAA;AAAA,YAAAV;AAAA,YACAH,KAAY,CAACO,KAAa,gBAAAO,EAACC,GAAA,EAAuB,MAAM,GAAA,CAAI;AAAA,UAAA,EAAA,CAC/D;AAAA,QAAA;AAAA,QAGJV;AAAA,MAAA;AAAA,IACF,CACD;AAAA,EACH;AACF;AACAT,EAAK,cAAc;"}
|
|
@@ -8,7 +8,7 @@ const g = t.Root, b = a.forwardRef(({ className: e, ...r }, o) => /* @__PURE__ *
|
|
|
8
8
|
{
|
|
9
9
|
ref: o,
|
|
10
10
|
className: l(
|
|
11
|
-
"flex h-[var(--ui-input-text-global-box-height)]
|
|
11
|
+
"flex h-[var(--ui-input-text-global-box-height)] min-w-0 items-stretch overflow-hidden rounded-[var(--ui-input-text-global-box-border-radius)] border bg-[var(--ui-input-text-global-box-color-idle)] border-[var(--ui-input-text-normal-box-border-color-idle)] transition-colors",
|
|
12
12
|
"not-has-disabled:hover:border-[var(--ui-input-text-normal-box-border-color-hover)]",
|
|
13
13
|
"has-[input:focus-visible]:border-[var(--ui-input-text-normal-box-border-color-hover)] has-[input:focus-visible]:ring-[3px] has-[input:focus-visible]:ring-[var(--ui-focus-primary)]",
|
|
14
14
|
"has-disabled:cursor-not-allowed has-disabled:border-[var(--ui-input-text-normal-box-border-color-disabled)] has-disabled:bg-[var(--ui-input-text-global-box-color-disabled)]",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"number-field.js","sources":["../../../../src/components/ui/number-field/number-field.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NumberField as NumberFieldPrimitive } from '@base-ui/react/number-field';\nimport { MinusIcon, PlusIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform`'s `number-field`, on Base UI's NumberField\n// (Root / Group / Decrement / Input / Increment). No `--ui-number-field-*` tier —\n// the box reuses the `--ui-input-text-*` tier (already imported) so it matches\n// InputBox / InputText; the steppers use the muted/primary surface + text tokens.\n\nconst NumberField = NumberFieldPrimitive.Root;\n\n// The bordered box wrapping the steppers + input. Mirrors the InputBox field box\n// (height / radius / border / bg / hover / focus-within ring / disabled / invalid).\nconst NumberFieldGroup = React.forwardRef<\n React.ElementRef<typeof NumberFieldPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <NumberFieldPrimitive.Group\n ref={ref}\n className={cn(\n 'flex h-[var(--ui-input-text-global-box-height)]
|
|
1
|
+
{"version":3,"file":"number-field.js","sources":["../../../../src/components/ui/number-field/number-field.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { NumberField as NumberFieldPrimitive } from '@base-ui/react/number-field';\nimport { MinusIcon, PlusIcon } from '@acronis-platform/icons-react/stroke-mono';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform`'s `number-field`, on Base UI's NumberField\n// (Root / Group / Decrement / Input / Increment). No `--ui-number-field-*` tier —\n// the box reuses the `--ui-input-text-*` tier (already imported) so it matches\n// InputBox / InputText; the steppers use the muted/primary surface + text tokens.\n\nconst NumberField = NumberFieldPrimitive.Root;\n\n// The bordered box wrapping the steppers + input. Mirrors the InputBox field box\n// (height / radius / border / bg / hover / focus-within ring / disabled / invalid).\nconst NumberFieldGroup = React.forwardRef<\n React.ElementRef<typeof NumberFieldPrimitive.Group>,\n React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Group>\n>(({ className, ...props }, ref) => (\n <NumberFieldPrimitive.Group\n ref={ref}\n className={cn(\n 'flex h-[var(--ui-input-text-global-box-height)] min-w-0 items-stretch overflow-hidden rounded-[var(--ui-input-text-global-box-border-radius)] border bg-[var(--ui-input-text-global-box-color-idle)] border-[var(--ui-input-text-normal-box-border-color-idle)] transition-colors',\n 'not-has-disabled:hover:border-[var(--ui-input-text-normal-box-border-color-hover)]',\n 'has-[input:focus-visible]:border-[var(--ui-input-text-normal-box-border-color-hover)] has-[input:focus-visible]:ring-[3px] has-[input:focus-visible]:ring-[var(--ui-focus-primary)]',\n 'has-disabled:cursor-not-allowed has-disabled:border-[var(--ui-input-text-normal-box-border-color-disabled)] has-disabled:bg-[var(--ui-input-text-global-box-color-disabled)]',\n 'has-[input[aria-invalid=true]]:border-[var(--ui-input-text-error-msg-box-border-color-idle)] has-[input[aria-invalid=true]:focus-visible]:ring-[var(--ui-focus-error)]',\n className\n )}\n {...props}\n />\n));\nNumberFieldGroup.displayName = 'NumberFieldGroup';\n\nconst NumberFieldInput = React.forwardRef<\n React.ElementRef<typeof NumberFieldPrimitive.Input>,\n React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Input>\n>(({ className, ...props }, ref) => (\n <NumberFieldPrimitive.Input\n ref={ref}\n className={cn(\n 'min-w-0 flex-1 bg-transparent px-[var(--ui-input-text-global-box-padding-x)] text-center text-sm leading-6 text-[var(--ui-input-text-global-value-color-idle)] outline-none placeholder:text-[var(--ui-input-text-global-placeholder-color-idle)] disabled:cursor-not-allowed disabled:text-[var(--ui-input-text-global-value-color-disabled)]',\n className\n )}\n {...props}\n />\n));\nNumberFieldInput.displayName = 'NumberFieldInput';\n\nconst stepperClassName =\n 'flex w-9 shrink-0 cursor-pointer items-center justify-center text-[var(--ui-text-on-surface-secondary)] transition-colors not-disabled:hover:bg-[var(--ui-background-surface-hover)] not-disabled:hover:text-[var(--ui-text-on-surface-primary)] disabled:cursor-not-allowed disabled:text-[var(--ui-text-on-surface-disabled)]';\n\nconst NumberFieldDecrement = React.forwardRef<\n React.ElementRef<typeof NumberFieldPrimitive.Decrement>,\n React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Decrement>\n>(({ className, children, ...props }, ref) => (\n <NumberFieldPrimitive.Decrement\n ref={ref}\n className={cn(stepperClassName, className)}\n {...props}\n >\n {children ?? <MinusIcon size={16} />}\n </NumberFieldPrimitive.Decrement>\n));\nNumberFieldDecrement.displayName = 'NumberFieldDecrement';\n\nconst NumberFieldIncrement = React.forwardRef<\n React.ElementRef<typeof NumberFieldPrimitive.Increment>,\n React.ComponentPropsWithoutRef<typeof NumberFieldPrimitive.Increment>\n>(({ className, children, ...props }, ref) => (\n <NumberFieldPrimitive.Increment\n ref={ref}\n className={cn(stepperClassName, className)}\n {...props}\n >\n {children ?? <PlusIcon size={16} />}\n </NumberFieldPrimitive.Increment>\n));\nNumberFieldIncrement.displayName = 'NumberFieldIncrement';\n\nexport {\n NumberField,\n NumberFieldGroup,\n NumberFieldInput,\n NumberFieldDecrement,\n NumberFieldIncrement,\n};\n"],"names":["NumberField","NumberFieldPrimitive","NumberFieldGroup","React","className","props","ref","jsx","cn","NumberFieldInput","stepperClassName","NumberFieldDecrement","children","MinusIcon","NumberFieldIncrement","PlusIcon"],"mappings":";;;;;AAaA,MAAMA,IAAcC,EAAqB,MAInCC,IAAmBC,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACN,EAAqB;AAAA,EAArB;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDH,EAAiB,cAAc;AAE/B,MAAMO,IAAmBN,EAAM,WAG7B,CAAC,EAAE,WAAAC,GAAW,GAAGC,EAAA,GAASC,MAC1B,gBAAAC;AAAA,EAACN,EAAqB;AAAA,EAArB;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE;AAAA,MACT;AAAA,MACAJ;AAAA,IAAA;AAAA,IAED,GAAGC;AAAA,EAAA;AACN,CACD;AACDI,EAAiB,cAAc;AAE/B,MAAMC,IACJ,mUAEIC,IAAuBR,EAAM,WAGjC,CAAC,EAAE,WAAAC,GAAW,UAAAQ,GAAU,GAAGP,KAASC,MACpC,gBAAAC;AAAA,EAACN,EAAqB;AAAA,EAArB;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE,EAAGE,GAAkBN,CAAS;AAAA,IACxC,GAAGC;AAAA,IAEH,UAAAO,KAAY,gBAAAL,EAACM,GAAA,EAAU,MAAM,GAAA,CAAI;AAAA,EAAA;AACpC,CACD;AACDF,EAAqB,cAAc;AAEnC,MAAMG,IAAuBX,EAAM,WAGjC,CAAC,EAAE,WAAAC,GAAW,UAAAQ,GAAU,GAAGP,KAASC,MACpC,gBAAAC;AAAA,EAACN,EAAqB;AAAA,EAArB;AAAA,IACC,KAAAK;AAAA,IACA,WAAWE,EAAGE,GAAkBN,CAAS;AAAA,IACxC,GAAGC;AAAA,IAEH,UAAAO,KAAY,gBAAAL,EAACQ,GAAA,EAAS,MAAM,GAAA,CAAI;AAAA,EAAA;AACnC,CACD;AACDD,EAAqB,cAAc;"}
|