ctc-component-library 0.3.0 → 1.0.0-alpha.4
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 +46 -0
- package/dist/components/Button/button.variants.d.ts +22 -0
- package/dist/components/Button/button.variants.js +61 -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 +9 -0
- package/dist/components/Checkbox/Checkbox.js +36 -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 +97 -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 +73 -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 +51 -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 +98 -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 +12 -0
- package/dist/components/RadioGroup/RadioGroup.js +42 -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 +82 -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 +310 -748
- package/package.json +193 -69
- package/dist/index.css +0 -1
- package/dist/index.d.ts +0 -9
- package/dist/index.es.js +0 -45363
- 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 -35
- 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,74 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { Table as t, TableBody as n, TableCell as r, TableHead as i, TableHeader as a, TableRow as o } from "./Table.js";
|
|
3
|
+
import * as s from "react";
|
|
4
|
+
import { jsx as c, jsxs as l } from "react/jsx-runtime";
|
|
5
|
+
import { CaretRight as u, Tray as d } from "@phosphor-icons/react";
|
|
6
|
+
import { flexRender as f, getCoreRowModel as p, getExpandedRowModel as m, getSortedRowModel as h, useReactTable as g } from "@tanstack/react-table";
|
|
7
|
+
//#region src/components/DataTable/DataTable.tsx
|
|
8
|
+
function _({ columns: _, data: v, expandable: y, className: b, emptyText: x = "Sin datos", loading: S, ...C }) {
|
|
9
|
+
let [w, T] = s.useState([]), [E, D] = s.useState({}), O = g({
|
|
10
|
+
data: v,
|
|
11
|
+
columns: _,
|
|
12
|
+
state: {
|
|
13
|
+
sorting: w,
|
|
14
|
+
expanded: E
|
|
15
|
+
},
|
|
16
|
+
onSortingChange: T,
|
|
17
|
+
onExpandedChange: D,
|
|
18
|
+
getRowCanExpand: y ? () => !0 : void 0,
|
|
19
|
+
getCoreRowModel: p(),
|
|
20
|
+
getSortedRowModel: h(),
|
|
21
|
+
getExpandedRowModel: y ? m() : void 0
|
|
22
|
+
}), k = (i) => {
|
|
23
|
+
if (!y) return null;
|
|
24
|
+
if (y.expandedRowRender) return y.expandedRowRender(i.original);
|
|
25
|
+
let a = y.expandedRowData(i.original);
|
|
26
|
+
if (a.length === 0) return null;
|
|
27
|
+
let s = y.alignSubRowsWithParent !== !1, u = y.expandedRowColumns ?? _;
|
|
28
|
+
return /* @__PURE__ */ c("div", {
|
|
29
|
+
className: e("w-full", y.expandedRowNestedClassName),
|
|
30
|
+
children: /* @__PURE__ */ c(t, { children: /* @__PURE__ */ c(n, { children: a.map((e, t) => /* @__PURE__ */ l(o, { children: [s && /* @__PURE__ */ c(r, { className: "w-12" }), u.map((t, n) => {
|
|
31
|
+
let i = t.accessorKey;
|
|
32
|
+
return /* @__PURE__ */ c(r, { children: i ? e[i] : null }, n);
|
|
33
|
+
})] }, t)) }) })
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
return /* @__PURE__ */ c("div", {
|
|
37
|
+
className: e("rounded-x4 border border-gray-20 bg-gray-00", b),
|
|
38
|
+
...C,
|
|
39
|
+
children: /* @__PURE__ */ l(t, { children: [/* @__PURE__ */ c(a, { children: O.getHeaderGroups().map((e) => /* @__PURE__ */ l(o, { children: [y && /* @__PURE__ */ c(i, { className: "w-12" }), e.headers.map((e) => /* @__PURE__ */ c(i, { children: e.isPlaceholder ? null : f(e.column.columnDef.header, e.getContext()) }, e.id))] }, e.id)) }), /* @__PURE__ */ c(n, { children: O.getRowModel().rows.length === 0 ? /* @__PURE__ */ c(o, { children: /* @__PURE__ */ c(r, {
|
|
40
|
+
colSpan: _.length + +!!y,
|
|
41
|
+
className: "h-32 text-center text-gray-60",
|
|
42
|
+
children: S ? "Cargando..." : /* @__PURE__ */ l("span", {
|
|
43
|
+
className: "inline-flex flex-col items-center gap-x2",
|
|
44
|
+
children: [/* @__PURE__ */ c(d, {
|
|
45
|
+
weight: "regular",
|
|
46
|
+
className: "size-8 text-gray-40"
|
|
47
|
+
}), x]
|
|
48
|
+
})
|
|
49
|
+
}) }) : O.getRowModel().rows.map((t) => /* @__PURE__ */ l(s.Fragment, { children: [/* @__PURE__ */ l(o, {
|
|
50
|
+
"data-state": t.getIsSelected() ? "selected" : void 0,
|
|
51
|
+
children: [y && /* @__PURE__ */ c(r, {
|
|
52
|
+
className: "w-12",
|
|
53
|
+
children: /* @__PURE__ */ c("button", {
|
|
54
|
+
type: "button",
|
|
55
|
+
"data-pressable": "",
|
|
56
|
+
onClick: t.getToggleExpandedHandler(),
|
|
57
|
+
"aria-expanded": t.getIsExpanded(),
|
|
58
|
+
"aria-label": t.getIsExpanded() ? "Colapsar fila" : "Expandir fila",
|
|
59
|
+
className: e("inline-flex size-6 items-center justify-center rounded-x1 hover:bg-gray-20", "[transition:background-color_var(--duration-fast)_var(--ease-out),transform_var(--duration-fast)_var(--ease-out)]", "active:scale-[0.92]"),
|
|
60
|
+
children: /* @__PURE__ */ c(u, {
|
|
61
|
+
weight: "bold",
|
|
62
|
+
className: e("size-4 [transition:transform_var(--duration-base)_var(--ease-out)]", t.getIsExpanded() && "rotate-90")
|
|
63
|
+
})
|
|
64
|
+
})
|
|
65
|
+
}), t.getVisibleCells().map((e) => /* @__PURE__ */ c(r, { children: f(e.column.columnDef.cell, e.getContext()) }, e.id))]
|
|
66
|
+
}), t.getIsExpanded() && /* @__PURE__ */ c(o, { children: /* @__PURE__ */ c(r, {
|
|
67
|
+
colSpan: t.getVisibleCells().length + +!!y,
|
|
68
|
+
className: e("bg-gray-20/30 p-0", "[animation:ctc-fade-rise_var(--duration-base)_var(--ease-out)]"),
|
|
69
|
+
children: k(t)
|
|
70
|
+
}) })] }, t.id)) })] })
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
export { _ as DataTable };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const Table: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableElement> & React.RefAttributes<HTMLTableElement>>;
|
|
3
|
+
export declare const TableHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
4
|
+
export declare const TableBody: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
5
|
+
export declare const TableFooter: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableSectionElement> & React.RefAttributes<HTMLTableSectionElement>>;
|
|
6
|
+
export declare const TableRow: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableRowElement> & React.RefAttributes<HTMLTableRowElement>>;
|
|
7
|
+
export declare const TableHead: React.ForwardRefExoticComponent<React.ThHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
8
|
+
export declare const TableCell: React.ForwardRefExoticComponent<React.TdHTMLAttributes<HTMLTableCellElement> & React.RefAttributes<HTMLTableCellElement>>;
|
|
9
|
+
export declare const TableCaption: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLTableCaptionElement> & React.RefAttributes<HTMLTableCaptionElement>>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/DataTable/Table.tsx
|
|
5
|
+
var r = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("div", {
|
|
6
|
+
className: "relative w-full overflow-auto",
|
|
7
|
+
children: /* @__PURE__ */ n("table", {
|
|
8
|
+
ref: i,
|
|
9
|
+
className: e("w-full caption-bottom font-sans text-[14px]", t),
|
|
10
|
+
...r
|
|
11
|
+
})
|
|
12
|
+
}));
|
|
13
|
+
r.displayName = "Table";
|
|
14
|
+
var i = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("thead", {
|
|
15
|
+
ref: i,
|
|
16
|
+
className: e("[&_tr]:border-b border-gray-20", t),
|
|
17
|
+
...r
|
|
18
|
+
}));
|
|
19
|
+
i.displayName = "TableHeader";
|
|
20
|
+
var a = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tbody", {
|
|
21
|
+
ref: i,
|
|
22
|
+
className: e("[&_tr:last-child]:border-0", t),
|
|
23
|
+
...r
|
|
24
|
+
}));
|
|
25
|
+
a.displayName = "TableBody";
|
|
26
|
+
var o = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tfoot", {
|
|
27
|
+
ref: i,
|
|
28
|
+
className: e("bg-gray-20 font-bold [&>tr]:last:border-b-0", t),
|
|
29
|
+
...r
|
|
30
|
+
}));
|
|
31
|
+
o.displayName = "TableFooter";
|
|
32
|
+
var s = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("tr", {
|
|
33
|
+
ref: i,
|
|
34
|
+
className: e("border-b border-gray-20 hover:bg-gray-20/50", "[transition:background-color_var(--duration-fast)_var(--ease-out)]", "data-[state=selected]:bg-gray-20", t),
|
|
35
|
+
...r
|
|
36
|
+
}));
|
|
37
|
+
s.displayName = "TableRow";
|
|
38
|
+
var c = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("th", {
|
|
39
|
+
ref: i,
|
|
40
|
+
className: e("h-12 px-x4 text-left align-middle font-bold text-gray-100 text-[12px]", "[&:has([role=checkbox])]:pr-0", t),
|
|
41
|
+
...r
|
|
42
|
+
}));
|
|
43
|
+
c.displayName = "TableHead";
|
|
44
|
+
var l = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("td", {
|
|
45
|
+
ref: i,
|
|
46
|
+
className: e("p-x4 align-middle text-gray-80", "[&:has([role=checkbox])]:pr-0", t),
|
|
47
|
+
...r
|
|
48
|
+
}));
|
|
49
|
+
l.displayName = "TableCell";
|
|
50
|
+
var u = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n("caption", {
|
|
51
|
+
ref: i,
|
|
52
|
+
className: e("mt-x4 text-[12px] text-gray-60", t),
|
|
53
|
+
...r
|
|
54
|
+
}));
|
|
55
|
+
u.displayName = "TableCaption";
|
|
56
|
+
//#endregion
|
|
57
|
+
export { r as Table, a as TableBody, u as TableCaption, l as TableCell, o as TableFooter, c as TableHead, i as TableHeader, s as TableRow };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { DataTable, type DataTableProps, type ExpandableConfig } from './DataTable';
|
|
2
|
+
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption } from './Table';
|
|
3
|
+
export type { ColumnDef, ColumnFiltersState, SortingState } from '@tanstack/react-table';
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Table as e, TableBody as t, TableCaption as n, TableCell as r, TableFooter as i, TableHead as a, TableHeader as o, TableRow as s } from "./Table.js";
|
|
2
|
+
import { DataTable as c } from "./DataTable.js";
|
|
3
|
+
export { c as DataTable, e as Table, t as TableBody, n as TableCaption, r as TableCell, i as TableFooter, a as TableHead, o as TableHeader, s as TableRow };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { DayPickerProps } from 'react-day-picker';
|
|
2
|
+
import { Input } from '../Input/Input';
|
|
3
|
+
export interface DatePickerProps {
|
|
4
|
+
value?: Date;
|
|
5
|
+
defaultValue?: Date;
|
|
6
|
+
onValueChange?: (date: Date | undefined) => void;
|
|
7
|
+
placeholder?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
locale?: string;
|
|
10
|
+
size?: 'sm' | 'lg';
|
|
11
|
+
className?: string;
|
|
12
|
+
/** Forwarded to the underlying DayPicker. */
|
|
13
|
+
calendarProps?: Omit<DayPickerProps, 'mode' | 'selected' | 'onSelect'>;
|
|
14
|
+
'data-testid'?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const DatePicker: {
|
|
17
|
+
({ value, defaultValue, onValueChange, placeholder, disabled, locale, size, className, calendarProps, ...props }: DatePickerProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
export { Input };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import { inputVariants as t } from "../Input/Input.js";
|
|
3
|
+
import { Popover as n, PopoverContent as r, PopoverTrigger as i } from "../Popover/Popover.js";
|
|
4
|
+
import * as a from "react";
|
|
5
|
+
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
6
|
+
import { CalendarIcon as c, CaretLeftIcon as l, CaretRightIcon as u } from "@phosphor-icons/react";
|
|
7
|
+
import { DayPicker as d } from "react-day-picker";
|
|
8
|
+
//#region src/components/DatePicker/DatePicker.tsx
|
|
9
|
+
var f = (e, t = "es-AR") => e ? new Intl.DateTimeFormat(t, { dateStyle: "medium" }).format(e) : "", p = (e, t = "es-AR") => {
|
|
10
|
+
let n = new Intl.DateTimeFormat(t, { weekday: "short" }).format(e).replace(/\.$/, "");
|
|
11
|
+
return n.charAt(0).toUpperCase() + n.slice(1).toLowerCase();
|
|
12
|
+
}, m = ({ value: m, defaultValue: h, onValueChange: g, placeholder: _ = "Seleccionar fecha", disabled: v, locale: y = "es-AR", size: b = "sm", className: x, calendarProps: S, ...C }) => {
|
|
13
|
+
let [w, T] = a.useState(h), [E, D] = a.useState(!1), O = m !== void 0, k = O ? m : w, A = (e) => {
|
|
14
|
+
O || T(e), g?.(e), D(!1);
|
|
15
|
+
};
|
|
16
|
+
return /* @__PURE__ */ s(n, {
|
|
17
|
+
open: E,
|
|
18
|
+
onOpenChange: D,
|
|
19
|
+
children: [/* @__PURE__ */ o(i, {
|
|
20
|
+
asChild: !0,
|
|
21
|
+
children: /* @__PURE__ */ s("button", {
|
|
22
|
+
type: "button",
|
|
23
|
+
disabled: v,
|
|
24
|
+
className: e(t({ size: b }), "inline-flex items-center justify-between text-left", !k && "text-gray-40", x),
|
|
25
|
+
...C,
|
|
26
|
+
children: [/* @__PURE__ */ o("span", { children: k ? f(k, y) : _ }), /* @__PURE__ */ o(c, {
|
|
27
|
+
weight: "regular",
|
|
28
|
+
className: "size-5 text-gray-60 ml-x2 shrink-0"
|
|
29
|
+
})]
|
|
30
|
+
})
|
|
31
|
+
}), /* @__PURE__ */ o(r, {
|
|
32
|
+
className: "w-[284px] p-x4 rounded-x4 bg-gray-00",
|
|
33
|
+
align: "start",
|
|
34
|
+
children: /* @__PURE__ */ o(d, {
|
|
35
|
+
mode: "single",
|
|
36
|
+
selected: k,
|
|
37
|
+
onSelect: A,
|
|
38
|
+
showOutsideDays: !0,
|
|
39
|
+
weekStartsOn: 1,
|
|
40
|
+
formatters: { formatWeekdayName: (e) => p(e, y) },
|
|
41
|
+
...S,
|
|
42
|
+
components: { Chevron: ({ orientation: e }) => o(e === "left" ? l : u, {
|
|
43
|
+
weight: "bold",
|
|
44
|
+
className: "size-4"
|
|
45
|
+
}) },
|
|
46
|
+
classNames: {
|
|
47
|
+
root: "p-0 font-sans",
|
|
48
|
+
months: "flex flex-col gap-x3",
|
|
49
|
+
month: "flex flex-col gap-x3 relative",
|
|
50
|
+
month_caption: "flex items-center justify-center h-6 font-sans font-bold text-[18px] leading-[24px] text-gray-80 tracking-[-0.5px]",
|
|
51
|
+
caption_label: "",
|
|
52
|
+
nav: "absolute top-0 left-0 right-0 flex items-center justify-between z-10",
|
|
53
|
+
button_previous: e("inline-flex items-center justify-center size-6 rounded-x1 text-gray-80", "hover:bg-gray-20 [transition:background-color_var(--duration-fast)_var(--ease-out)]", "disabled:opacity-40 disabled:cursor-not-allowed"),
|
|
54
|
+
button_next: e("inline-flex items-center justify-center size-6 rounded-x1 text-gray-80", "hover:bg-gray-20 [transition:background-color_var(--duration-fast)_var(--ease-out)]", "disabled:opacity-40 disabled:cursor-not-allowed"),
|
|
55
|
+
month_grid: "w-full border-collapse",
|
|
56
|
+
weekdays: "",
|
|
57
|
+
weekday: "text-[11px] leading-[14px] tracking-[-0.5px] text-gray-40 font-medium w-9 h-8 align-middle text-center",
|
|
58
|
+
week: "",
|
|
59
|
+
day: "p-0 text-center align-middle",
|
|
60
|
+
day_button: e("size-8 rounded-x2 inline-flex items-center justify-center mx-auto", "font-medium text-[15px] leading-[24px] tracking-[-0.5px] text-gray-80", "[transition:background-color_var(--duration-fast)_var(--ease-out),color_var(--duration-fast)_var(--ease-out),border-color_var(--duration-fast)_var(--ease-out),transform_var(--duration-fast)_var(--ease-out)]", "hover:bg-gray-20 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring", "active:scale-[var(--press-scale)] disabled:active:transform-none", "border border-transparent"),
|
|
61
|
+
today: "[&_button]:font-bold",
|
|
62
|
+
selected: "[&_button]:border-gray-60 [&_button]:font-bold [&_button:hover]:bg-gray-20",
|
|
63
|
+
outside: "[&_button]:text-gray-20 [&_button]:hover:bg-transparent",
|
|
64
|
+
disabled: "[&_button]:text-gray-40 [&_button]:cursor-not-allowed [&_button:hover]:bg-transparent",
|
|
65
|
+
hidden: "invisible"
|
|
66
|
+
}
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
m.displayName = "DatePicker";
|
|
72
|
+
//#endregion
|
|
73
|
+
export { m as DatePicker };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { DatePicker, type DatePickerProps } from './DatePicker';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import * as DialogPrimitive from '@radix-ui/react-dialog';
|
|
3
|
+
export declare const Dialog: React.FC<DialogPrimitive.DialogProps>;
|
|
4
|
+
export declare const DialogTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
6
|
+
export declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
|
+
export declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export interface DialogContentProps extends React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> {
|
|
9
|
+
hideCloseButton?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare const DialogContent: React.ForwardRefExoticComponent<DialogContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const DialogHeader: {
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const DialogFooter: {
|
|
17
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
displayName: string;
|
|
19
|
+
};
|
|
20
|
+
export declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
21
|
+
export declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
@@ -0,0 +1,51 @@
|
|
|
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 { X as i } from "@phosphor-icons/react";
|
|
5
|
+
import * as a from "@radix-ui/react-dialog";
|
|
6
|
+
//#region src/components/Dialog/Dialog.tsx
|
|
7
|
+
var o = a.Root, s = a.Trigger, c = a.Portal, l = a.Close, u = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n(a.Overlay, {
|
|
8
|
+
ref: i,
|
|
9
|
+
className: e("fixed inset-0 z-50 bg-gray-100/50", "data-[state=open]:[animation:ctc-overlay-in_var(--modal-open-dur)_var(--modal-ease)_both]", "data-[state=closed]:[animation:ctc-overlay-out_var(--modal-close-dur)_var(--modal-ease)_both]", t),
|
|
10
|
+
...r
|
|
11
|
+
}));
|
|
12
|
+
u.displayName = "DialogOverlay";
|
|
13
|
+
var d = t.forwardRef(({ className: t, children: o, hideCloseButton: s = !1, ...l }, d) => /* @__PURE__ */ r(c, { children: [/* @__PURE__ */ n(u, {}), /* @__PURE__ */ r(a.Content, {
|
|
14
|
+
ref: d,
|
|
15
|
+
className: e("fixed left-1/2 top-1/2 z-50", "w-full max-w-[475px] rounded-x4 border border-gray-20 bg-gray-00 p-x6 shadow-lg", "origin-center", "data-[state=open]:[animation:ctc-modal-in_var(--modal-open-dur)_var(--modal-ease)_both]", "data-[state=closed]:[animation:ctc-modal-out_var(--modal-close-dur)_var(--modal-ease)_both]", "flex flex-col gap-x4", t),
|
|
16
|
+
...l,
|
|
17
|
+
children: [o, !s && /* @__PURE__ */ n(a.Close, {
|
|
18
|
+
"aria-label": "Cerrar",
|
|
19
|
+
"data-pressable": "",
|
|
20
|
+
className: e("absolute right-x4 top-x4 inline-flex size-8 items-center justify-center rounded-x2", "text-gray-60 hover:text-gray-80 hover:bg-gray-20", "[transition:transform_var(--duration-fast)_var(--ease-out),background-color_var(--duration-fast)_var(--ease-out),color_var(--duration-fast)_var(--ease-out)]", "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring"),
|
|
21
|
+
children: /* @__PURE__ */ n(i, {
|
|
22
|
+
weight: "bold",
|
|
23
|
+
className: "size-5"
|
|
24
|
+
})
|
|
25
|
+
})]
|
|
26
|
+
})] }));
|
|
27
|
+
d.displayName = "DialogContent";
|
|
28
|
+
var f = ({ className: t, ...r }) => /* @__PURE__ */ n("div", {
|
|
29
|
+
className: e("flex flex-col gap-x2 pr-x8", t),
|
|
30
|
+
...r
|
|
31
|
+
});
|
|
32
|
+
f.displayName = "DialogHeader";
|
|
33
|
+
var p = ({ className: t, ...r }) => /* @__PURE__ */ n("div", {
|
|
34
|
+
className: e("flex flex-col-reverse sm:flex-row sm:justify-end gap-x2", t),
|
|
35
|
+
...r
|
|
36
|
+
});
|
|
37
|
+
p.displayName = "DialogFooter";
|
|
38
|
+
var m = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n(a.Title, {
|
|
39
|
+
ref: i,
|
|
40
|
+
className: e("font-display font-light text-[24px] leading-[30px] tracking-[0.8px] text-gray-100", t),
|
|
41
|
+
...r
|
|
42
|
+
}));
|
|
43
|
+
m.displayName = "DialogTitle";
|
|
44
|
+
var h = t.forwardRef(({ className: t, ...r }, i) => /* @__PURE__ */ n(a.Description, {
|
|
45
|
+
ref: i,
|
|
46
|
+
className: e("font-sans text-[16px] leading-[22px] text-gray-60", t),
|
|
47
|
+
...r
|
|
48
|
+
}));
|
|
49
|
+
h.displayName = "DialogDescription";
|
|
50
|
+
//#endregion
|
|
51
|
+
export { o as Dialog, l as DialogClose, d as DialogContent, h as DialogDescription, p as DialogFooter, f as DialogHeader, u as DialogOverlay, c as DialogPortal, m as DialogTitle, s as DialogTrigger };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dialog, DialogTrigger, DialogPortal, DialogClose, DialogOverlay, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, type DialogContentProps } from './Dialog';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Dialog as e, DialogClose as t, DialogContent as n, DialogDescription as r, DialogFooter as i, DialogHeader as a, DialogOverlay as o, DialogPortal as s, DialogTitle as c, DialogTrigger as l } from "./Dialog.js";
|
|
2
|
+
export { e as Dialog, t as DialogClose, n as DialogContent, r as DialogDescription, i as DialogFooter, a as DialogHeader, o as DialogOverlay, s as DialogPortal, c as DialogTitle, l as DialogTrigger };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const FieldGroup: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
|
|
3
|
+
export interface FieldProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
asChild?: boolean;
|
|
5
|
+
/** Marks the field invalid; downstream control should also receive aria-invalid. */
|
|
6
|
+
'data-invalid'?: boolean;
|
|
7
|
+
/** Marks the field disabled; downstream control should also receive disabled. */
|
|
8
|
+
'data-disabled'?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Field: React.ForwardRefExoticComponent<FieldProps & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export interface FieldLabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
|
|
12
|
+
/**
|
|
13
|
+
* Visual size, paired with the input it labels.
|
|
14
|
+
* - `sm` → 18px / Body3 (default; pairs with sm Input).
|
|
15
|
+
* - `lg` → 20px / Body2 (pairs with lg Input).
|
|
16
|
+
*/
|
|
17
|
+
size?: 'sm' | 'lg';
|
|
18
|
+
}
|
|
19
|
+
export declare const FieldLabel: React.ForwardRefExoticComponent<FieldLabelProps & React.RefAttributes<HTMLLabelElement>>;
|
|
20
|
+
export declare const FieldDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
21
|
+
export declare const FieldSet: React.ForwardRefExoticComponent<React.FieldsetHTMLAttributes<HTMLFieldSetElement> & React.RefAttributes<HTMLFieldSetElement>>;
|
|
22
|
+
export declare const FieldLegend: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLLegendElement> & React.RefAttributes<HTMLLegendElement>>;
|
|
@@ -0,0 +1,43 @@
|
|
|
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 { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Field/Field.tsx
|
|
6
|
+
var i = t.forwardRef(({ className: t, ...n }, i) => /* @__PURE__ */ r("div", {
|
|
7
|
+
ref: i,
|
|
8
|
+
className: e("flex flex-col gap-x4", t),
|
|
9
|
+
...n
|
|
10
|
+
}));
|
|
11
|
+
i.displayName = "FieldGroup";
|
|
12
|
+
var a = t.forwardRef(({ className: t, asChild: i, ...a }, o) => /* @__PURE__ */ r(i ? n : "div", {
|
|
13
|
+
ref: o,
|
|
14
|
+
className: e("flex flex-col gap-x1", "data-[invalid=true]:[--field-border:var(--color-error)]", "[transition:color_var(--duration-fast)_var(--ease-out)]", t),
|
|
15
|
+
...a
|
|
16
|
+
}));
|
|
17
|
+
a.displayName = "Field";
|
|
18
|
+
var o = t.forwardRef(({ className: t, size: n = "sm", ...i }, a) => /* @__PURE__ */ r("label", {
|
|
19
|
+
ref: a,
|
|
20
|
+
className: e("font-sans text-gray-80 mb-x3", n === "sm" && "text-[18px] leading-[24px]", n === "lg" && "text-[20px] leading-[24px]", "peer-disabled:cursor-not-allowed peer-disabled:opacity-70", "[[data-invalid=true]_&]:text-error", "[[data-disabled=true]_&]:text-gray-40", t),
|
|
21
|
+
...i
|
|
22
|
+
}));
|
|
23
|
+
o.displayName = "FieldLabel";
|
|
24
|
+
var s = t.forwardRef(({ className: t, ...n }, i) => /* @__PURE__ */ r("p", {
|
|
25
|
+
ref: i,
|
|
26
|
+
className: e("font-sans text-[12px] leading-[16px] text-gray-60", "[[data-invalid=true]_&]:text-error", t),
|
|
27
|
+
...n
|
|
28
|
+
}));
|
|
29
|
+
s.displayName = "FieldDescription";
|
|
30
|
+
var c = t.forwardRef(({ className: t, ...n }, i) => /* @__PURE__ */ r("fieldset", {
|
|
31
|
+
ref: i,
|
|
32
|
+
className: e("flex flex-col gap-x2 border-0 m-0 p-0", t),
|
|
33
|
+
...n
|
|
34
|
+
}));
|
|
35
|
+
c.displayName = "FieldSet";
|
|
36
|
+
var l = t.forwardRef(({ className: t, ...n }, i) => /* @__PURE__ */ r("legend", {
|
|
37
|
+
ref: i,
|
|
38
|
+
className: e("font-sans font-bold text-[14px] leading-[20px] text-gray-80 mb-x2", t),
|
|
39
|
+
...n
|
|
40
|
+
}));
|
|
41
|
+
l.displayName = "FieldLegend";
|
|
42
|
+
//#endregion
|
|
43
|
+
export { a as Field, s as FieldDescription, i as FieldGroup, o as FieldLabel, l as FieldLegend, c as FieldSet };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { FieldGroup, Field, FieldLabel, FieldDescription, FieldSet, FieldLegend, type FieldProps, type FieldLabelProps } from './Field';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Icon as PhosphorIconType, IconProps as PhosphorIconProps } from '@phosphor-icons/react';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export interface IconProps extends Omit<PhosphorIconProps, 'ref'> {
|
|
4
|
+
icon: PhosphorIconType;
|
|
5
|
+
}
|
|
6
|
+
export declare const Icon: React.ForwardRefExoticComponent<IconProps & React.RefAttributes<SVGSVGElement>>;
|
|
7
|
+
export type { PhosphorIconType, PhosphorIconProps };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/Icon/Icon.tsx
|
|
5
|
+
var r = t.forwardRef(({ icon: t, className: r, weight: i = "regular", ...a }, o) => /* @__PURE__ */ n(t, {
|
|
6
|
+
ref: o,
|
|
7
|
+
weight: i,
|
|
8
|
+
className: e("shrink-0", r),
|
|
9
|
+
...a
|
|
10
|
+
}));
|
|
11
|
+
r.displayName = "Icon";
|
|
12
|
+
//#endregion
|
|
13
|
+
export { r as Icon };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Icon wrapper for Phosphor icons.
|
|
3
|
+
*
|
|
4
|
+
* Phosphor icons are NOT re-exported from this subpath because their names
|
|
5
|
+
* collide with components in this lib (e.g. `Spinner`, `Tabs`, `Table`).
|
|
6
|
+
* Import them directly from `@phosphor-icons/react`:
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* import { Heart, CheckCircle } from '@phosphor-icons/react';
|
|
10
|
+
* import { Icon } from 'ctc-component-library/icon';
|
|
11
|
+
* <Icon icon={Heart} weight="fill" />
|
|
12
|
+
*/
|
|
13
|
+
export { Icon, type IconProps, type PhosphorIconType, type PhosphorIconProps } from './Icon';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { VariantProps } from 'class-variance-authority';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Input — pixel-perfect to Figma spec.
|
|
5
|
+
*
|
|
6
|
+
* Sizes:
|
|
7
|
+
* sm → h=48px, stroke 1px, radius 12px (rounded-x3), L/R padding 18px,
|
|
8
|
+
* text Body3/Rg (18px), inner icons 24px.
|
|
9
|
+
* lg → h=60px, stroke 1px, radius 16px (rounded-x4), L/R padding 24px,
|
|
10
|
+
* text Body2/Rg (20px), inner icons 32px.
|
|
11
|
+
*
|
|
12
|
+
* State colors per Figma:
|
|
13
|
+
* default → stroke gray-80, content gray-40 (placeholder) / gray-100 (typing)
|
|
14
|
+
* hover-empty → stroke gray-60
|
|
15
|
+
* hover-filled → stroke gray-80
|
|
16
|
+
* focus → stroke gray-80, content gray-100
|
|
17
|
+
* completed → stroke gray-80, content gray-80
|
|
18
|
+
* disabled → stroke gray-20, content gray-40
|
|
19
|
+
* error → stroke error, content gray-80
|
|
20
|
+
* read-only → stroke gray-20, content gray-80
|
|
21
|
+
*/
|
|
22
|
+
export declare const inputVariants: (props?: ({
|
|
23
|
+
size?: "sm" | "lg" | null | undefined;
|
|
24
|
+
} & import('class-variance-authority/types').ClassProp) | undefined) => string;
|
|
25
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'>, VariantProps<typeof inputVariants> {
|
|
26
|
+
}
|
|
27
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
28
|
+
export interface InputGroupProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
29
|
+
size?: 'sm' | 'lg';
|
|
30
|
+
disabled?: boolean;
|
|
31
|
+
invalid?: boolean;
|
|
32
|
+
}
|
|
33
|
+
export declare const InputGroup: React.ForwardRefExoticComponent<InputGroupProps & React.RefAttributes<HTMLDivElement>>;
|
|
34
|
+
export declare const InputGroupInput: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
35
|
+
export declare const InputGroupPrefix: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
36
|
+
export declare const InputGroupSuffix: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
37
|
+
/**
|
|
38
|
+
* InputGroupBadge — for "USD" / "MX$" / unit suffixes that have a tonal
|
|
39
|
+
* background (per Figma spec, suffix/prefix uses BG Gray20).
|
|
40
|
+
*/
|
|
41
|
+
export declare const InputGroupBadge: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLSpanElement> & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { cva as n } from "class-variance-authority";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
//#region src/components/Input/Input.tsx
|
|
6
|
+
var i = n([
|
|
7
|
+
"flex w-full bg-gray-00 font-sans text-gray-100",
|
|
8
|
+
"border border-gray-80",
|
|
9
|
+
"[transition:border-color_var(--duration-fast)_var(--ease-out),box-shadow_var(--duration-fast)_var(--ease-out),background-color_var(--duration-fast)_var(--ease-out)]",
|
|
10
|
+
"placeholder:text-gray-40",
|
|
11
|
+
"hover:border-gray-60 hover:placeholder:text-gray-60",
|
|
12
|
+
"focus-visible:outline-none focus-visible:border-gray-80 focus-visible:text-gray-100",
|
|
13
|
+
"disabled:cursor-not-allowed disabled:bg-gray-00 disabled:border-gray-20 disabled:text-gray-40 disabled:placeholder:text-gray-40",
|
|
14
|
+
"read-only:border-gray-20 read-only:text-gray-80",
|
|
15
|
+
"aria-invalid:border-error aria-invalid:hover:border-error aria-invalid:focus-visible:border-error"
|
|
16
|
+
], {
|
|
17
|
+
variants: { size: {
|
|
18
|
+
sm: "h-12 px-[18px] rounded-x3 text-[18px] leading-[24px]",
|
|
19
|
+
lg: "h-[60px] px-x6 rounded-x4 text-[20px] leading-[24px]"
|
|
20
|
+
} },
|
|
21
|
+
defaultVariants: { size: "sm" }
|
|
22
|
+
}), a = t.forwardRef(({ className: t, type: n = "text", size: a, ...o }, s) => /* @__PURE__ */ r("input", {
|
|
23
|
+
ref: s,
|
|
24
|
+
type: n,
|
|
25
|
+
className: e(i({ size: a }), t),
|
|
26
|
+
...o
|
|
27
|
+
}));
|
|
28
|
+
a.displayName = "Input";
|
|
29
|
+
var o = t.createContext({ size: "sm" }), s = t.forwardRef(({ className: t, size: n = "sm", disabled: i, invalid: a, ...s }, c) => /* @__PURE__ */ r(o.Provider, {
|
|
30
|
+
value: { size: n },
|
|
31
|
+
children: /* @__PURE__ */ r("div", {
|
|
32
|
+
ref: c,
|
|
33
|
+
"data-disabled": i || void 0,
|
|
34
|
+
"data-invalid": a || void 0,
|
|
35
|
+
className: e("flex w-full items-center bg-gray-00 font-sans text-gray-100", "border border-gray-80", "[transition:border-color_var(--duration-fast)_var(--ease-out)]", "hover:border-gray-60 focus-within:border-gray-80", "data-[disabled]:cursor-not-allowed data-[disabled]:border-gray-20 data-[disabled]:text-gray-40", "data-[invalid]:border-error data-[invalid]:hover:border-error", n === "sm" && "h-12 rounded-x3 text-[18px] leading-[24px] gap-x4 px-[18px]", n === "lg" && "h-[60px] rounded-x4 text-[20px] leading-[24px] gap-x3 px-x6", t),
|
|
36
|
+
...s
|
|
37
|
+
})
|
|
38
|
+
}));
|
|
39
|
+
s.displayName = "InputGroup";
|
|
40
|
+
var c = t.forwardRef(({ className: t, type: n = "text", ...i }, a) => /* @__PURE__ */ r("input", {
|
|
41
|
+
ref: a,
|
|
42
|
+
type: n,
|
|
43
|
+
className: e("flex-1 min-w-0 bg-transparent border-0 outline-none", "font-sans text-current", "placeholder:text-gray-40", "disabled:cursor-not-allowed", "[appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none", t),
|
|
44
|
+
...i
|
|
45
|
+
}));
|
|
46
|
+
c.displayName = "InputGroupInput";
|
|
47
|
+
var l = t.forwardRef(({ className: n, side: i, ...a }, s) => {
|
|
48
|
+
let { size: c } = t.useContext(o);
|
|
49
|
+
return /* @__PURE__ */ r("span", {
|
|
50
|
+
ref: s,
|
|
51
|
+
"data-side": i,
|
|
52
|
+
className: e("inline-flex items-center justify-center text-gray-60 shrink-0", c === "sm" && "[&_svg]:size-6", c === "lg" && "[&_svg]:size-8", n),
|
|
53
|
+
...a
|
|
54
|
+
});
|
|
55
|
+
});
|
|
56
|
+
l.displayName = "InputGroupAddon";
|
|
57
|
+
var u = t.forwardRef((e, t) => /* @__PURE__ */ r(l, {
|
|
58
|
+
...e,
|
|
59
|
+
side: "prefix",
|
|
60
|
+
ref: t
|
|
61
|
+
}));
|
|
62
|
+
u.displayName = "InputGroupPrefix";
|
|
63
|
+
var d = t.forwardRef((e, t) => /* @__PURE__ */ r(l, {
|
|
64
|
+
...e,
|
|
65
|
+
side: "suffix",
|
|
66
|
+
ref: t
|
|
67
|
+
}));
|
|
68
|
+
d.displayName = "InputGroupSuffix";
|
|
69
|
+
var f = t.forwardRef(({ className: n, ...i }, a) => {
|
|
70
|
+
let { size: s } = t.useContext(o);
|
|
71
|
+
return /* @__PURE__ */ r("span", {
|
|
72
|
+
ref: a,
|
|
73
|
+
className: e("inline-flex items-center justify-center bg-gray-20 text-gray-80 font-sans shrink-0", "-my-px", s === "sm" && [
|
|
74
|
+
"h-12 px-x4 text-[18px] leading-[24px] rounded-x3",
|
|
75
|
+
"[&:first-child]:-ml-[19px] [&:first-child]:rounded-r-none",
|
|
76
|
+
"[&:last-child]:-mr-[19px] [&:last-child]:rounded-l-none"
|
|
77
|
+
], s === "lg" && [
|
|
78
|
+
"h-[60px] px-x6 text-[20px] leading-[24px] rounded-x4",
|
|
79
|
+
"[&:first-child]:-ml-[25px] [&:first-child]:rounded-r-none",
|
|
80
|
+
"[&:last-child]:-mr-[25px] [&:last-child]:rounded-l-none"
|
|
81
|
+
], n),
|
|
82
|
+
...i
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
f.displayName = "InputGroupBadge";
|
|
86
|
+
//#endregion
|
|
87
|
+
export { a as Input, s as InputGroup, f as InputGroupBadge, c as InputGroupInput, u as InputGroupPrefix, d as InputGroupSuffix, i as inputVariants };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Input, inputVariants, InputGroup, InputGroupInput, InputGroupPrefix, InputGroupSuffix, InputGroupBadge, type InputProps, type InputGroupProps } from './Input';
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Input as e, InputGroup as t, InputGroupBadge as n, InputGroupInput as r, InputGroupPrefix as i, InputGroupSuffix as a, inputVariants as o } from "./Input.js";
|
|
2
|
+
export { e as Input, t as InputGroup, n as InputGroupBadge, r as InputGroupInput, i as InputGroupPrefix, a as InputGroupSuffix, o as inputVariants };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { cn as e } from "../../lib/cn.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
4
|
+
import * as r from "@radix-ui/react-label";
|
|
5
|
+
//#region src/components/Label/Label.tsx
|
|
6
|
+
var i = t.forwardRef(({ className: t, ...i }, a) => /* @__PURE__ */ n(r.Root, {
|
|
7
|
+
ref: a,
|
|
8
|
+
className: e("font-sans text-[14px] leading-none text-gray-80", "peer-disabled:cursor-not-allowed peer-disabled:opacity-70", t),
|
|
9
|
+
...i
|
|
10
|
+
}));
|
|
11
|
+
i.displayName = "Label";
|
|
12
|
+
//#endregion
|
|
13
|
+
export { i as Label };
|