@companix/uikit 0.0.36 → 0.0.37
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/Avatar/Avatar.scss +64 -0
- package/dist/Avatar/helpers.d.ts +10 -0
- package/dist/Avatar/index.d.ts +8 -0
- package/dist/Avatar/types.d.ts +2 -0
- package/dist/Button/Button.scss +128 -0
- package/dist/Button/index.d.ts +21 -0
- package/dist/ButtonGroup/ButtonGroup.scss +18 -0
- package/dist/ButtonGroup/index.d.ts +6 -0
- package/dist/Calendar/Calendar.d.ts +14 -0
- package/dist/Calendar/Calendar.scss +125 -0
- package/dist/Calendar/CalendarHeader.d.ts +10 -0
- package/dist/Checkbox/Checkbox.scss +115 -0
- package/dist/Checkbox/index.d.ts +10 -0
- package/dist/Countdown/index.d.ts +6 -0
- package/dist/DateInput/DateInput.scss +11 -0
- package/dist/DateInput/index.d.ts +13 -0
- package/dist/DatePicker/index.d.ts +9 -0
- package/dist/Dialog/Dialog.scss +25 -0
- package/dist/Dialog/Popup.scss +55 -0
- package/dist/Dialog/index.d.ts +16 -0
- package/dist/DialogAlert/Alert.d.ts +19 -0
- package/dist/DialogAlert/Alert.scss +52 -0
- package/dist/DialogAlert/Viewport.d.ts +8 -0
- package/dist/DialogAlert/index.d.ts +11 -0
- package/dist/Drawer/Drawer.scss +112 -0
- package/dist/Drawer/index.d.ts +13 -0
- package/dist/File/index.d.ts +10 -0
- package/dist/FormGroup/FormGroup.scss +32 -0
- package/dist/FormGroup/index.d.ts +9 -0
- package/dist/Icon/icon.scss +18 -0
- package/dist/Icon/index.d.ts +7 -0
- package/dist/Input/Form.scss +67 -0
- package/dist/Input/InlineInput.d.ts +0 -0
- package/dist/Input/Input.d.ts +14 -0
- package/dist/Input/Input.scss +47 -0
- package/dist/Input/InputContainer.d.ts +11 -0
- package/dist/Input/InputElement.d.ts +9 -0
- package/dist/LoadingButton/index.d.ts +5 -0
- package/dist/NumberInput/index.d.ts +23 -0
- package/dist/OptionItem/Option.scss +89 -0
- package/dist/OptionItem/OptionItem.d.ts +6 -0
- package/dist/OptionItem/OptionsList.d.ts +7 -0
- package/dist/Popover/Popover.scss +80 -0
- package/dist/Popover/index.d.ts +27 -0
- package/dist/Progress/Progress.scss +47 -0
- package/dist/Progress/index.d.ts +5 -0
- package/dist/Radio/Radio.scss +148 -0
- package/dist/Radio/index.d.ts +20 -0
- package/dist/Scrollable/ImitateScroll.d.ts +10 -0
- package/dist/Scrollable/Scrollable.scss +50 -0
- package/dist/Scrollable/index.d.ts +33 -0
- package/dist/Segments/Segments.scss +57 -0
- package/dist/Segments/index.d.ts +11 -0
- package/dist/Select/Select.scss +80 -0
- package/dist/Select/SelectInput.d.ts +15 -0
- package/dist/Select/SelectOptions.d.ts +12 -0
- package/dist/Select/SelectRight.d.ts +8 -0
- package/dist/Select/index.d.ts +24 -0
- package/dist/SelectTags/SelectTags.scss +67 -0
- package/dist/SelectTags/index.d.ts +17 -0
- package/dist/Spinner/Spinner.scss +14 -0
- package/dist/Spinner/index.d.ts +7 -0
- package/dist/Switch/Switch.scss +102 -0
- package/dist/Switch/index.d.ts +10 -0
- package/dist/Tabs/Tabs.scss +58 -0
- package/dist/Tabs/index.d.ts +13 -0
- package/dist/TextArea/TextArea.scss +34 -0
- package/dist/TextArea/index.d.ts +7 -0
- package/dist/ThemeProvider/helpers.d.ts +4 -0
- package/dist/ThemeProvider/index.d.ts +12 -0
- package/dist/ThemeProvider/script.d.ts +8 -0
- package/dist/ThemeProvider/types.d.ts +2 -0
- package/dist/TimePicker/index.d.ts +10 -0
- package/dist/Toaster/Toast.d.ts +15 -0
- package/dist/Toaster/Toaster.scss +155 -0
- package/dist/Toaster/Viewport.d.ts +13 -0
- package/dist/Toaster/index.d.ts +20 -0
- package/dist/Tooltip/Tooltip.scss +28 -0
- package/dist/Tooltip/index.d.ts +7 -0
- package/dist/__helpers/createDialogRegistry.d.ts +26 -0
- package/dist/__helpers/createPopoversRegistry.d.ts +19 -0
- package/dist/__hooks/use-frooze-closing.d.ts +5 -0
- package/dist/__hooks/use-input-padding.d.ts +5 -0
- package/dist/__hooks/use-loading.d.ts +8 -0
- package/dist/__hooks/use-local-storage.d.ts +1 -0
- package/dist/__hooks/use-popover-position.d.ts +8 -0
- package/dist/__hooks/use-previos.d.ts +2 -0
- package/dist/__hooks/use-resize.d.ts +3 -0
- package/dist/__hooks/use-scrollbox.d.ts +7 -0
- package/dist/__hooks/use-update.d.ts +1 -0
- package/dist/__hooks/useCalendar.d.ts +17 -0
- package/dist/__hooks/useCalendarOptions-copy.d.ts +22 -0
- package/dist/__hooks/useCalendarOptions.d.ts +31 -0
- package/dist/__libs/calendar.d.ts +25 -0
- package/dist/__utils/RemoveListener.d.ts +3 -0
- package/dist/__utils/utils.d.ts +39 -0
- package/dist/bundle.es.js +88 -0
- package/dist/bundle.es10.js +82 -0
- package/dist/bundle.es11.js +28 -0
- package/dist/bundle.es12.js +77 -0
- package/dist/bundle.es13.js +43 -0
- package/dist/bundle.es14.js +38 -0
- package/dist/bundle.es15.js +58 -0
- package/dist/bundle.es16.js +23 -0
- package/dist/bundle.es17.js +35 -0
- package/dist/bundle.es18.js +27 -0
- package/dist/bundle.es19.js +47 -0
- package/dist/bundle.es2.js +44 -0
- package/dist/bundle.es20.js +25 -0
- package/dist/bundle.es21.js +31 -0
- package/dist/bundle.es22.js +40 -0
- package/dist/bundle.es23.js +18 -0
- package/dist/bundle.es24.js +36 -0
- package/dist/bundle.es25.js +23 -0
- package/dist/bundle.es26.js +44 -0
- package/dist/bundle.es27.js +117 -0
- package/dist/bundle.es28.js +123 -0
- package/dist/bundle.es29.js +76 -0
- package/dist/bundle.es3.js +4 -0
- package/dist/bundle.es30.js +35 -0
- package/dist/bundle.es31.js +14 -0
- package/dist/bundle.es32.js +88 -0
- package/dist/bundle.es33.js +22 -0
- package/dist/bundle.es34.js +9 -0
- package/dist/bundle.es35.js +37 -0
- package/dist/bundle.es36.js +24 -0
- package/dist/bundle.es37.js +13 -0
- package/dist/bundle.es38.js +27 -0
- package/dist/bundle.es39.js +41 -0
- package/dist/bundle.es4.js +47 -0
- package/dist/bundle.es40.js +53 -0
- package/dist/bundle.es41.js +45 -0
- package/dist/bundle.es42.js +11 -0
- package/dist/bundle.es43.js +27 -0
- package/dist/bundle.es44.js +26 -0
- package/dist/bundle.es45.js +89 -0
- package/dist/bundle.es46.js +20 -0
- package/dist/bundle.es47.js +22 -0
- package/dist/bundle.es48.js +26 -0
- package/dist/bundle.es49.js +41 -0
- package/dist/bundle.es5.js +10 -0
- package/dist/bundle.es50.js +7 -0
- package/dist/bundle.es51.js +16 -0
- package/dist/bundle.es52.js +16 -0
- package/dist/bundle.es53.js +72 -0
- package/dist/bundle.es54.js +70 -0
- package/dist/bundle.es55.js +72 -0
- package/dist/bundle.es56.js +13 -0
- package/dist/bundle.es57.js +45 -0
- package/dist/bundle.es58.js +17 -0
- package/dist/bundle.es59.js +34 -0
- package/dist/bundle.es6.js +13 -0
- package/dist/bundle.es60.js +72 -0
- package/dist/bundle.es61.js +16 -0
- package/dist/bundle.es62.js +77 -0
- package/dist/bundle.es63.js +51 -0
- package/dist/bundle.es64.js +16 -0
- package/dist/bundle.es7.js +87 -0
- package/dist/bundle.es8.js +87 -0
- package/dist/bundle.es9.js +24 -0
- package/dist/css-properties.scss +120 -0
- package/dist/index.d.ts +77 -0
- package/dist/index.scss +28 -0
- package/dist/mixins.scss +102 -0
- package/dist/theme.scss +101 -0
- package/dist/types.d.ts +17 -0
- package/package.json +6 -6
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DateFormat } from '..';
|
|
2
|
+
export declare const defaultMax: {
|
|
3
|
+
day: number;
|
|
4
|
+
month: number;
|
|
5
|
+
year: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const defaultMin: {
|
|
8
|
+
day: number;
|
|
9
|
+
month: number;
|
|
10
|
+
year: number;
|
|
11
|
+
};
|
|
12
|
+
interface Options {
|
|
13
|
+
min?: DateFormat;
|
|
14
|
+
max?: DateFormat;
|
|
15
|
+
now: DateFormat;
|
|
16
|
+
}
|
|
17
|
+
export declare const useCalendarOptions: ({ min, max, now }: Options) => {
|
|
18
|
+
years: {
|
|
19
|
+
title: string;
|
|
20
|
+
value: number;
|
|
21
|
+
}[];
|
|
22
|
+
months: {
|
|
23
|
+
title: string;
|
|
24
|
+
value: number;
|
|
25
|
+
}[];
|
|
26
|
+
days: {
|
|
27
|
+
title: string;
|
|
28
|
+
value: number;
|
|
29
|
+
}[];
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { CalendarProps } from '../Calendar/Calendar';
|
|
2
|
+
export declare function isSameDate(d1: Date, d2: Date): boolean;
|
|
3
|
+
export declare const MONDAY = 1;
|
|
4
|
+
export declare function startOfWeek(date: Date, { weekStartsOn }: {
|
|
5
|
+
weekStartsOn?: number | undefined;
|
|
6
|
+
}): Date;
|
|
7
|
+
export declare function endOfWeek(date: Date, { weekStartsOn }: {
|
|
8
|
+
weekStartsOn?: number | undefined;
|
|
9
|
+
}): Date;
|
|
10
|
+
export declare function startOfDay(date: Date): Date;
|
|
11
|
+
export declare function endOfDay(date: Date): Date;
|
|
12
|
+
export declare function isDayMinMaxRestricted(day: Date, options?: {
|
|
13
|
+
min?: Date;
|
|
14
|
+
max?: Date;
|
|
15
|
+
withTime?: boolean;
|
|
16
|
+
}): boolean;
|
|
17
|
+
export declare function addMonths(date: Date, amount: number): Date;
|
|
18
|
+
export declare function subMonths(date: Date, amount: number): Date;
|
|
19
|
+
export declare function setYear(date: Date, year: number): Date;
|
|
20
|
+
export declare function setMonth(date: Date, month: number): Date;
|
|
21
|
+
interface DisableOptions extends Pick<CalendarProps, 'disableFuture' | 'disablePast' | 'maxDateTime' | 'minDateTime' | 'shouldDisableDate'> {
|
|
22
|
+
}
|
|
23
|
+
export declare const createDayDisableChecker: (options: DisableOptions) => (day: Date, withTime?: boolean) => boolean;
|
|
24
|
+
export declare const useDayDisableCheker: (options: DisableOptions) => (day: Date, withTime?: boolean) => boolean;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { DateFormat, Option, TimeFormat } from '..';
|
|
2
|
+
export declare const getMonthMaxDay: (month: number, year: number) => number;
|
|
3
|
+
export declare const getFirstDay: (month: number, year: number) => number;
|
|
4
|
+
export declare const getDayIndex: (day: number) => number;
|
|
5
|
+
export declare const createVoids: (length: number) => any[];
|
|
6
|
+
export declare const dateToFormat: (date: Date) => DateFormat;
|
|
7
|
+
export declare const createDateValidation: ({ min, max }: {
|
|
8
|
+
min: DateFormat;
|
|
9
|
+
max: DateFormat;
|
|
10
|
+
}) => (value: DateFormat) => DateFormat | undefined;
|
|
11
|
+
export declare const createRangeValidation: ({ min, max }: {
|
|
12
|
+
min?: DateFormat;
|
|
13
|
+
max?: DateFormat;
|
|
14
|
+
}) => {
|
|
15
|
+
isDateMinValid: (value: DateFormat) => boolean;
|
|
16
|
+
isDateMaxValid: (value: DateFormat) => boolean;
|
|
17
|
+
isDateInRange: (value: DateFormat) => boolean;
|
|
18
|
+
};
|
|
19
|
+
export declare const formatToDate: (format: DateFormat) => Date;
|
|
20
|
+
export declare const weeks: string[];
|
|
21
|
+
export declare const DefaultMonths: string[];
|
|
22
|
+
export declare const DEFAULT_MAX_YEAR = 9999;
|
|
23
|
+
export declare const DEFAULT_MIN_YEAR = 100;
|
|
24
|
+
export declare const getYears: (currentYear: number, range: number) => Option<number>[];
|
|
25
|
+
export declare const getMonths: (locale?: string) => Option<number>[];
|
|
26
|
+
export declare const removeDigits: (value: string, signs: string[]) => string;
|
|
27
|
+
export declare const convertTimeToOption: ({ hours, minutes }: TimeFormat, char?: string) => string;
|
|
28
|
+
interface TimeOption extends Option<string> {
|
|
29
|
+
hours: string;
|
|
30
|
+
minutes: string;
|
|
31
|
+
}
|
|
32
|
+
export declare const getTimeValue: (time: TimeFormat, char?: string) => {
|
|
33
|
+
title: string;
|
|
34
|
+
value: string;
|
|
35
|
+
hours: string;
|
|
36
|
+
minutes: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const getTimesOptions: (step: number, char?: string) => TimeOption[];
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Avatar as e } from "./bundle.es2.js";
|
|
2
|
+
import { avatarSizes as p } from "./bundle.es3.js";
|
|
3
|
+
import { Button as x } from "./bundle.es4.js";
|
|
4
|
+
import { ButtonGroup as a } from "./bundle.es5.js";
|
|
5
|
+
import { Spinner as l } from "./bundle.es6.js";
|
|
6
|
+
import { Scrollable as n } from "./bundle.es7.js";
|
|
7
|
+
import { ImitateScroll as S } from "./bundle.es8.js";
|
|
8
|
+
import { Segments as g } from "./bundle.es9.js";
|
|
9
|
+
import { Popover as h } from "./bundle.es10.js";
|
|
10
|
+
import { Tooltip as v } from "./bundle.es11.js";
|
|
11
|
+
import { Select as P } from "./bundle.es12.js";
|
|
12
|
+
import { Input as A } from "./bundle.es13.js";
|
|
13
|
+
import { OptionItem as B } from "./bundle.es14.js";
|
|
14
|
+
import { NumberInput as k } from "./bundle.es15.js";
|
|
15
|
+
import { OptionsList as y } from "./bundle.es16.js";
|
|
16
|
+
import { Checkbox as G } from "./bundle.es17.js";
|
|
17
|
+
import { Switch as O } from "./bundle.es18.js";
|
|
18
|
+
import { Radio as z, RadioGroup as N } from "./bundle.es19.js";
|
|
19
|
+
import { Drawer as q } from "./bundle.es20.js";
|
|
20
|
+
import { Dialog as H } from "./bundle.es21.js";
|
|
21
|
+
import { AlertDialog as K } from "./bundle.es22.js";
|
|
22
|
+
import { LoadingButton as Q } from "./bundle.es23.js";
|
|
23
|
+
import { Tabs as V } from "./bundle.es24.js";
|
|
24
|
+
import { Countdown as X } from "./bundle.es25.js";
|
|
25
|
+
import { TextArea as Z } from "./bundle.es26.js";
|
|
26
|
+
import { SelectTags as $ } from "./bundle.es27.js";
|
|
27
|
+
import { DatePicker as ro } from "./bundle.es28.js";
|
|
28
|
+
import { DateInput as to } from "./bundle.es29.js";
|
|
29
|
+
import { FileOverlay as mo } from "./bundle.es30.js";
|
|
30
|
+
import { FormGroup as fo } from "./bundle.es31.js";
|
|
31
|
+
import { TimePicker as io } from "./bundle.es32.js";
|
|
32
|
+
import { Icon as co } from "./bundle.es33.js";
|
|
33
|
+
import { ProgressBar as so } from "./bundle.es34.js";
|
|
34
|
+
import { ThemeProvider as uo, useTheme as go } from "./bundle.es35.js";
|
|
35
|
+
import { ColorSchemeScript as ho, colorSchemeScript as Do } from "./bundle.es36.js";
|
|
36
|
+
import { useLocalStorage as Io } from "./bundle.es37.js";
|
|
37
|
+
import { createAlertAgent as Ao } from "./bundle.es38.js";
|
|
38
|
+
import { createToaster as Bo } from "./bundle.es39.js";
|
|
39
|
+
import { Toast as ko } from "./bundle.es40.js";
|
|
40
|
+
import { DialogShell as yo, createDialogsRegistry as Co } from "./bundle.es41.js";
|
|
41
|
+
import { createPopoversRegistry as Lo } from "./bundle.es42.js";
|
|
42
|
+
export {
|
|
43
|
+
K as AlertDialog,
|
|
44
|
+
e as Avatar,
|
|
45
|
+
x as Button,
|
|
46
|
+
a as ButtonGroup,
|
|
47
|
+
G as Checkbox,
|
|
48
|
+
ho as ColorSchemeScript,
|
|
49
|
+
X as Countdown,
|
|
50
|
+
to as DateInput,
|
|
51
|
+
ro as DatePicker,
|
|
52
|
+
H as Dialog,
|
|
53
|
+
yo as DialogShell,
|
|
54
|
+
q as Drawer,
|
|
55
|
+
mo as FileOverlay,
|
|
56
|
+
fo as FormGroup,
|
|
57
|
+
co as Icon,
|
|
58
|
+
S as ImitateScroll,
|
|
59
|
+
A as Input,
|
|
60
|
+
Q as LoadingButton,
|
|
61
|
+
k as NumberInput,
|
|
62
|
+
B as OptionItem,
|
|
63
|
+
y as OptionsList,
|
|
64
|
+
h as Popover,
|
|
65
|
+
so as ProgressBar,
|
|
66
|
+
z as Radio,
|
|
67
|
+
N as RadioGroup,
|
|
68
|
+
n as Scrollable,
|
|
69
|
+
g as Segments,
|
|
70
|
+
P as Select,
|
|
71
|
+
$ as SelectTags,
|
|
72
|
+
l as Spinner,
|
|
73
|
+
O as Switch,
|
|
74
|
+
V as Tabs,
|
|
75
|
+
Z as TextArea,
|
|
76
|
+
uo as ThemeProvider,
|
|
77
|
+
io as TimePicker,
|
|
78
|
+
ko as Toast,
|
|
79
|
+
v as Tooltip,
|
|
80
|
+
p as avatarSizes,
|
|
81
|
+
Do as colorSchemeScript,
|
|
82
|
+
Ao as createAlertAgent,
|
|
83
|
+
Co as createDialogsRegistry,
|
|
84
|
+
Lo as createPopoversRegistry,
|
|
85
|
+
Bo as createToaster,
|
|
86
|
+
Io as useLocalStorage,
|
|
87
|
+
go as useTheme
|
|
88
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { jsxs as t, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "@radix-ui/react-popover";
|
|
3
|
+
import { attr as B } from "@companix/utils-browser";
|
|
4
|
+
import M from "classnames";
|
|
5
|
+
import { forwardRef as j, useRef as k } from "react";
|
|
6
|
+
const D = j((a, i) => {
|
|
7
|
+
const {
|
|
8
|
+
children: n,
|
|
9
|
+
sideOffset: s,
|
|
10
|
+
matchTarget: l,
|
|
11
|
+
onAnimationEnd: c,
|
|
12
|
+
onAnimationStart: m,
|
|
13
|
+
onOpenAutoFocus: d,
|
|
14
|
+
onCloseAutoFocus: f,
|
|
15
|
+
triggerRef: p,
|
|
16
|
+
triggerProps: h,
|
|
17
|
+
open: g,
|
|
18
|
+
content: u,
|
|
19
|
+
onOpenChange: v,
|
|
20
|
+
align: C,
|
|
21
|
+
disabled: x,
|
|
22
|
+
minimal: w,
|
|
23
|
+
className: L,
|
|
24
|
+
fitMaxHeight: N = !0,
|
|
25
|
+
zIndex: O = 100,
|
|
26
|
+
side: A,
|
|
27
|
+
showArrows: P
|
|
28
|
+
} = a, e = k(null), b = () => {
|
|
29
|
+
e.current && e.current.click();
|
|
30
|
+
}, y = (R) => {
|
|
31
|
+
x && R.preventDefault();
|
|
32
|
+
};
|
|
33
|
+
return /* @__PURE__ */ t(o.Root, { open: g, onOpenChange: v, children: [
|
|
34
|
+
/* @__PURE__ */ r(o.Trigger, { ref: p, ...h, onClick: y, asChild: !0, children: n }),
|
|
35
|
+
/* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ t(
|
|
36
|
+
o.Content,
|
|
37
|
+
{
|
|
38
|
+
ref: i,
|
|
39
|
+
className: M("popover", L),
|
|
40
|
+
side: A,
|
|
41
|
+
align: C,
|
|
42
|
+
"data-appearance": w ? "minimal" : "default",
|
|
43
|
+
"data-match-target": l,
|
|
44
|
+
sideOffset: s ?? 6,
|
|
45
|
+
avoidCollisions: !0,
|
|
46
|
+
arrowPadding: 10,
|
|
47
|
+
style: { zIndex: O },
|
|
48
|
+
onAnimationStart: m,
|
|
49
|
+
onAnimationEnd: c,
|
|
50
|
+
onOpenAutoFocus: d,
|
|
51
|
+
onCloseAutoFocus: f,
|
|
52
|
+
children: [
|
|
53
|
+
/* @__PURE__ */ r(o.Close, { ref: e, style: { display: "none" } }),
|
|
54
|
+
P && /* @__PURE__ */ r(o.Arrow, { width: 30, height: 11, asChild: !0, children: /* @__PURE__ */ r("div", { className: "popover-arrow", children: /* @__PURE__ */ t("svg", { className: "popover-arrow-icon", viewBox: "0 0 30 11", width: 30, height: 11, children: [
|
|
55
|
+
/* @__PURE__ */ r(
|
|
56
|
+
"path",
|
|
57
|
+
{
|
|
58
|
+
className: "popover-arrow-border",
|
|
59
|
+
d: "M 18.112 -2.704 C 19.127 -3.64 19.999 -5.626 19.999 -7.001 L 19.999 18.999 C 19.999 17.621 19.131 15.642 18.111 14.702 L 10.927 8.084 C 9.69 6.944 9.694 5.05 10.927 3.914 L 18.112 -2.704 Z",
|
|
60
|
+
style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
|
|
61
|
+
transform: "matrix(0, -1, 1, 0, 0.000001, 0)"
|
|
62
|
+
}
|
|
63
|
+
),
|
|
64
|
+
/* @__PURE__ */ r(
|
|
65
|
+
"path",
|
|
66
|
+
{
|
|
67
|
+
className: "popover-arrow-fill",
|
|
68
|
+
d: "M 17.789 -2.965 C 19.009 -4.09 19.999 -6.341 19.999 -7.995 L 19.999 -10.001 L 19.999 19.999 L 19.999 17.994 C 19.999 16.34 19.016 14.094 17.789 12.964 L 10.606 6.348 C 9.796 5.602 9.804 4.388 10.606 3.648 L 17.789 -2.966 L 17.789 -2.965 Z",
|
|
69
|
+
style: { transformBox: "fill-box", transformOrigin: "50% 50%" },
|
|
70
|
+
transform: "matrix(0, -1, 1, 0, 0, 0)"
|
|
71
|
+
}
|
|
72
|
+
)
|
|
73
|
+
] }) }) }),
|
|
74
|
+
/* @__PURE__ */ r("div", { className: "popover-content", "data-fit-max-height": B(N), children: u({ close: b }) })
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
) })
|
|
78
|
+
] });
|
|
79
|
+
});
|
|
80
|
+
export {
|
|
81
|
+
D as Popover
|
|
82
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import { useState as p } from "react";
|
|
3
|
+
import { Popover as m } from "./bundle.es10.js";
|
|
4
|
+
const f = ({ children: e, content: t, side: r }) => {
|
|
5
|
+
const [s, o] = p(!1);
|
|
6
|
+
return /* @__PURE__ */ n(
|
|
7
|
+
m,
|
|
8
|
+
{
|
|
9
|
+
showArrows: !0,
|
|
10
|
+
className: "tooltip",
|
|
11
|
+
open: s,
|
|
12
|
+
side: r,
|
|
13
|
+
content: () => t,
|
|
14
|
+
triggerProps: {
|
|
15
|
+
onMouseEnter: () => {
|
|
16
|
+
o(!0);
|
|
17
|
+
},
|
|
18
|
+
onMouseLeave: () => {
|
|
19
|
+
o(!1);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
children: e
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
export {
|
|
27
|
+
f as Tooltip
|
|
28
|
+
};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as F, useImperativeHandle as I } from "react";
|
|
3
|
+
import { Popover as T } from "./bundle.es10.js";
|
|
4
|
+
import { useFroozeClosing as b } from "./bundle.es44.js";
|
|
5
|
+
import { SelectInput as z } from "./bundle.es45.js";
|
|
6
|
+
import { useScrollListController as B } from "./bundle.es46.js";
|
|
7
|
+
import { SelectOptions as D } from "./bundle.es47.js";
|
|
8
|
+
import { mergeRefs as j } from "react-merge-refs";
|
|
9
|
+
const G = (a) => {
|
|
10
|
+
const {
|
|
11
|
+
options: n,
|
|
12
|
+
onChange: i,
|
|
13
|
+
value: r,
|
|
14
|
+
minimalOptions: m,
|
|
15
|
+
matchTarget: f = "width",
|
|
16
|
+
children: u,
|
|
17
|
+
disabled: p,
|
|
18
|
+
scrollRef: d,
|
|
19
|
+
popoverRef: v,
|
|
20
|
+
clearButton: s,
|
|
21
|
+
...h
|
|
22
|
+
} = a, t = F(() => {
|
|
23
|
+
const o = r === null ? -1 : n.findIndex((e) => e.value === r);
|
|
24
|
+
return {
|
|
25
|
+
index: o,
|
|
26
|
+
option: n[o]
|
|
27
|
+
};
|
|
28
|
+
}, [n, r]), x = t.option?.value ?? null, { popoverRef: R, froozePopoverPosition: C, handleAnimationEnd: g } = b(), { scrollToElement: c, optionsWrapperRef: O, scrollBoxRef: P } = B();
|
|
29
|
+
I(d, () => ({
|
|
30
|
+
scrollTo: (o) => c(o, "top")
|
|
31
|
+
}));
|
|
32
|
+
const S = (o, e) => {
|
|
33
|
+
C(), i(o), e();
|
|
34
|
+
}, A = (o) => {
|
|
35
|
+
o.stopPropagation(), s && i(null);
|
|
36
|
+
}, E = () => {
|
|
37
|
+
t.index !== -1 && c(t.index, "center");
|
|
38
|
+
};
|
|
39
|
+
return /* @__PURE__ */ l(
|
|
40
|
+
T,
|
|
41
|
+
{
|
|
42
|
+
minimal: !0,
|
|
43
|
+
ref: j([R, v]),
|
|
44
|
+
sideOffset: 0,
|
|
45
|
+
matchTarget: f,
|
|
46
|
+
onAnimationEnd: g,
|
|
47
|
+
onOpenAutoFocus: (o) => o.preventDefault(),
|
|
48
|
+
onCloseAutoFocus: (o) => o.preventDefault(),
|
|
49
|
+
disabled: p,
|
|
50
|
+
content: ({ close: o }) => /* @__PURE__ */ l(
|
|
51
|
+
D,
|
|
52
|
+
{
|
|
53
|
+
options: n,
|
|
54
|
+
active: x,
|
|
55
|
+
scrollboxRef: P,
|
|
56
|
+
optionsWrapperRef: O,
|
|
57
|
+
minimalOptions: m,
|
|
58
|
+
onOpened: E,
|
|
59
|
+
onSelect: (e) => S(e, o)
|
|
60
|
+
}
|
|
61
|
+
),
|
|
62
|
+
children: u ?? /* @__PURE__ */ l(
|
|
63
|
+
z,
|
|
64
|
+
{
|
|
65
|
+
...h,
|
|
66
|
+
disabled: p,
|
|
67
|
+
clearButton: s,
|
|
68
|
+
value: t.option?.title ?? "",
|
|
69
|
+
onClear: A
|
|
70
|
+
}
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
);
|
|
74
|
+
};
|
|
75
|
+
export {
|
|
76
|
+
G as Select
|
|
77
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as b, useRef as R } from "react";
|
|
3
|
+
import { mergeRefs as c } from "react-merge-refs";
|
|
4
|
+
import { InputElement as x } from "./bundle.es48.js";
|
|
5
|
+
import { InputContainer as I } from "./bundle.es49.js";
|
|
6
|
+
import g from "classnames";
|
|
7
|
+
const N = b(
|
|
8
|
+
({
|
|
9
|
+
onChange: m,
|
|
10
|
+
onValueChange: f,
|
|
11
|
+
readOnly: i,
|
|
12
|
+
inputClassName: o,
|
|
13
|
+
value: p,
|
|
14
|
+
placeholder: n,
|
|
15
|
+
mask: d,
|
|
16
|
+
inputType: s = "text",
|
|
17
|
+
maskChar: u,
|
|
18
|
+
inputRef: a,
|
|
19
|
+
...e
|
|
20
|
+
}, l) => {
|
|
21
|
+
const r = R(null);
|
|
22
|
+
return /* @__PURE__ */ t(I, { ref: l, inputRef: r, ...e, children: /* @__PURE__ */ t(
|
|
23
|
+
x,
|
|
24
|
+
{
|
|
25
|
+
type: s,
|
|
26
|
+
ref: c([r, a]),
|
|
27
|
+
className: g("form-input form-input-base", o),
|
|
28
|
+
"aria-disabled": e.disabled,
|
|
29
|
+
onChange: m,
|
|
30
|
+
onValueChange: f,
|
|
31
|
+
value: p,
|
|
32
|
+
placeholder: n,
|
|
33
|
+
disabled: e.disabled,
|
|
34
|
+
readOnly: i,
|
|
35
|
+
maskChar: u,
|
|
36
|
+
mask: d
|
|
37
|
+
}
|
|
38
|
+
) });
|
|
39
|
+
}
|
|
40
|
+
);
|
|
41
|
+
export {
|
|
42
|
+
N as Input
|
|
43
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsxs as i, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import N from "classnames";
|
|
3
|
+
import { Icon as v } from "./bundle.es33.js";
|
|
4
|
+
import { attr as t } from "@companix/utils-browser";
|
|
5
|
+
import { forwardRef as k } from "react";
|
|
6
|
+
import { faCheck as x } from "@companix/icons-solid";
|
|
7
|
+
const O = k(
|
|
8
|
+
({ title: d, icon: n, active: c, label: e, disabled: r, minimal: a, onClick: l, className: m, ...s }, p) => {
|
|
9
|
+
const f = (h) => {
|
|
10
|
+
r || l?.(h);
|
|
11
|
+
};
|
|
12
|
+
return /* @__PURE__ */ i(
|
|
13
|
+
"div",
|
|
14
|
+
{
|
|
15
|
+
ref: p,
|
|
16
|
+
...s,
|
|
17
|
+
className: N("option", m),
|
|
18
|
+
"data-selected": t(c),
|
|
19
|
+
"data-disabled": t(r),
|
|
20
|
+
"data-minimal": t(a),
|
|
21
|
+
onClick: f,
|
|
22
|
+
children: [
|
|
23
|
+
/* @__PURE__ */ i("div", { className: "option-content", children: [
|
|
24
|
+
n && /* @__PURE__ */ o("div", { className: "option-icon", children: n }),
|
|
25
|
+
/* @__PURE__ */ i("div", { className: "option-content-layout", children: [
|
|
26
|
+
/* @__PURE__ */ o("div", { className: "option-title", children: d }),
|
|
27
|
+
e && /* @__PURE__ */ o("div", { className: "option-label", children: e })
|
|
28
|
+
] })
|
|
29
|
+
] }),
|
|
30
|
+
c && !a && /* @__PURE__ */ o("div", { className: "option-check", children: /* @__PURE__ */ o(v, { icon: x }) })
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
);
|
|
36
|
+
export {
|
|
37
|
+
O as OptionItem
|
|
38
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import C from "classnames";
|
|
3
|
+
import { forwardRef as j, useRef as w } from "react";
|
|
4
|
+
import { mergeRefs as y } from "react-merge-refs";
|
|
5
|
+
import { InputContainer as F } from "./bundle.es49.js";
|
|
6
|
+
import { NumericFormat as V } from "react-number-format";
|
|
7
|
+
const D = j(
|
|
8
|
+
({
|
|
9
|
+
onChange: m,
|
|
10
|
+
onValueChange: o,
|
|
11
|
+
readOnly: f,
|
|
12
|
+
inputClassName: i,
|
|
13
|
+
value: n,
|
|
14
|
+
placeholder: u,
|
|
15
|
+
thousandSeparator: a,
|
|
16
|
+
decimalSeparator: p,
|
|
17
|
+
allowedDecimalSeparators: l,
|
|
18
|
+
thousandsGroupStyle: s,
|
|
19
|
+
decimalScale: d,
|
|
20
|
+
fixedDecimalScale: b,
|
|
21
|
+
allowNegative: R = !1,
|
|
22
|
+
allowLeadingZeros: c,
|
|
23
|
+
suffix: g,
|
|
24
|
+
prefix: x,
|
|
25
|
+
inputRef: I,
|
|
26
|
+
...e
|
|
27
|
+
}, N) => {
|
|
28
|
+
const r = w(null);
|
|
29
|
+
return /* @__PURE__ */ t(F, { ref: N, inputRef: r, ...e, children: /* @__PURE__ */ t(
|
|
30
|
+
V,
|
|
31
|
+
{
|
|
32
|
+
type: "text",
|
|
33
|
+
getInputRef: y([r, I]),
|
|
34
|
+
className: C("form-input form-input-base", i),
|
|
35
|
+
"aria-disabled": e.disabled,
|
|
36
|
+
onChange: m,
|
|
37
|
+
onValueChange: ({ floatValue: h }) => o?.(h ?? null),
|
|
38
|
+
value: n,
|
|
39
|
+
placeholder: u,
|
|
40
|
+
disabled: e.disabled,
|
|
41
|
+
readOnly: f,
|
|
42
|
+
thousandSeparator: a,
|
|
43
|
+
decimalSeparator: p,
|
|
44
|
+
allowedDecimalSeparators: l,
|
|
45
|
+
thousandsGroupStyle: s,
|
|
46
|
+
decimalScale: d,
|
|
47
|
+
fixedDecimalScale: b,
|
|
48
|
+
allowNegative: R,
|
|
49
|
+
allowLeadingZeros: c,
|
|
50
|
+
suffix: g,
|
|
51
|
+
prefix: x
|
|
52
|
+
}
|
|
53
|
+
) });
|
|
54
|
+
}
|
|
55
|
+
);
|
|
56
|
+
export {
|
|
57
|
+
D as NumberInput
|
|
58
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { Scrollable as n } from "./bundle.es7.js";
|
|
3
|
+
const s = ({
|
|
4
|
+
children: o,
|
|
5
|
+
maxHeight: t,
|
|
6
|
+
scrollboxRef: i,
|
|
7
|
+
optionsWrapperRef: e
|
|
8
|
+
}) => /* @__PURE__ */ r(
|
|
9
|
+
n,
|
|
10
|
+
{
|
|
11
|
+
ref: i,
|
|
12
|
+
implementation: "inner",
|
|
13
|
+
padding: 10,
|
|
14
|
+
thumbPadding: 3,
|
|
15
|
+
thumbColor: "#0000002b",
|
|
16
|
+
maxHeight: t,
|
|
17
|
+
scrollY: !0,
|
|
18
|
+
children: /* @__PURE__ */ r("div", { className: "option-list", ref: e, children: o })
|
|
19
|
+
}
|
|
20
|
+
);
|
|
21
|
+
export {
|
|
22
|
+
s as OptionsList
|
|
23
|
+
};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { jsxs as x, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "@radix-ui/react-checkbox";
|
|
3
|
+
import { Icon as h } from "./bundle.es33.js";
|
|
4
|
+
import { faCheck as l } from "@companix/icons-solid";
|
|
5
|
+
import { useId as n } from "react";
|
|
6
|
+
import { attr as c } from "@companix/utils-browser";
|
|
7
|
+
const u = ({ checked: e, required: m, disabled: r, onCheckedChange: s, size: d, label: a }) => {
|
|
8
|
+
const i = n();
|
|
9
|
+
return /* @__PURE__ */ x(
|
|
10
|
+
"div",
|
|
11
|
+
{
|
|
12
|
+
className: "checkbox",
|
|
13
|
+
"data-size": d ?? "md",
|
|
14
|
+
"data-required": c(m && !e),
|
|
15
|
+
"data-disabled": c(r),
|
|
16
|
+
children: [
|
|
17
|
+
/* @__PURE__ */ o(
|
|
18
|
+
t.Root,
|
|
19
|
+
{
|
|
20
|
+
className: "checkbox-box",
|
|
21
|
+
checked: e,
|
|
22
|
+
onCheckedChange: s,
|
|
23
|
+
disabled: r,
|
|
24
|
+
id: i,
|
|
25
|
+
children: /* @__PURE__ */ o(t.Indicator, { className: "checkbox-icon", children: /* @__PURE__ */ o(h, { icon: l, size: "xxxs" }) })
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
a && /* @__PURE__ */ o("label", { className: "checkbox-label", htmlFor: i, "data-disabled": c(r), children: a })
|
|
29
|
+
]
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
};
|
|
33
|
+
export {
|
|
34
|
+
u as Checkbox
|
|
35
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsxs as d, jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import * as r from "@radix-ui/react-switch";
|
|
3
|
+
import { attr as a } from "@companix/utils-browser";
|
|
4
|
+
import { useId as n } from "react";
|
|
5
|
+
const u = (m) => {
|
|
6
|
+
const { checked: e, disabled: s, onCheckedChange: o, uncheckedIcon: i, checkedIcon: t, label: h } = m, l = n();
|
|
7
|
+
return /* @__PURE__ */ d("div", { className: "switch", "data-disabled": a(s), children: [
|
|
8
|
+
/* @__PURE__ */ c(
|
|
9
|
+
r.Root,
|
|
10
|
+
{
|
|
11
|
+
className: "switch-track",
|
|
12
|
+
checked: e,
|
|
13
|
+
onCheckedChange: o,
|
|
14
|
+
disabled: s,
|
|
15
|
+
id: l,
|
|
16
|
+
children: /* @__PURE__ */ d(r.Thumb, { className: "switch-thumb", children: [
|
|
17
|
+
i && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(!e), children: i }),
|
|
18
|
+
t && /* @__PURE__ */ c("span", { className: "switch-thumb-icon", "data-visible": a(e), children: t })
|
|
19
|
+
] })
|
|
20
|
+
}
|
|
21
|
+
),
|
|
22
|
+
h && /* @__PURE__ */ c("label", { className: "switch-label", htmlFor: l, "data-disabled": s, children: h })
|
|
23
|
+
] });
|
|
24
|
+
};
|
|
25
|
+
export {
|
|
26
|
+
u as Switch
|
|
27
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { jsxs as u, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { useId as p } from "react";
|
|
3
|
+
import * as l from "@radix-ui/react-radio-group";
|
|
4
|
+
import { attr as s } from "@companix/utils-browser";
|
|
5
|
+
const q = (t) => {
|
|
6
|
+
const { options: m, value: a, onChange: r, disabled: d, required: e, size: n } = t;
|
|
7
|
+
return /* @__PURE__ */ o(
|
|
8
|
+
l.Root,
|
|
9
|
+
{
|
|
10
|
+
className: "radio-group",
|
|
11
|
+
disabled: d,
|
|
12
|
+
"data-required": s(e && !a),
|
|
13
|
+
"data-v": a,
|
|
14
|
+
value: a,
|
|
15
|
+
onValueChange: (i) => r(i),
|
|
16
|
+
children: m.map((i, c) => /* @__PURE__ */ o(
|
|
17
|
+
h,
|
|
18
|
+
{
|
|
19
|
+
...i,
|
|
20
|
+
size: n,
|
|
21
|
+
disabled: d,
|
|
22
|
+
required: e && !a
|
|
23
|
+
},
|
|
24
|
+
`radio-${i.value}-${c}`
|
|
25
|
+
))
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}, h = ({ value: t, label: m, size: a = "md", disabled: r, required: d }) => {
|
|
29
|
+
const e = p();
|
|
30
|
+
return /* @__PURE__ */ u(
|
|
31
|
+
"span",
|
|
32
|
+
{
|
|
33
|
+
className: "radio",
|
|
34
|
+
"data-disabled": s(r),
|
|
35
|
+
"data-size": a,
|
|
36
|
+
"data-required": s(d),
|
|
37
|
+
children: [
|
|
38
|
+
/* @__PURE__ */ o(l.Item, { className: "radio-box", value: t, disabled: r, id: e, children: /* @__PURE__ */ o(l.Indicator, { className: "radio-mark" }) }),
|
|
39
|
+
/* @__PURE__ */ o("label", { className: "radio-label", htmlFor: e, "data-disabled": s(r), children: m })
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
};
|
|
44
|
+
export {
|
|
45
|
+
h as Radio,
|
|
46
|
+
q as RadioGroup
|
|
47
|
+
};
|