ctc-component-library 0.2.0 → 1.0.0-alpha.3
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/DESIGN.md +408 -0
- package/MIGRATION.md +301 -0
- package/README.md +41 -72
- package/dist/components/Alert/Alert.d.ts +14 -0
- package/dist/components/Alert/Alert.js +73 -0
- package/dist/components/Alert/index.d.ts +1 -0
- package/dist/components/Alert/index.js +2 -0
- package/dist/components/Avatar/Avatar.d.ts +5 -0
- package/dist/components/Avatar/Avatar.js +25 -0
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Avatar/index.js +2 -0
- package/dist/components/Badge/Badge.d.ts +23 -0
- package/dist/components/Badge/Badge.js +159 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Badge/index.js +2 -0
- package/dist/components/Button/Button.d.ts +7 -0
- package/dist/components/Button/Button.js +44 -0
- package/dist/components/Button/button.variants.d.ts +22 -0
- package/dist/components/Button/button.variants.js +62 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.js +3 -0
- package/dist/components/Checkbox/Checkbox.d.ts +7 -0
- package/dist/components/Checkbox/Checkbox.js +23 -0
- package/dist/components/Checkbox/index.d.ts +1 -0
- package/dist/components/Checkbox/index.js +2 -0
- package/dist/components/Chip/Chip.d.ts +17 -0
- package/dist/components/Chip/Chip.js +59 -0
- package/dist/components/Chip/index.d.ts +2 -0
- package/dist/components/Chip/index.js +2 -0
- package/dist/components/Combobox/Combobox.d.ts +31 -0
- package/dist/components/Combobox/Combobox.js +98 -0
- package/dist/components/Combobox/index.d.ts +1 -0
- package/dist/components/Combobox/index.js +2 -0
- package/dist/components/DataTable/DataTable.d.ts +24 -0
- package/dist/components/DataTable/DataTable.js +74 -0
- package/dist/components/DataTable/Table.d.ts +9 -0
- package/dist/components/DataTable/Table.js +57 -0
- package/dist/components/DataTable/index.d.ts +3 -0
- package/dist/components/DataTable/index.js +3 -0
- package/dist/components/DatePicker/DatePicker.d.ts +20 -0
- package/dist/components/DatePicker/DatePicker.js +74 -0
- package/dist/components/DatePicker/index.d.ts +1 -0
- package/dist/components/DatePicker/index.js +2 -0
- package/dist/components/Dialog/Dialog.d.ts +21 -0
- package/dist/components/Dialog/Dialog.js +50 -0
- package/dist/components/Dialog/index.d.ts +1 -0
- package/dist/components/Dialog/index.js +2 -0
- package/dist/components/Field/Field.d.ts +22 -0
- package/dist/components/Field/Field.js +43 -0
- package/dist/components/Field/index.d.ts +1 -0
- package/dist/components/Field/index.js +2 -0
- package/dist/components/Icon/Icon.d.ts +7 -0
- package/dist/components/Icon/Icon.js +13 -0
- package/dist/components/Icon/index.d.ts +13 -0
- package/dist/components/Icon/index.js +2 -0
- package/dist/components/Input/Input.d.ts +41 -0
- package/dist/components/Input/Input.js +87 -0
- package/dist/components/Input/index.d.ts +1 -0
- package/dist/components/Input/index.js +2 -0
- package/dist/components/Label/Label.d.ts +3 -0
- package/dist/components/Label/Label.js +13 -0
- package/dist/components/Label/index.js +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +23 -0
- package/dist/components/MultiSelect/MultiSelect.js +99 -0
- package/dist/components/MultiSelect/index.d.ts +1 -0
- package/dist/components/MultiSelect/index.js +2 -0
- package/dist/components/NumberInput/NumberInput.d.ts +11 -0
- package/dist/components/NumberInput/NumberInput.js +58 -0
- package/dist/components/NumberInput/index.d.ts +1 -0
- package/dist/components/NumberInput/index.js +2 -0
- package/dist/components/Popover/Popover.d.ts +12 -0
- package/dist/components/Popover/Popover.js +20 -0
- package/dist/components/Popover/index.d.ts +1 -0
- package/dist/components/Popover/index.js +2 -0
- package/dist/components/RadioGroup/RadioGroup.d.ts +8 -0
- package/dist/components/RadioGroup/RadioGroup.js +30 -0
- package/dist/components/RadioGroup/index.d.ts +1 -0
- package/dist/components/RadioGroup/index.js +2 -0
- package/dist/components/Select/Select.d.ts +15 -0
- package/dist/components/Select/Select.js +83 -0
- package/dist/components/Select/index.d.ts +1 -0
- package/dist/components/Select/index.js +2 -0
- package/dist/components/Spinner/Spinner.d.ts +9 -0
- package/dist/components/Spinner/Spinner.js +24 -0
- package/dist/components/Spinner/index.d.ts +1 -0
- package/dist/components/Spinner/index.js +2 -0
- package/dist/components/Switch/Switch.d.ts +7 -0
- package/dist/components/Switch/Switch.js +23 -0
- package/dist/components/Switch/index.d.ts +1 -0
- package/dist/components/Switch/index.js +2 -0
- package/dist/components/Tabs/Tabs.d.ts +17 -0
- package/dist/components/Tabs/Tabs.js +78 -0
- package/dist/components/Tabs/index.d.ts +1 -0
- package/dist/components/Tabs/index.js +2 -0
- package/dist/components/TimePicker/TimePicker.d.ts +20 -0
- package/dist/components/TimePicker/TimePicker.js +62 -0
- package/dist/components/TimePicker/index.d.ts +1 -0
- package/dist/components/TimePicker/index.js +2 -0
- package/dist/components/Toast/Toast.d.ts +57 -0
- package/dist/components/Toast/Toast.js +40 -0
- package/dist/components/Toast/index.d.ts +1 -0
- package/dist/components/Toast/index.js +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +12 -0
- package/dist/components/Tooltip/Tooltip.js +23 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +2 -0
- package/dist/components/Typography/Typography.d.ts +13 -0
- package/dist/components/Typography/Typography.js +63 -0
- package/dist/components/Typography/index.d.ts +1 -0
- package/dist/components/Typography/index.js +2 -0
- package/dist/lib/cn.d.ts +2 -0
- package/dist/lib/cn.js +6 -0
- package/dist/presets/SelectCountry/SelectCountry.d.ts +16 -0
- package/dist/presets/SelectCountry/SelectCountry.js +21 -0
- package/dist/presets/SelectCountry/countries.d.ts +11 -0
- package/dist/presets/SelectCountry/countries.js +120 -0
- package/dist/presets/SelectCountry/index.d.ts +2 -0
- package/dist/presets/SelectCountry/index.js +3 -0
- package/dist/presets/SelectPhone/SelectPhone.d.ts +15 -0
- package/dist/presets/SelectPhone/SelectPhone.js +21 -0
- package/dist/presets/SelectPhone/index.d.ts +2 -0
- package/dist/presets/SelectPhone/index.js +3 -0
- package/dist/presets/SelectPhone/phoneCodes.d.ts +7 -0
- package/dist/presets/SelectPhone/phoneCodes.js +131 -0
- package/dist/tailwind-preset.d.ts +10 -0
- package/dist/tailwind-preset.js +4 -0
- package/dist/test-setup.d.ts +0 -0
- package/dist/theme/colors.d.ts +57 -0
- package/dist/theme/colors.js +59 -0
- package/dist/theme/index.d.ts +3 -0
- package/dist/theme/index.js +4 -0
- package/dist/theme/shapes.d.ts +17 -0
- package/dist/theme/shapes.js +18 -0
- package/dist/theme/spacing.d.ts +18 -0
- package/dist/theme/spacing.js +19 -0
- package/dist/theme.css +2 -0
- package/llms.txt +296 -736
- package/package.json +193 -69
- package/dist/index.css +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.es.js +0 -45361
- package/dist/src/commons/colors.d.ts +0 -47
- package/dist/src/commons/colors.es.js +0 -50
- package/dist/src/commons/shapes.d.ts +0 -15
- package/dist/src/commons/shapes.es.js +0 -18
- package/dist/src/commons/spacing.d.ts +0 -15
- package/dist/src/commons/spacing.es.js +0 -18
- package/dist/src/components/atoms/Avatar/Avatar.d.ts +0 -2
- package/dist/src/components/atoms/Avatar/index.d.ts +0 -2
- package/dist/src/components/atoms/Avatar/types.d.ts +0 -7
- package/dist/src/components/atoms/Badge/Badge.d.ts +0 -3
- package/dist/src/components/atoms/Badge/index.d.ts +0 -2
- package/dist/src/components/atoms/Badge/types.d.ts +0 -18
- package/dist/src/components/atoms/Button/Button.d.ts +0 -3
- package/dist/src/components/atoms/Button/ButtonV2.d.ts +0 -4
- package/dist/src/components/atoms/Button/index.d.ts +0 -4
- package/dist/src/components/atoms/Button/types.d.ts +0 -33
- package/dist/src/components/atoms/Checkbox/Checkbox.d.ts +0 -3
- package/dist/src/components/atoms/Checkbox/index.d.ts +0 -2
- package/dist/src/components/atoms/Checkbox/types.d.ts +0 -18
- package/dist/src/components/atoms/Datepicker/Datepicker.d.ts +0 -3
- package/dist/src/components/atoms/Datepicker/index.d.ts +0 -2
- package/dist/src/components/atoms/Datepicker/types.d.ts +0 -9
- package/dist/src/components/atoms/Icon/Icon.d.ts +0 -3
- package/dist/src/components/atoms/Icon/index.d.ts +0 -3
- package/dist/src/components/atoms/Icon/types.d.ts +0 -11
- package/dist/src/components/atoms/InputNumber/InputNumber.d.ts +0 -3
- package/dist/src/components/atoms/InputNumber/index.d.ts +0 -2
- package/dist/src/components/atoms/InputNumber/types.d.ts +0 -7
- package/dist/src/components/atoms/Label/Label.d.ts +0 -9
- package/dist/src/components/atoms/Popover/Popover.d.ts +0 -2
- package/dist/src/components/atoms/Popover/index.d.ts +0 -2
- package/dist/src/components/atoms/Popover/types.d.ts +0 -8
- package/dist/src/components/atoms/RadioButton/RadioButton.d.ts +0 -3
- package/dist/src/components/atoms/RadioButton/index.d.ts +0 -2
- package/dist/src/components/atoms/RadioButton/types.d.ts +0 -20
- package/dist/src/components/atoms/TextInput/TextInput.d.ts +0 -12
- package/dist/src/components/atoms/TextInput/index.d.ts +0 -1
- package/dist/src/components/atoms/TextInput/types.d.ts +0 -5
- package/dist/src/components/atoms/Timepicker/TimePicker.d.ts +0 -3
- package/dist/src/components/atoms/Timepicker/index.d.ts +0 -2
- package/dist/src/components/atoms/Timepicker/types.d.ts +0 -15
- package/dist/src/components/atoms/Toast/Toast.d.ts +0 -20
- package/dist/src/components/atoms/Toast/index.d.ts +0 -1
- package/dist/src/components/atoms/Toggle/Toggle.d.ts +0 -3
- package/dist/src/components/atoms/Toggle/index.d.ts +0 -2
- package/dist/src/components/atoms/Toggle/types.d.ts +0 -6
- package/dist/src/components/atoms/Typography/Typography.d.ts +0 -7
- package/dist/src/components/atoms/Typography/index.d.ts +0 -2
- package/dist/src/components/atoms/Typography/types.d.ts +0 -38
- package/dist/src/components/atoms/index.d.ts +0 -16
- package/dist/src/components/atoms/tooltips/Tooltip/Tooltip.d.ts +0 -2
- package/dist/src/components/atoms/tooltips/Tooltip/index.d.ts +0 -2
- package/dist/src/components/atoms/tooltips/Tooltip/types.d.ts +0 -10
- package/dist/src/components/atoms/tooltips/TooltipWrapper/TooltipWrapper.d.ts +0 -2
- package/dist/src/components/atoms/tooltips/TooltipWrapper/index.d.ts +0 -2
- package/dist/src/components/atoms/tooltips/TooltipWrapper/types.d.ts +0 -11
- package/dist/src/components/atoms/tooltips/index.d.ts +0 -2
- package/dist/src/components/index.d.ts +0 -3
- package/dist/src/components/molecules/Table/Table.d.ts +0 -3
- package/dist/src/components/molecules/Table/index.d.ts +0 -2
- package/dist/src/components/molecules/Table/types.d.ts +0 -28
- package/dist/src/components/molecules/alert/Alert.d.ts +0 -15
- package/dist/src/components/molecules/alert/index.d.ts +0 -1
- package/dist/src/components/molecules/dropdowns/Dropdown/Dropdown.d.ts +0 -3
- package/dist/src/components/molecules/dropdowns/Dropdown/index.d.ts +0 -2
- package/dist/src/components/molecules/dropdowns/Dropdown/types.d.ts +0 -33
- package/dist/src/components/molecules/dropdowns/DropdownCountry/DropdownCountry.d.ts +0 -5
- package/dist/src/components/molecules/dropdowns/DropdownCountry/index.d.ts +0 -1
- package/dist/src/components/molecules/dropdowns/DropdownFilter/DropdownFilter.d.ts +0 -3
- package/dist/src/components/molecules/dropdowns/DropdownFilter/index.d.ts +0 -1
- package/dist/src/components/molecules/dropdowns/DropdownFilter/types.d.ts +0 -38
- package/dist/src/components/molecules/dropdowns/DropdownMultiple/DropdownMultiple.d.ts +0 -3
- package/dist/src/components/molecules/dropdowns/DropdownMultiple/index.d.ts +0 -2
- package/dist/src/components/molecules/dropdowns/DropdownMultiple/types.d.ts +0 -11
- package/dist/src/components/molecules/dropdowns/DropdownPhone/DropdownPhone.d.ts +0 -6
- package/dist/src/components/molecules/dropdowns/DropdownPhone/index.d.ts +0 -1
- package/dist/src/components/molecules/dropdowns/index.d.ts +0 -5
- package/dist/src/components/molecules/index.d.ts +0 -4
- package/dist/src/components/molecules/tabs/Tab/Tab.d.ts +0 -3
- package/dist/src/components/molecules/tabs/Tab/index.d.ts +0 -2
- package/dist/src/components/molecules/tabs/Tab/types.d.ts +0 -16
- package/dist/src/components/molecules/tabs/TabButton/TabButton.d.ts +0 -3
- package/dist/src/components/molecules/tabs/TabButton/index.d.ts +0 -2
- package/dist/src/components/molecules/tabs/TabButton/types.d.ts +0 -15
- package/dist/src/components/molecules/tabs/index.d.ts +0 -2
- package/dist/src/components/organisms/Modal/Modal.d.ts +0 -3
- package/dist/src/components/organisms/Modal/ModalV2.d.ts +0 -53
- package/dist/src/components/organisms/Modal/index.d.ts +0 -3
- package/dist/src/components/organisms/Modal/types.d.ts +0 -24
- package/dist/src/components/organisms/index.d.ts +0 -1
- package/dist/src/constants/countries.d.ts +0 -7
- package/dist/src/hooks/useClickOutside.d.ts +0 -2
- package/dist/src/vite-env.d.ts +0 -1
- /package/dist/{src/components/atoms → components}/Label/index.d.ts +0 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { Select as t, SelectContent as n, SelectItem as r, SelectTrigger as i, SelectValue as a } from "../Select/Select.js";
|
|
3
|
+
import * as o from "react";
|
|
4
|
+
import { jsx as s, jsxs as c } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/TimePicker/TimePicker.tsx
|
|
6
|
+
var l = (e) => String(e).padStart(2, "0"), u = ({ value: u, defaultValue: d, onValueChange: f, minuteStep: p = 5, hour12: m = !1, disabled: h, size: g = "sm", className: _, ...v }) => {
|
|
7
|
+
let [y, b] = o.useState(d ?? {
|
|
8
|
+
hours: 0,
|
|
9
|
+
minutes: 0
|
|
10
|
+
}), x = u !== void 0, S = x ? u : y, C = (e) => {
|
|
11
|
+
x || b(e), f?.(e);
|
|
12
|
+
}, w = m ? 12 : 24, T = Array.from({ length: w }, (e, t) => m ? t + 1 : t), E = Array.from({ length: Math.floor(60 / p) }, (e, t) => t * p);
|
|
13
|
+
return /* @__PURE__ */ c("div", {
|
|
14
|
+
className: e("inline-flex items-center gap-x1", _),
|
|
15
|
+
role: "group",
|
|
16
|
+
"aria-label": "Hora",
|
|
17
|
+
...v,
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ c(t, {
|
|
20
|
+
value: String(S.hours),
|
|
21
|
+
onValueChange: (e) => C({
|
|
22
|
+
...S,
|
|
23
|
+
hours: Number(e)
|
|
24
|
+
}),
|
|
25
|
+
disabled: h,
|
|
26
|
+
children: [/* @__PURE__ */ s(i, {
|
|
27
|
+
size: g,
|
|
28
|
+
className: "w-20",
|
|
29
|
+
"aria-label": "Horas",
|
|
30
|
+
children: /* @__PURE__ */ s(a, { placeholder: "HH" })
|
|
31
|
+
}), /* @__PURE__ */ s(n, { children: T.map((e) => /* @__PURE__ */ s(r, {
|
|
32
|
+
value: String(e),
|
|
33
|
+
children: l(e)
|
|
34
|
+
}, e)) })]
|
|
35
|
+
}),
|
|
36
|
+
/* @__PURE__ */ s("span", {
|
|
37
|
+
className: "text-gray-60 font-bold",
|
|
38
|
+
children: ":"
|
|
39
|
+
}),
|
|
40
|
+
/* @__PURE__ */ c(t, {
|
|
41
|
+
value: String(S.minutes),
|
|
42
|
+
onValueChange: (e) => C({
|
|
43
|
+
...S,
|
|
44
|
+
minutes: Number(e)
|
|
45
|
+
}),
|
|
46
|
+
disabled: h,
|
|
47
|
+
children: [/* @__PURE__ */ s(i, {
|
|
48
|
+
size: g,
|
|
49
|
+
className: "w-20",
|
|
50
|
+
"aria-label": "Minutos",
|
|
51
|
+
children: /* @__PURE__ */ s(a, { placeholder: "MM" })
|
|
52
|
+
}), /* @__PURE__ */ s(n, { children: E.map((e) => /* @__PURE__ */ s(r, {
|
|
53
|
+
value: String(e),
|
|
54
|
+
children: l(e)
|
|
55
|
+
}, e)) })]
|
|
56
|
+
})
|
|
57
|
+
]
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
u.displayName = "TimePicker";
|
|
61
|
+
//#endregion
|
|
62
|
+
export { u as TimePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TimePicker, type TimePickerProps, type TimeValue } from './TimePicker';
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ToasterProps } from 'sonner';
|
|
2
|
+
/**
|
|
3
|
+
* CTC-themed Toaster. Mount once at the root of the app.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* <Toaster />
|
|
7
|
+
* import { toast } from 'ctc-component-library/toast';
|
|
8
|
+
* toast.success('Guardado');
|
|
9
|
+
*/
|
|
10
|
+
export declare const Toaster: (props: ToasterProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare const toast: ((message: import('react').ReactNode | (() => React.ReactNode), data?: import('sonner').ExternalToast) => string | number) & {
|
|
12
|
+
success: (message: (import('react').ReactNode | (() => React.ReactNode)) | React.ReactNode, data?: import('sonner').ExternalToast) => string | number;
|
|
13
|
+
info: (message: (import('react').ReactNode | (() => React.ReactNode)) | React.ReactNode, data?: import('sonner').ExternalToast) => string | number;
|
|
14
|
+
warning: (message: (import('react').ReactNode | (() => React.ReactNode)) | React.ReactNode, data?: import('sonner').ExternalToast) => string | number;
|
|
15
|
+
error: (message: (import('react').ReactNode | (() => React.ReactNode)) | React.ReactNode, data?: import('sonner').ExternalToast) => string | number;
|
|
16
|
+
custom: (jsx: (id: number | string) => React.ReactElement, data?: import('sonner').ExternalToast) => string | number;
|
|
17
|
+
message: (message: (import('react').ReactNode | (() => React.ReactNode)) | React.ReactNode, data?: import('sonner').ExternalToast) => string | number;
|
|
18
|
+
promise: <ToastData>(promise: Promise<ToastData> | (() => Promise<ToastData>), data?: {
|
|
19
|
+
className?: string | undefined;
|
|
20
|
+
style?: React.CSSProperties | undefined;
|
|
21
|
+
id?: number | string | undefined;
|
|
22
|
+
action?: import('react').ReactNode | import('sonner').Action;
|
|
23
|
+
cancel?: import('react').ReactNode | import('sonner').Action;
|
|
24
|
+
onDismiss?: ((toast: import('sonner').ToastT) => void) | undefined;
|
|
25
|
+
invert?: boolean | undefined;
|
|
26
|
+
icon?: import('react').ReactNode;
|
|
27
|
+
richColors?: boolean | undefined;
|
|
28
|
+
closeButton?: boolean | undefined;
|
|
29
|
+
dismissible?: boolean | undefined;
|
|
30
|
+
duration?: number | undefined;
|
|
31
|
+
onAutoClose?: ((toast: import('sonner').ToastT) => void) | undefined;
|
|
32
|
+
cancelButtonStyle?: React.CSSProperties | undefined;
|
|
33
|
+
actionButtonStyle?: React.CSSProperties | undefined;
|
|
34
|
+
unstyled?: boolean | undefined;
|
|
35
|
+
classNames?: import('sonner').ToastClassnames | undefined;
|
|
36
|
+
descriptionClassName?: string | undefined;
|
|
37
|
+
position?: ("top-right" | "top-left" | "bottom-left" | "bottom-right" | "top-center" | "bottom-center") | undefined;
|
|
38
|
+
} & {
|
|
39
|
+
loading?: string | React.ReactNode;
|
|
40
|
+
success?: import('react').ReactNode | ((data: ToastData) => React.ReactNode | string | Promise<React.ReactNode | string>);
|
|
41
|
+
error?: import('react').ReactNode | ((data: any) => React.ReactNode | string | Promise<React.ReactNode | string>);
|
|
42
|
+
description?: import('react').ReactNode | ((data: any) => React.ReactNode | string | Promise<React.ReactNode | string>);
|
|
43
|
+
finally?: () => void | Promise<void>;
|
|
44
|
+
}) => (string & {
|
|
45
|
+
unwrap: () => Promise<ToastData>;
|
|
46
|
+
}) | (number & {
|
|
47
|
+
unwrap: () => Promise<ToastData>;
|
|
48
|
+
}) | {
|
|
49
|
+
unwrap: () => Promise<ToastData>;
|
|
50
|
+
};
|
|
51
|
+
dismiss: (id?: number | string) => string | number;
|
|
52
|
+
loading: (message: (import('react').ReactNode | (() => React.ReactNode)) | React.ReactNode, data?: import('sonner').ExternalToast) => string | number;
|
|
53
|
+
} & {
|
|
54
|
+
getHistory: () => (import('sonner').ToastT | import('sonner').ToastToDismiss)[];
|
|
55
|
+
getToasts: () => (import('sonner').ToastT | import('sonner').ToastToDismiss)[];
|
|
56
|
+
};
|
|
57
|
+
export type { ToasterProps };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { Toaster as t, toast as n } from "sonner";
|
|
3
|
+
import { CheckCircle as r, Info as i, Warning as a, WarningCircle as o } from "@phosphor-icons/react";
|
|
4
|
+
//#region src/components/Toast/Toast.tsx
|
|
5
|
+
var s = (n) => /* @__PURE__ */ e(t, {
|
|
6
|
+
position: "top-right",
|
|
7
|
+
closeButton: !0,
|
|
8
|
+
icons: {
|
|
9
|
+
success: /* @__PURE__ */ e(r, {
|
|
10
|
+
weight: "fill",
|
|
11
|
+
className: "size-5 text-success"
|
|
12
|
+
}),
|
|
13
|
+
error: /* @__PURE__ */ e(o, {
|
|
14
|
+
weight: "fill",
|
|
15
|
+
className: "size-5 text-error"
|
|
16
|
+
}),
|
|
17
|
+
warning: /* @__PURE__ */ e(a, {
|
|
18
|
+
weight: "fill",
|
|
19
|
+
className: "size-5 text-alert"
|
|
20
|
+
}),
|
|
21
|
+
info: /* @__PURE__ */ e(i, {
|
|
22
|
+
weight: "fill",
|
|
23
|
+
className: "size-5 text-skyblue"
|
|
24
|
+
})
|
|
25
|
+
},
|
|
26
|
+
toastOptions: { classNames: {
|
|
27
|
+
toast: [
|
|
28
|
+
"rounded-x4 border-2 border-gray-20 bg-gray-00 p-x4",
|
|
29
|
+
"font-sans text-[14px] leading-[20px] text-gray-80",
|
|
30
|
+
"shadow-md flex items-start gap-x3"
|
|
31
|
+
].join(" "),
|
|
32
|
+
title: "font-bold",
|
|
33
|
+
description: "text-gray-60",
|
|
34
|
+
actionButton: "bg-primary text-gray-80 px-x3 py-x1 rounded-x2",
|
|
35
|
+
cancelButton: "bg-gray-20 text-gray-80 px-x3 py-x1 rounded-x2"
|
|
36
|
+
} },
|
|
37
|
+
...n
|
|
38
|
+
}), c = n;
|
|
39
|
+
//#endregion
|
|
40
|
+
export { s as Toaster, c as toast };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Toaster, toast, type ToasterProps } from './Toast';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as TooltipPrimitive from '@radix-ui/react-tooltip';
|
|
3
|
+
/**
|
|
4
|
+
* TooltipProvider with CTC defaults: 400ms delay before showing,
|
|
5
|
+
* 200ms grace window where adjacent tooltips open instantly.
|
|
6
|
+
* Override either by passing props.
|
|
7
|
+
*/
|
|
8
|
+
export declare const TooltipProvider: ({ delayDuration, skipDelayDuration, ...props }: React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Provider>) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export declare const Tooltip: React.FC<TooltipPrimitive.TooltipProps>;
|
|
10
|
+
export declare const TooltipTrigger: React.ForwardRefExoticComponent<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
11
|
+
export declare const TooltipPortal: React.FC<TooltipPrimitive.TooltipPortalProps>;
|
|
12
|
+
export declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import * as i from "@radix-ui/react-tooltip";
|
|
5
|
+
//#region src/components/Tooltip/Tooltip.tsx
|
|
6
|
+
var a = ({ delayDuration: e = 400, skipDelayDuration: t = 200, ...r }) => /* @__PURE__ */ n(i.Provider, {
|
|
7
|
+
delayDuration: e,
|
|
8
|
+
skipDelayDuration: t,
|
|
9
|
+
...r
|
|
10
|
+
}), o = i.Root, s = i.Trigger, c = i.Portal, l = t.forwardRef(({ className: t, sideOffset: a = 6, children: o, ...s }, c) => /* @__PURE__ */ n(i.Portal, { children: /* @__PURE__ */ r(i.Content, {
|
|
11
|
+
ref: c,
|
|
12
|
+
sideOffset: a,
|
|
13
|
+
className: e("z-50 max-w-xs rounded-x2 bg-gray-100 px-x3 py-x2", "font-sans text-[12px] leading-[16px] text-gray-00", "[transform-origin:var(--radix-tooltip-content-transform-origin)]", "opacity-0 scale-[0.97]", "data-[state=delayed-open]:opacity-100 data-[state=delayed-open]:scale-100", "data-[state=instant-open]:opacity-100 data-[state=instant-open]:scale-100", "[transition:opacity_125ms_var(--ease-out),transform_125ms_var(--ease-out)]", "data-[state=instant-open]:[transition-duration:0ms]", "data-[state=closed]:opacity-0 data-[state=closed]:scale-[0.97]", t),
|
|
14
|
+
...s,
|
|
15
|
+
children: [o, /* @__PURE__ */ n(i.Arrow, {
|
|
16
|
+
className: "fill-gray-100",
|
|
17
|
+
width: 10,
|
|
18
|
+
height: 5
|
|
19
|
+
})]
|
|
20
|
+
}) }));
|
|
21
|
+
l.displayName = "TooltipContent";
|
|
22
|
+
//#endregion
|
|
23
|
+
export { o as Tooltip, l as TooltipContent, c as TooltipPortal, a as TooltipProvider, s as TooltipTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TooltipProvider, Tooltip, TooltipTrigger, TooltipPortal, TooltipContent } from './Tooltip';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
declare const typographyVariants: (props?: ({
|
|
4
|
+
variant?: "h1" | "h2" | "h3" | "h4" | "h5" | "body-1" | "body-2" | "body-3" | "body-4" | "body-5" | "body-6" | "button-1" | "button-2" | null | undefined;
|
|
5
|
+
underline?: boolean | null | undefined;
|
|
6
|
+
bolder?: boolean | null | undefined;
|
|
7
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
8
|
+
export interface TypographyProps extends React.HTMLAttributes<HTMLElement>, VariantProps<typeof typographyVariants> {
|
|
9
|
+
asChild?: boolean;
|
|
10
|
+
as?: keyof React.JSX.IntrinsicElements;
|
|
11
|
+
}
|
|
12
|
+
export declare const Typography: React.ForwardRefExoticComponent<TypographyProps & React.RefAttributes<HTMLElement>>;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { Slot as n } from "@radix-ui/react-slot";
|
|
4
|
+
import { cva as r } from "class-variance-authority";
|
|
5
|
+
import { jsx as i } from "react/jsx-runtime";
|
|
6
|
+
//#region src/components/Typography/Typography.tsx
|
|
7
|
+
var a = r("m-0 p-0", {
|
|
8
|
+
variants: {
|
|
9
|
+
variant: {
|
|
10
|
+
h1: "font-display font-light text-[56px] leading-[60px] tracking-[1.5px]",
|
|
11
|
+
h2: "font-display font-light text-[48px] leading-[55px] tracking-[1.2px]",
|
|
12
|
+
h3: "font-display font-light text-[34px] leading-[40px] tracking-[1px]",
|
|
13
|
+
h4: "font-display font-light text-[24px] leading-[30px] tracking-[0.8px]",
|
|
14
|
+
h5: "font-display font-light text-[20px] leading-[25px] tracking-[0.6px]",
|
|
15
|
+
"body-1": "font-sans text-[24px] leading-[30px] tracking-[-0.5px]",
|
|
16
|
+
"body-2": "font-sans text-[20px] leading-[24px] tracking-[-0.5px]",
|
|
17
|
+
"body-3": "font-sans text-[18px] leading-[24px] tracking-[-0.5px]",
|
|
18
|
+
"body-4": "font-sans text-[16px] leading-[22px] tracking-[-0.5px]",
|
|
19
|
+
"body-5": "font-sans text-[14px] leading-[20px] tracking-[-0.5px]",
|
|
20
|
+
"body-6": "font-sans text-[12px] leading-[16px] tracking-[-0.5px]",
|
|
21
|
+
"button-1": "font-sans text-[18px] leading-none tracking-[-0.5px]",
|
|
22
|
+
"button-2": "font-sans text-[16px] leading-none tracking-[-0.5px]"
|
|
23
|
+
},
|
|
24
|
+
underline: {
|
|
25
|
+
true: "underline",
|
|
26
|
+
false: ""
|
|
27
|
+
},
|
|
28
|
+
bolder: {
|
|
29
|
+
true: "font-bold",
|
|
30
|
+
false: ""
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
defaultVariants: {
|
|
34
|
+
variant: "body-4",
|
|
35
|
+
underline: !1,
|
|
36
|
+
bolder: !1
|
|
37
|
+
}
|
|
38
|
+
}), o = {
|
|
39
|
+
h1: "h1",
|
|
40
|
+
h2: "h2",
|
|
41
|
+
h3: "h3",
|
|
42
|
+
h4: "h4",
|
|
43
|
+
h5: "h5",
|
|
44
|
+
"body-1": "p",
|
|
45
|
+
"body-2": "p",
|
|
46
|
+
"body-3": "p",
|
|
47
|
+
"body-4": "p",
|
|
48
|
+
"body-5": "p",
|
|
49
|
+
"body-6": "p",
|
|
50
|
+
"button-1": "span",
|
|
51
|
+
"button-2": "span"
|
|
52
|
+
}, s = t.forwardRef(({ className: t, variant: r = "body-4", underline: s, bolder: c, asChild: l, as: u, ...d }, f) => /* @__PURE__ */ i(l ? n : u ?? o[r], {
|
|
53
|
+
ref: f,
|
|
54
|
+
className: e(a({
|
|
55
|
+
variant: r,
|
|
56
|
+
underline: s,
|
|
57
|
+
bolder: c
|
|
58
|
+
}), t),
|
|
59
|
+
...d
|
|
60
|
+
}));
|
|
61
|
+
s.displayName = "Typography";
|
|
62
|
+
//#endregion
|
|
63
|
+
export { s as Typography };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Typography, type TypographyProps } from './Typography';
|
package/dist/lib/cn.d.ts
ADDED
package/dist/lib/cn.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Country } from './countries';
|
|
2
|
+
export interface SelectCountryProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onValueChange?: (code: string) => void;
|
|
6
|
+
/** Override the bundled country list. */
|
|
7
|
+
countries?: Country[];
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
size?: 'sm' | 'lg';
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const SelectCountry: {
|
|
14
|
+
({ value, defaultValue, onValueChange, countries, placeholder, disabled, size, className }: SelectCountryProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Combobox as e } from "../../components/Combobox/Combobox.js";
|
|
2
|
+
import { countries as t } from "./countries.js";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/presets/SelectCountry/SelectCountry.tsx
|
|
6
|
+
var i = ({ value: i, defaultValue: a, onValueChange: o, countries: s = t, placeholder: c = "Seleccionar país", disabled: l, size: u = "sm", className: d }) => /* @__PURE__ */ r(e, {
|
|
7
|
+
options: n.useMemo(() => s.map((e) => ({
|
|
8
|
+
value: e.code,
|
|
9
|
+
label: `${e.flag} ${e.name}`
|
|
10
|
+
})), [s]),
|
|
11
|
+
value: i,
|
|
12
|
+
defaultValue: a,
|
|
13
|
+
onValueChange: o,
|
|
14
|
+
placeholder: c,
|
|
15
|
+
disabled: l,
|
|
16
|
+
size: u,
|
|
17
|
+
className: d
|
|
18
|
+
});
|
|
19
|
+
i.displayName = "SelectCountry";
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as SelectCountry };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal ISO 3166-1 alpha-2 dataset shipped inline.
|
|
3
|
+
* Consumers needing a richer list (regions, currencies) should pass a custom
|
|
4
|
+
* `countries` prop to <SelectCountry />.
|
|
5
|
+
*/
|
|
6
|
+
export interface Country {
|
|
7
|
+
code: string;
|
|
8
|
+
name: string;
|
|
9
|
+
flag: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const countries: Country[];
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
//#region src/presets/SelectCountry/countries.ts
|
|
2
|
+
var e = [
|
|
3
|
+
{
|
|
4
|
+
code: "AR",
|
|
5
|
+
name: "Argentina",
|
|
6
|
+
flag: "🇦🇷"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
code: "BO",
|
|
10
|
+
name: "Bolivia",
|
|
11
|
+
flag: "🇧🇴"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
code: "BR",
|
|
15
|
+
name: "Brasil",
|
|
16
|
+
flag: "🇧🇷"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
code: "CA",
|
|
20
|
+
name: "Canadá",
|
|
21
|
+
flag: "🇨🇦"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
code: "CL",
|
|
25
|
+
name: "Chile",
|
|
26
|
+
flag: "🇨🇱"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
code: "CO",
|
|
30
|
+
name: "Colombia",
|
|
31
|
+
flag: "🇨🇴"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
code: "CR",
|
|
35
|
+
name: "Costa Rica",
|
|
36
|
+
flag: "🇨🇷"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
code: "CU",
|
|
40
|
+
name: "Cuba",
|
|
41
|
+
flag: "🇨🇺"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
code: "EC",
|
|
45
|
+
name: "Ecuador",
|
|
46
|
+
flag: "🇪🇨"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
code: "SV",
|
|
50
|
+
name: "El Salvador",
|
|
51
|
+
flag: "🇸🇻"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
code: "ES",
|
|
55
|
+
name: "España",
|
|
56
|
+
flag: "🇪🇸"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
code: "US",
|
|
60
|
+
name: "Estados Unidos",
|
|
61
|
+
flag: "🇺🇸"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
code: "GT",
|
|
65
|
+
name: "Guatemala",
|
|
66
|
+
flag: "🇬🇹"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
code: "HN",
|
|
70
|
+
name: "Honduras",
|
|
71
|
+
flag: "🇭🇳"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
code: "MX",
|
|
75
|
+
name: "México",
|
|
76
|
+
flag: "🇲🇽"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
code: "NI",
|
|
80
|
+
name: "Nicaragua",
|
|
81
|
+
flag: "🇳🇮"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
code: "PA",
|
|
85
|
+
name: "Panamá",
|
|
86
|
+
flag: "🇵🇦"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
code: "PY",
|
|
90
|
+
name: "Paraguay",
|
|
91
|
+
flag: "🇵🇾"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
code: "PE",
|
|
95
|
+
name: "Perú",
|
|
96
|
+
flag: "🇵🇪"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
code: "PR",
|
|
100
|
+
name: "Puerto Rico",
|
|
101
|
+
flag: "🇵🇷"
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
code: "DO",
|
|
105
|
+
name: "República Dominicana",
|
|
106
|
+
flag: "🇩🇴"
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
code: "UY",
|
|
110
|
+
name: "Uruguay",
|
|
111
|
+
flag: "🇺🇾"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
code: "VE",
|
|
115
|
+
name: "Venezuela",
|
|
116
|
+
flag: "🇻🇪"
|
|
117
|
+
}
|
|
118
|
+
];
|
|
119
|
+
//#endregion
|
|
120
|
+
export { e as countries };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { PhoneCode } from './phoneCodes';
|
|
2
|
+
export interface SelectPhoneProps {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onValueChange?: (code: string) => void;
|
|
6
|
+
codes?: PhoneCode[];
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
size?: 'sm' | 'lg';
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const SelectPhone: {
|
|
13
|
+
({ value, defaultValue, onValueChange, codes, placeholder, disabled, size, className }: SelectPhoneProps): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Combobox as e } from "../../components/Combobox/Combobox.js";
|
|
2
|
+
import { phoneCodes as t } from "./phoneCodes.js";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/presets/SelectPhone/SelectPhone.tsx
|
|
6
|
+
var i = ({ value: i, defaultValue: a, onValueChange: o, codes: s = t, placeholder: c = "Prefijo", disabled: l, size: u = "sm", className: d }) => /* @__PURE__ */ r(e, {
|
|
7
|
+
options: n.useMemo(() => s.map((e) => ({
|
|
8
|
+
value: e.code,
|
|
9
|
+
label: `${e.flag} ${e.dial} ${e.country}`
|
|
10
|
+
})), [s]),
|
|
11
|
+
value: i,
|
|
12
|
+
defaultValue: a,
|
|
13
|
+
onValueChange: o,
|
|
14
|
+
placeholder: c,
|
|
15
|
+
disabled: l,
|
|
16
|
+
size: u,
|
|
17
|
+
className: d
|
|
18
|
+
});
|
|
19
|
+
i.displayName = "SelectPhone";
|
|
20
|
+
//#endregion
|
|
21
|
+
export { i as SelectPhone };
|