@xjur-ui/react 1.0.6 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build.log +279 -68
- package/CHANGELOG.md +114 -0
- package/README.md +146 -0
- package/dist/chunk-2CM3SFOY.js +2 -0
- package/dist/chunk-2CM3SFOY.js.map +1 -0
- package/dist/chunk-2CTBH6VI.js +2 -0
- package/dist/chunk-2CTBH6VI.js.map +1 -0
- package/dist/chunk-4BGTC333.js +2 -0
- package/dist/chunk-4BGTC333.js.map +1 -0
- package/dist/chunk-5WLIDYZH.js +2 -0
- package/dist/chunk-5WLIDYZH.js.map +1 -0
- package/dist/chunk-6AD6O6II.js +2 -0
- package/dist/chunk-6AD6O6II.js.map +1 -0
- package/dist/chunk-AA6V5YEC.js +2 -0
- package/dist/chunk-AA6V5YEC.js.map +1 -0
- package/dist/chunk-BK6FP63A.js +2 -0
- package/dist/chunk-BK6FP63A.js.map +1 -0
- package/dist/chunk-BZDGWC5O.js +2 -0
- package/dist/chunk-BZDGWC5O.js.map +1 -0
- package/dist/chunk-CBFC4QME.js +2 -0
- package/dist/chunk-CBFC4QME.js.map +1 -0
- package/dist/chunk-CI3ZXWEX.js +2 -0
- package/dist/chunk-CI3ZXWEX.js.map +1 -0
- package/dist/chunk-DFXHNK5D.js +2 -0
- package/dist/chunk-DFXHNK5D.js.map +1 -0
- package/dist/chunk-EIG6CBTQ.js +2 -0
- package/dist/chunk-EIG6CBTQ.js.map +1 -0
- package/dist/chunk-EXC2XOL6.js +2 -0
- package/dist/chunk-EXC2XOL6.js.map +1 -0
- package/dist/chunk-F4DYKYWJ.js +2 -0
- package/dist/chunk-F4DYKYWJ.js.map +1 -0
- package/dist/chunk-F5ZLEQGN.js +2 -0
- package/dist/chunk-F5ZLEQGN.js.map +1 -0
- package/dist/chunk-IKL6PSXU.js +2 -0
- package/dist/chunk-IKL6PSXU.js.map +1 -0
- package/dist/chunk-IRHU7PDO.js +2 -0
- package/dist/chunk-IRHU7PDO.js.map +1 -0
- package/dist/chunk-J4X5RQTR.js +2 -0
- package/dist/chunk-J4X5RQTR.js.map +1 -0
- package/dist/chunk-KIFR5VIE.js +2 -0
- package/dist/chunk-KIFR5VIE.js.map +1 -0
- package/dist/chunk-KS6WGBHQ.js +2 -0
- package/dist/chunk-KS6WGBHQ.js.map +1 -0
- package/dist/chunk-L4ET6GIZ.js +2 -0
- package/dist/chunk-L4ET6GIZ.js.map +1 -0
- package/dist/chunk-MZSV4LNY.js +2 -0
- package/dist/chunk-MZSV4LNY.js.map +1 -0
- package/dist/chunk-NELCN6E2.js +2 -0
- package/dist/chunk-NELCN6E2.js.map +1 -0
- package/dist/chunk-OS53BV63.js +3 -0
- package/dist/chunk-OS53BV63.js.map +1 -0
- package/dist/chunk-PKCW37CJ.js +2 -0
- package/dist/chunk-PKCW37CJ.js.map +1 -0
- package/dist/chunk-RWMV7APX.js +2 -0
- package/dist/chunk-RWMV7APX.js.map +1 -0
- package/dist/chunk-SLAAEXWI.js +2 -0
- package/dist/chunk-SLAAEXWI.js.map +1 -0
- package/dist/chunk-SXGSWVMZ.js +2 -0
- package/dist/chunk-SXGSWVMZ.js.map +1 -0
- package/dist/chunk-TB6KI6CL.js +2 -0
- package/dist/chunk-TB6KI6CL.js.map +1 -0
- package/dist/chunk-TSVURBUY.js +2 -0
- package/dist/chunk-TSVURBUY.js.map +1 -0
- package/dist/chunk-UXIVZWLB.js +2 -0
- package/dist/chunk-UXIVZWLB.js.map +1 -0
- package/dist/chunk-WEBAXQID.js +2 -0
- package/dist/chunk-WEBAXQID.js.map +1 -0
- package/dist/chunk-WV7QV2PU.js +2 -0
- package/dist/chunk-WV7QV2PU.js.map +1 -0
- package/dist/chunk-Z47R2CIM.js +2 -0
- package/dist/chunk-Z47R2CIM.js.map +1 -0
- package/dist/chunk-ZVVPUP7V.js +2 -0
- package/dist/chunk-ZVVPUP7V.js.map +1 -0
- package/dist/components/avatar-group.js +2 -179
- package/dist/components/avatar-group.js.map +1 -0
- package/dist/components/avatar.js +2 -59
- package/dist/components/avatar.js.map +1 -0
- package/dist/components/badge.js +2 -111
- package/dist/components/badge.js.map +1 -0
- package/dist/components/breadcrumb.d.ts +20 -0
- package/dist/components/breadcrumb.js +2 -0
- package/dist/components/breadcrumb.js.map +1 -0
- package/dist/components/chip.d.ts +5 -2
- package/dist/components/chip.js +2 -256
- package/dist/components/chip.js.map +1 -0
- package/dist/components/collapsible.js +2 -41
- package/dist/components/collapsible.js.map +1 -0
- package/dist/components/dialog.d.ts +51 -0
- package/dist/components/dialog.js +2 -0
- package/dist/components/dialog.js.map +1 -0
- package/dist/components/divider.js +2 -29
- package/dist/components/divider.js.map +1 -0
- package/dist/components/drag-and-drop/drag-handle.d.ts +15 -0
- package/dist/components/drag-and-drop/drag-handle.js +2 -0
- package/dist/components/drag-and-drop/drag-handle.js.map +1 -0
- package/dist/components/drag-and-drop/drag-list-item.d.ts +14 -0
- package/dist/components/drag-and-drop/drag-list-item.js +2 -0
- package/dist/components/drag-and-drop/drag-list-item.js.map +1 -0
- package/dist/components/drag-and-drop/drag-list.d.ts +14 -0
- package/dist/components/drag-and-drop/drag-list.js +2 -0
- package/dist/components/drag-and-drop/drag-list.js.map +1 -0
- package/dist/components/drag-and-drop/drag-root.d.ts +6 -0
- package/dist/components/drag-and-drop/drag-root.js +2 -0
- package/dist/components/drag-and-drop/drag-root.js.map +1 -0
- package/dist/components/drag-and-drop/index.d.ts +10 -0
- package/dist/components/drag-and-drop/index.js +2 -0
- package/dist/components/drag-and-drop/index.js.map +1 -0
- package/dist/components/drag-and-drop/types/drag-item.d.ts +9 -0
- package/dist/components/drag-and-drop/types/drag-item.js +2 -0
- package/dist/components/drag-and-drop/types/drag-item.js.map +1 -0
- package/dist/components/dropdown-menu.js +2 -295
- package/dist/components/dropdown-menu.js.map +1 -0
- package/dist/components/form/button.js +2 -0
- package/dist/components/form/button.js.map +1 -0
- package/dist/components/form/calendar.js +2 -0
- package/dist/components/form/calendar.js.map +1 -0
- package/dist/components/form/checkbox.js +2 -0
- package/dist/components/form/checkbox.js.map +1 -0
- package/dist/components/form/context/field.context.d.ts +15 -0
- package/dist/components/form/context/field.context.js +2 -0
- package/dist/components/form/context/field.context.js.map +1 -0
- package/dist/components/form/date-picker.d.ts +84 -0
- package/dist/components/form/date-picker.js +2 -0
- package/dist/components/form/date-picker.js.map +1 -0
- package/dist/components/form/floating-label.d.ts +6 -0
- package/dist/components/form/floating-label.js +2 -0
- package/dist/components/form/floating-label.js.map +1 -0
- package/dist/components/form/input.d.ts +95 -0
- package/dist/components/form/input.js +2 -0
- package/dist/components/form/input.js.map +1 -0
- package/dist/components/form/otp-input.js +2 -0
- package/dist/components/form/otp-input.js.map +1 -0
- package/dist/components/form/radio.js +2 -0
- package/dist/components/form/radio.js.map +1 -0
- package/dist/components/{rich-editor.d.ts → form/rich-editor.d.ts} +2 -1
- package/dist/components/form/rich-editor.js +2 -0
- package/dist/components/form/rich-editor.js.map +1 -0
- package/dist/components/form/search-input.js +2 -0
- package/dist/components/form/search-input.js.map +1 -0
- package/dist/components/form/select.d.ts +94 -0
- package/dist/components/form/select.js +2 -0
- package/dist/components/form/select.js.map +1 -0
- package/dist/components/form/switch.js +2 -0
- package/dist/components/form/switch.js.map +1 -0
- package/dist/components/full-calendar/calendar-add-event.d.ts +9 -0
- package/dist/components/full-calendar/calendar-add-event.js +2 -0
- package/dist/components/full-calendar/calendar-add-event.js.map +1 -0
- package/dist/components/full-calendar/calendar-body.d.ts +6 -0
- package/dist/components/full-calendar/calendar-body.js +2 -0
- package/dist/components/full-calendar/calendar-body.js.map +1 -0
- package/dist/components/full-calendar/calendar-cell.d.ts +11 -0
- package/dist/components/full-calendar/calendar-cell.js +2 -0
- package/dist/components/full-calendar/calendar-cell.js.map +1 -0
- package/dist/components/full-calendar/calendar-day-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-day-view.js +2 -0
- package/dist/components/full-calendar/calendar-day-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-event.d.ts +18 -0
- package/dist/components/full-calendar/calendar-event.js +2 -0
- package/dist/components/full-calendar/calendar-event.js.map +1 -0
- package/dist/components/full-calendar/calendar-header.d.ts +6 -0
- package/dist/components/full-calendar/calendar-header.js +2 -0
- package/dist/components/full-calendar/calendar-header.js.map +1 -0
- package/dist/components/full-calendar/calendar-month-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-month-view.js +2 -0
- package/dist/components/full-calendar/calendar-month-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.d.ts +9 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.js +2 -0
- package/dist/components/full-calendar/calendar-more-events-dropdown.js.map +1 -0
- package/dist/components/full-calendar/calendar-navigator.d.ts +5 -0
- package/dist/components/full-calendar/calendar-navigator.js +2 -0
- package/dist/components/full-calendar/calendar-navigator.js.map +1 -0
- package/dist/components/full-calendar/calendar-root.d.ts +30 -0
- package/dist/components/full-calendar/calendar-root.js +2 -0
- package/dist/components/full-calendar/calendar-root.js.map +1 -0
- package/dist/components/full-calendar/calendar-today-button.d.ts +9 -0
- package/dist/components/full-calendar/calendar-today-button.js +2 -0
- package/dist/components/full-calendar/calendar-today-button.js.map +1 -0
- package/dist/components/full-calendar/calendar-toggle-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-toggle-view.js +2 -0
- package/dist/components/full-calendar/calendar-toggle-view.js.map +1 -0
- package/dist/components/full-calendar/calendar-view-renderer.d.ts +5 -0
- package/dist/components/full-calendar/calendar-view-renderer.js +2 -0
- package/dist/components/full-calendar/calendar-view-renderer.js.map +1 -0
- package/dist/components/full-calendar/calendar-week-day.d.ts +10 -0
- package/dist/components/full-calendar/calendar-week-day.js +2 -0
- package/dist/components/full-calendar/calendar-week-day.js.map +1 -0
- package/dist/components/full-calendar/calendar-week-view.d.ts +5 -0
- package/dist/components/full-calendar/calendar-week-view.js +2 -0
- package/dist/components/full-calendar/calendar-week-view.js.map +1 -0
- package/dist/components/full-calendar/helpers/calendar.d.ts +25 -0
- package/dist/components/full-calendar/helpers/calendar.js +2 -0
- package/dist/components/full-calendar/helpers/calendar.js.map +1 -0
- package/dist/components/full-calendar/index.d.ts +18 -0
- package/dist/components/full-calendar/index.js +2 -0
- package/dist/components/full-calendar/index.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-cell.d.ts +6 -0
- package/dist/components/full-calendar/types/calendar-cell.js +2 -0
- package/dist/components/full-calendar/types/calendar-cell.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-event.d.ts +8 -0
- package/dist/components/full-calendar/types/calendar-event.js +2 -0
- package/dist/components/full-calendar/types/calendar-event.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-view.d.ts +3 -0
- package/dist/components/full-calendar/types/calendar-view.js +2 -0
- package/dist/components/full-calendar/types/calendar-view.js.map +1 -0
- package/dist/components/full-calendar/types/calendar-week-hour.d.ts +6 -0
- package/dist/components/full-calendar/types/calendar-week-hour.js +2 -0
- package/dist/components/full-calendar/types/calendar-week-hour.js.map +1 -0
- package/dist/components/horizontal-scroll.d.ts +11 -0
- package/dist/components/horizontal-scroll.js +2 -0
- package/dist/components/horizontal-scroll.js.map +1 -0
- package/dist/components/icon.d.ts +3 -4
- package/dist/components/icon.js +2 -177
- package/dist/components/icon.js.map +1 -0
- package/dist/components/list.js +2 -179
- package/dist/components/list.js.map +1 -0
- package/dist/components/logo.js +2 -324
- package/dist/components/logo.js.map +1 -0
- package/dist/components/selection-bar.d.ts +57 -0
- package/dist/components/selection-bar.js +2 -0
- package/dist/components/selection-bar.js.map +1 -0
- package/dist/components/sheet.d.ts +8 -8
- package/dist/components/sheet.js +2 -251
- package/dist/components/sheet.js.map +1 -0
- package/dist/components/skeleton.js +2 -16
- package/dist/components/skeleton.js.map +1 -0
- package/dist/components/status.js +2 -111
- package/dist/components/status.js.map +1 -0
- package/dist/components/table.js +2 -196
- package/dist/components/table.js.map +1 -0
- package/dist/components/tabs.d.ts +9 -6
- package/dist/components/tabs.js +2 -54
- package/dist/components/tabs.js.map +1 -0
- package/dist/components/tag.d.ts +5 -2
- package/dist/components/tag.js +2 -189
- package/dist/components/tag.js.map +1 -0
- package/dist/components/tooltip.js +2 -58
- package/dist/components/tooltip.js.map +1 -0
- package/dist/components/typography.js +2 -78
- package/dist/components/typography.js.map +1 -0
- package/dist/components/upload.d.ts +74 -0
- package/dist/components/upload.js +2 -0
- package/dist/components/upload.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/icons-CmDuL0gZ.d.ts +4 -0
- package/dist/index.css +2 -2322
- package/dist/index.css.map +1 -0
- package/dist/logo-PQRZORCS.js +3 -0
- package/dist/logo-PQRZORCS.js.map +1 -0
- package/package.json +60 -18
- package/src/components/breadcrumb.tsx +119 -0
- package/src/components/chip.tsx +11 -3
- package/src/components/dialog.tsx +242 -0
- package/src/components/drag-and-drop/drag-handle.tsx +46 -0
- package/src/components/drag-and-drop/drag-list-item.tsx +91 -0
- package/src/components/drag-and-drop/drag-list.tsx +47 -0
- package/src/components/drag-and-drop/drag-root.tsx +30 -0
- package/src/components/drag-and-drop/index.ts +39 -0
- package/src/components/drag-and-drop/types/drag-item.ts +7 -0
- package/src/components/{calendar.tsx → form/calendar.tsx} +9 -8
- package/src/components/{checkbox.tsx → form/checkbox.tsx} +2 -2
- package/src/components/form/context/field.context.ts +27 -0
- package/src/components/form/date-picker.tsx +199 -0
- package/src/components/form/floating-label.tsx +60 -0
- package/src/components/form/input.tsx +235 -0
- package/src/components/{radio.tsx → form/radio.tsx} +1 -1
- package/src/components/{rich-editor.tsx → form/rich-editor.tsx} +10 -9
- package/src/components/{search-input.tsx → form/search-input.tsx} +2 -2
- package/src/components/form/select.tsx +274 -0
- package/src/components/full-calendar/calendar-add-event.tsx +15 -0
- package/src/components/full-calendar/calendar-body.tsx +12 -0
- package/src/components/full-calendar/calendar-cell.tsx +120 -0
- package/src/components/full-calendar/calendar-day-view.tsx +76 -0
- package/src/components/full-calendar/calendar-event.tsx +178 -0
- package/src/components/full-calendar/calendar-header.tsx +14 -0
- package/src/components/full-calendar/calendar-month-view.tsx +69 -0
- package/src/components/full-calendar/calendar-more-events-dropdown.tsx +39 -0
- package/src/components/full-calendar/calendar-navigator.tsx +86 -0
- package/src/components/full-calendar/calendar-root.tsx +165 -0
- package/src/components/full-calendar/calendar-today-button.tsx +21 -0
- package/src/components/full-calendar/calendar-toggle-view.tsx +61 -0
- package/src/components/full-calendar/calendar-view-renderer.tsx +19 -0
- package/src/components/full-calendar/calendar-week-day.tsx +49 -0
- package/src/components/full-calendar/calendar-week-view.tsx +88 -0
- package/src/components/full-calendar/helpers/calendar.ts +158 -0
- package/src/components/full-calendar/index.ts +16 -0
- package/src/components/full-calendar/types/calendar-cell.ts +4 -0
- package/src/components/full-calendar/types/calendar-event.ts +7 -0
- package/src/components/full-calendar/types/calendar-view.ts +1 -0
- package/src/components/full-calendar/types/calendar-week-hour.ts +4 -0
- package/src/components/horizontal-scroll.tsx +159 -0
- package/src/components/icon.tsx +1 -1
- package/src/components/logo.tsx +25 -20
- package/src/components/selection-bar.tsx +273 -0
- package/src/components/sheet.tsx +2 -2
- package/src/components/tabs.tsx +56 -37
- package/src/components/tag.tsx +11 -3
- package/src/components/upload.tsx +647 -0
- package/src/index.css +2 -2
- package/src/resources/icons.ts +4 -1
- package/src/resources/logo/index.tsx +33 -0
- package/tsup.config.ts +23 -5
- package/dist/components/button.js +0 -98
- package/dist/components/calendar.js +0 -751
- package/dist/components/checkbox.js +0 -153
- package/dist/components/date-picker.d.ts +0 -20
- package/dist/components/date-picker.js +0 -232
- package/dist/components/input.d.ts +0 -32
- package/dist/components/input.js +0 -315
- package/dist/components/otp-input.js +0 -47
- package/dist/components/radio.js +0 -156
- package/dist/components/rich-editor.js +0 -723
- package/dist/components/search-input.js +0 -274
- package/dist/components/select.d.ts +0 -33
- package/dist/components/select.js +0 -550
- package/dist/components/switch.js +0 -36
- package/dist/components/test.d.ts +0 -5
- package/dist/components/test.js +0 -8
- package/dist/index.js +0 -0
- package/src/components/date-picker.tsx +0 -160
- package/src/components/input.tsx +0 -256
- package/src/components/select.tsx +0 -240
- package/src/components/test.tsx +0 -3
- package/src/index.ts +0 -1
- package/src/resources/logo/index.ts +0 -3
- /package/dist/components/{button.d.ts → form/button.d.ts} +0 -0
- /package/dist/components/{calendar.d.ts → form/calendar.d.ts} +0 -0
- /package/dist/components/{checkbox.d.ts → form/checkbox.d.ts} +0 -0
- /package/dist/components/{otp-input.d.ts → form/otp-input.d.ts} +0 -0
- /package/dist/components/{radio.d.ts → form/radio.d.ts} +0 -0
- /package/dist/components/{search-input.d.ts → form/search-input.d.ts} +0 -0
- /package/dist/components/{switch.d.ts → form/switch.d.ts} +0 -0
- /package/src/components/{button.tsx → form/button.tsx} +0 -0
- /package/src/components/{otp-input.tsx → form/otp-input.tsx} +0 -0
- /package/src/components/{switch.tsx → form/switch.tsx} +0 -0
package/dist/components/input.js
DELETED
|
@@ -1,315 +0,0 @@
|
|
|
1
|
-
// src/components/input.tsx
|
|
2
|
-
import { cva, cx } from "@xjur-ui/util";
|
|
3
|
-
import { createContext } from "react";
|
|
4
|
-
import { InputMask } from "@react-input/mask";
|
|
5
|
-
import {
|
|
6
|
-
InputNumberFormat
|
|
7
|
-
} from "@react-input/number-format";
|
|
8
|
-
|
|
9
|
-
// src/resources/input-mask.ts
|
|
10
|
-
function inputMask(type, options) {
|
|
11
|
-
switch (type) {
|
|
12
|
-
case "cpf":
|
|
13
|
-
return { ...options, ...CPF_MASK };
|
|
14
|
-
case "cnpj":
|
|
15
|
-
return { ...options, ...CNPJ_MASK };
|
|
16
|
-
case "telefone":
|
|
17
|
-
return { ...options, ...PHONE_MASK };
|
|
18
|
-
case "cep":
|
|
19
|
-
return { ...options, ...CEP_MASK };
|
|
20
|
-
case "numero-processo":
|
|
21
|
-
return { ...options, ...NUMERO_PROCESSO_MASK };
|
|
22
|
-
case "data":
|
|
23
|
-
return { ...options, ...DATE_MASK };
|
|
24
|
-
case "hora":
|
|
25
|
-
return { ...options, ...TIME_MASK };
|
|
26
|
-
case "data-hora":
|
|
27
|
-
return { ...options, ...DATETIME_MASK };
|
|
28
|
-
case "custom":
|
|
29
|
-
if (!options) {
|
|
30
|
-
throw new Error("Options are required for custom mask");
|
|
31
|
-
}
|
|
32
|
-
return options;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
var CPF_MASK = {
|
|
36
|
-
mask: "###.###.###-##",
|
|
37
|
-
replacement: {
|
|
38
|
-
"#": /\d/
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
var CNPJ_MASK = {
|
|
42
|
-
mask: "##.###.###/####-##",
|
|
43
|
-
replacement: {
|
|
44
|
-
"#": /\d/
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
var PHONE_MASK = {
|
|
48
|
-
mask: "(##) #####-####",
|
|
49
|
-
replacement: {
|
|
50
|
-
"#": /\d/
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var CEP_MASK = {
|
|
54
|
-
mask: "#####-###",
|
|
55
|
-
replacement: {
|
|
56
|
-
"#": /\d/
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
var NUMERO_PROCESSO_MASK = {
|
|
60
|
-
mask: "#######-##.####.#.##.####",
|
|
61
|
-
replacement: {
|
|
62
|
-
"#": /\d/
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
var DATE_MASK = {
|
|
66
|
-
mask: "##/##/####",
|
|
67
|
-
replacement: {
|
|
68
|
-
"#": /\d/
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
var TIME_MASK = {
|
|
72
|
-
mask: "##:##",
|
|
73
|
-
replacement: {
|
|
74
|
-
"#": /\d/
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
var DATETIME_MASK = {
|
|
78
|
-
mask: "##/##/#### ##:##",
|
|
79
|
-
replacement: {
|
|
80
|
-
"#": /\d/
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
// src/components/input.tsx
|
|
85
|
-
import { jsx } from "react/jsx-runtime";
|
|
86
|
-
var FieldContext = createContext({
|
|
87
|
-
variant: "filled"
|
|
88
|
-
});
|
|
89
|
-
function InputRoot({
|
|
90
|
-
className,
|
|
91
|
-
children,
|
|
92
|
-
variant = "filled",
|
|
93
|
-
...props
|
|
94
|
-
}) {
|
|
95
|
-
return /* @__PURE__ */ jsx(FieldContext.Provider, { value: { variant }, children: /* @__PURE__ */ jsx(
|
|
96
|
-
"div",
|
|
97
|
-
{
|
|
98
|
-
className: cx(
|
|
99
|
-
"group gap-small relative flex w-full flex-col",
|
|
100
|
-
className
|
|
101
|
-
),
|
|
102
|
-
...props,
|
|
103
|
-
children
|
|
104
|
-
}
|
|
105
|
-
) });
|
|
106
|
-
}
|
|
107
|
-
function InputContent({ className, ...props }) {
|
|
108
|
-
const variants = cva(
|
|
109
|
-
[
|
|
110
|
-
"relative h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small flex items-center w-full",
|
|
111
|
-
"focus-within:border-primary-idle focus-within:border",
|
|
112
|
-
"group-has-[div[data-slot=input-right-action-slot]]:rounded-r-none",
|
|
113
|
-
"group-has-[div[data-slot=input-left-action-slot]]:rounded-l-none"
|
|
114
|
-
],
|
|
115
|
-
{
|
|
116
|
-
variants: {
|
|
117
|
-
variant: {
|
|
118
|
-
default: "",
|
|
119
|
-
outlined: "bg-layer-2-idle border-border-layer-2 border hover:group-has-[input:not(:focus-within)]:border-border-layer-3 has-[input:not(:placeholder-shown)]:border-primary-idle",
|
|
120
|
-
filled: "bg-layer-2-hover group-hover:border-border-layer-1 group-hover:border-1"
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
);
|
|
125
|
-
return /* @__PURE__ */ jsx(FieldContext.Consumer, { children: ({ variant }) => {
|
|
126
|
-
return /* @__PURE__ */ jsx("div", { className: cx(className, variants({ variant })), ...props });
|
|
127
|
-
} });
|
|
128
|
-
}
|
|
129
|
-
function InputLabel({
|
|
130
|
-
htmlFor,
|
|
131
|
-
className,
|
|
132
|
-
children,
|
|
133
|
-
...props
|
|
134
|
-
}) {
|
|
135
|
-
return /* @__PURE__ */ jsx(FieldContext.Consumer, { children: ({ variant }) => {
|
|
136
|
-
return /* @__PURE__ */ jsx(
|
|
137
|
-
"label",
|
|
138
|
-
{
|
|
139
|
-
className: cx(
|
|
140
|
-
"group text-size-body-md text-neutral-dark inline-block max-w-full truncate text-left",
|
|
141
|
-
"ease animate-in left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2 transition-all duration-250",
|
|
142
|
-
// Filled
|
|
143
|
-
"group-focus-within:text-primary-idle group-focus-within:-top-[3px]",
|
|
144
|
-
"group-focus-within:text-size-label-sm-1x group-focus-within:font-medium",
|
|
145
|
-
"group-has-[input:not(:placeholder-shown)]:-top-[3px]",
|
|
146
|
-
"group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x",
|
|
147
|
-
"group-has-[input:not(:placeholder-shown)]:font-medium",
|
|
148
|
-
"data-[variant=outlined]:group-has-[input:not(:placeholder-shown)]:text-primary-idle",
|
|
149
|
-
// If has left slot
|
|
150
|
-
"group-has-[div[data-slot=input-left-slot]]:left-large-4x",
|
|
151
|
-
"group-has-[div[data-slot=input-left-slot]]:group-focus-within:left-small",
|
|
152
|
-
"group-has-[div[data-slot=input-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small",
|
|
153
|
-
// If has right slot
|
|
154
|
-
"group-has-[div[data-slot=input-right-slot]]:right-large-4x",
|
|
155
|
-
"group-has-[div[data-slot=input-right-slot]]:group-focus-within:right-small",
|
|
156
|
-
"group-has-[div[data-slot=input-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small",
|
|
157
|
-
// Animate
|
|
158
|
-
"group-focus-within:animate-in",
|
|
159
|
-
"group-has-[input:not(:placeholder-shown)]:animate-out",
|
|
160
|
-
className
|
|
161
|
-
),
|
|
162
|
-
"data-variant": variant,
|
|
163
|
-
htmlFor,
|
|
164
|
-
...props,
|
|
165
|
-
children: /* @__PURE__ */ jsx(
|
|
166
|
-
"span",
|
|
167
|
-
{
|
|
168
|
-
className: cx(
|
|
169
|
-
"rounded-small-1x max-w-full",
|
|
170
|
-
"group-data-[variant=outlined]:group-focus-within:bg-layer-2-idle group-data-[variant=filled]:group-focus-within:bg-layer-2-hover",
|
|
171
|
-
"group-data-[variant=outlined]:bg-layer-2-idle group-data-[variant=filled]:bg-layer-2-hover"
|
|
172
|
-
),
|
|
173
|
-
children
|
|
174
|
-
}
|
|
175
|
-
)
|
|
176
|
-
}
|
|
177
|
-
);
|
|
178
|
-
} });
|
|
179
|
-
}
|
|
180
|
-
function InputText({
|
|
181
|
-
className,
|
|
182
|
-
maskOptions,
|
|
183
|
-
maskType,
|
|
184
|
-
...props
|
|
185
|
-
}) {
|
|
186
|
-
const Component = maskOptions || maskType ? InputMask : "input";
|
|
187
|
-
return /* @__PURE__ */ jsx(
|
|
188
|
-
Component,
|
|
189
|
-
{
|
|
190
|
-
...props,
|
|
191
|
-
...maskType ? { ...inputMask(maskType) } : maskOptions && { ...maskOptions },
|
|
192
|
-
className: cx(
|
|
193
|
-
className,
|
|
194
|
-
"peer text-size-body-md text-neutral-dark flex-1 font-medium outline-none",
|
|
195
|
-
"group-has-[div[data-slot=input-left-slot]]:pl-large-1x ml-small-1x"
|
|
196
|
-
),
|
|
197
|
-
placeholder: props.placeholder || " ",
|
|
198
|
-
...maskOptions && { ...maskOptions }
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
function InputNumber({
|
|
203
|
-
className,
|
|
204
|
-
locales = "pt-BR",
|
|
205
|
-
...props
|
|
206
|
-
}) {
|
|
207
|
-
return /* @__PURE__ */ jsx(
|
|
208
|
-
InputNumberFormat,
|
|
209
|
-
{
|
|
210
|
-
...props,
|
|
211
|
-
className: cx(
|
|
212
|
-
className,
|
|
213
|
-
"peer text-size-body-md text-neutral-dark flex-1 font-medium outline-none",
|
|
214
|
-
"group-has-[div[data-slot=input-left-slot]]:pl-large-1x ml-small-1x"
|
|
215
|
-
),
|
|
216
|
-
locales,
|
|
217
|
-
placeholder: props.placeholder || " "
|
|
218
|
-
}
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
function InputLeftSlot({ className, ...props }) {
|
|
222
|
-
return /* @__PURE__ */ jsx(
|
|
223
|
-
"div",
|
|
224
|
-
{
|
|
225
|
-
...props,
|
|
226
|
-
className: cx(
|
|
227
|
-
className,
|
|
228
|
-
"left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center"
|
|
229
|
-
),
|
|
230
|
-
"data-slot": "input-left-slot"
|
|
231
|
-
}
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
function InputRightSlot({ className, ...props }) {
|
|
235
|
-
return /* @__PURE__ */ jsx(
|
|
236
|
-
"div",
|
|
237
|
-
{
|
|
238
|
-
...props,
|
|
239
|
-
className: cx(
|
|
240
|
-
className,
|
|
241
|
-
"right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center"
|
|
242
|
-
),
|
|
243
|
-
"data-slot": "input-right-slot"
|
|
244
|
-
}
|
|
245
|
-
);
|
|
246
|
-
}
|
|
247
|
-
function InputMessage({ className, ...props }) {
|
|
248
|
-
return /* @__PURE__ */ jsx(
|
|
249
|
-
"p",
|
|
250
|
-
{
|
|
251
|
-
...props,
|
|
252
|
-
className: cx(
|
|
253
|
-
"text-size-body-sm text-neutral-dark font-normal",
|
|
254
|
-
className
|
|
255
|
-
)
|
|
256
|
-
}
|
|
257
|
-
);
|
|
258
|
-
}
|
|
259
|
-
function InputContainer({ className, ...props }) {
|
|
260
|
-
return /* @__PURE__ */ jsx(
|
|
261
|
-
"div",
|
|
262
|
-
{
|
|
263
|
-
...props,
|
|
264
|
-
className: cx(className, "flex items-center"),
|
|
265
|
-
"data-slot": "input-content"
|
|
266
|
-
}
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
function InputAction({
|
|
270
|
-
className,
|
|
271
|
-
side,
|
|
272
|
-
...props
|
|
273
|
-
}) {
|
|
274
|
-
return /* @__PURE__ */ jsx(
|
|
275
|
-
"div",
|
|
276
|
-
{
|
|
277
|
-
...props,
|
|
278
|
-
className: cx(
|
|
279
|
-
className,
|
|
280
|
-
"group h-large-4x flex items-center justify-center"
|
|
281
|
-
),
|
|
282
|
-
"data-side": side,
|
|
283
|
-
"data-slot": `input-${side}-action-slot`
|
|
284
|
-
}
|
|
285
|
-
);
|
|
286
|
-
}
|
|
287
|
-
function InputActionButton({
|
|
288
|
-
className,
|
|
289
|
-
...props
|
|
290
|
-
}) {
|
|
291
|
-
return /* @__PURE__ */ jsx(
|
|
292
|
-
"div",
|
|
293
|
-
{
|
|
294
|
-
...props,
|
|
295
|
-
className: cx(
|
|
296
|
-
className,
|
|
297
|
-
"h-large-4x w-large-4x bg-layer-2-hover flex cursor-pointer items-center justify-center"
|
|
298
|
-
)
|
|
299
|
-
}
|
|
300
|
-
);
|
|
301
|
-
}
|
|
302
|
-
export {
|
|
303
|
-
InputAction,
|
|
304
|
-
InputActionButton,
|
|
305
|
-
InputContainer,
|
|
306
|
-
InputContent,
|
|
307
|
-
InputLabel,
|
|
308
|
-
InputLeftSlot,
|
|
309
|
-
InputMessage,
|
|
310
|
-
InputNumber,
|
|
311
|
-
InputRightSlot,
|
|
312
|
-
InputRoot,
|
|
313
|
-
InputText,
|
|
314
|
-
inputMask
|
|
315
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
// src/components/otp-input.tsx
|
|
2
|
-
import * as OTPPasswordField from "@radix-ui/react-one-time-password-field";
|
|
3
|
-
import { cx } from "@xjur-ui/util";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
function Root2({
|
|
6
|
-
children,
|
|
7
|
-
className,
|
|
8
|
-
...props
|
|
9
|
-
}) {
|
|
10
|
-
return /* @__PURE__ */ jsx(
|
|
11
|
-
OTPPasswordField.Root,
|
|
12
|
-
{
|
|
13
|
-
className: cx(className, "group gap-small flex items-center"),
|
|
14
|
-
...props,
|
|
15
|
-
children
|
|
16
|
-
}
|
|
17
|
-
);
|
|
18
|
-
}
|
|
19
|
-
function Input2({
|
|
20
|
-
className,
|
|
21
|
-
...props
|
|
22
|
-
}) {
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
24
|
-
OTPPasswordField.Input,
|
|
25
|
-
{
|
|
26
|
-
className: cx(
|
|
27
|
-
className,
|
|
28
|
-
"text-neutral-dark h-large-6x bg-layer-2-hover rounded-small-1x w-full text-center outline-0",
|
|
29
|
-
"focus-within:border-primary-idle focus-within:border"
|
|
30
|
-
),
|
|
31
|
-
...props
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
function HiddenInput2({
|
|
36
|
-
...props
|
|
37
|
-
}) {
|
|
38
|
-
return /* @__PURE__ */ jsx(OTPPasswordField.HiddenInput, { ...props });
|
|
39
|
-
}
|
|
40
|
-
var OTPInput = {
|
|
41
|
-
Root: Root2,
|
|
42
|
-
Input: Input2,
|
|
43
|
-
HiddenInput: HiddenInput2
|
|
44
|
-
};
|
|
45
|
-
export {
|
|
46
|
-
OTPInput
|
|
47
|
-
};
|
package/dist/components/radio.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
// src/components/radio.tsx
|
|
2
|
-
import "react";
|
|
3
|
-
import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
|
|
4
|
-
import { cx } from "@xjur-ui/util";
|
|
5
|
-
|
|
6
|
-
// src/components/typography.tsx
|
|
7
|
-
import { Slot } from "@radix-ui/react-slot";
|
|
8
|
-
import { cva } from "@xjur-ui/util";
|
|
9
|
-
import { memo } from "react";
|
|
10
|
-
import { jsx } from "react/jsx-runtime";
|
|
11
|
-
var typographyVariants = cva("", {
|
|
12
|
-
variants: {
|
|
13
|
-
variant: {
|
|
14
|
-
body: "",
|
|
15
|
-
label: "",
|
|
16
|
-
title: "",
|
|
17
|
-
headline: ""
|
|
18
|
-
},
|
|
19
|
-
size: {
|
|
20
|
-
"sm-2x": "",
|
|
21
|
-
"sm-1x": "",
|
|
22
|
-
sm: "",
|
|
23
|
-
md: "",
|
|
24
|
-
lg: ""
|
|
25
|
-
},
|
|
26
|
-
weight: {
|
|
27
|
-
thin: "font-thin",
|
|
28
|
-
extraLight: "font-extralight",
|
|
29
|
-
light: "font-light",
|
|
30
|
-
normal: "font-normal",
|
|
31
|
-
medium: "font-medium",
|
|
32
|
-
semibold: "font-semibold",
|
|
33
|
-
bold: "font-bold",
|
|
34
|
-
extraBold: "font-extrabold",
|
|
35
|
-
black: "font-black"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
compoundVariants: [
|
|
39
|
-
{ variant: "body", size: "sm-1x", class: "text-size-body-sm-1x" },
|
|
40
|
-
{ variant: "body", size: "sm", class: "text-size-body-sm" },
|
|
41
|
-
{ variant: "body", size: "md", class: "text-size-body-md" },
|
|
42
|
-
{ variant: "body", size: "lg", class: "text-size-body-lg" },
|
|
43
|
-
{ variant: "label", size: "sm-2x", class: "text-size-label-sm-2x" },
|
|
44
|
-
{ variant: "label", size: "sm-1x", class: "text-size-label-sm-1x" },
|
|
45
|
-
{ variant: "label", size: "sm", class: "text-size-label-sm" },
|
|
46
|
-
{ variant: "label", size: "md", class: "text-size-label-md" },
|
|
47
|
-
{ variant: "label", size: "lg", class: "text-size-label-lg" },
|
|
48
|
-
{ variant: "title", size: "sm", class: "text-size-title-sm" },
|
|
49
|
-
{ variant: "title", size: "md", class: "text-size-title-md" },
|
|
50
|
-
{ variant: "title", size: "lg", class: "text-size-title-lg" },
|
|
51
|
-
{ variant: "headline", size: "sm", class: "text-size-headline-sm" },
|
|
52
|
-
{ variant: "headline", size: "md", class: "text-size-headline-md" },
|
|
53
|
-
{ variant: "headline", size: "lg", class: "text-size-headline-lg" }
|
|
54
|
-
],
|
|
55
|
-
defaultVariants: {
|
|
56
|
-
variant: "body",
|
|
57
|
-
size: "md",
|
|
58
|
-
weight: "normal"
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
var Typography = memo(
|
|
62
|
-
({
|
|
63
|
-
variant,
|
|
64
|
-
size,
|
|
65
|
-
weight,
|
|
66
|
-
asChild,
|
|
67
|
-
className,
|
|
68
|
-
...props
|
|
69
|
-
}) => {
|
|
70
|
-
const Component = asChild ? Slot : "span";
|
|
71
|
-
return /* @__PURE__ */ jsx(
|
|
72
|
-
Component,
|
|
73
|
-
{
|
|
74
|
-
className: typographyVariants({ variant, size, weight, className }),
|
|
75
|
-
...props
|
|
76
|
-
}
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
|
-
);
|
|
80
|
-
Typography.displayName = "Typography";
|
|
81
|
-
|
|
82
|
-
// src/components/radio.tsx
|
|
83
|
-
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
84
|
-
function RadioGroup({
|
|
85
|
-
className,
|
|
86
|
-
orientation = "vertical",
|
|
87
|
-
...props
|
|
88
|
-
}) {
|
|
89
|
-
return /* @__PURE__ */ jsx2(
|
|
90
|
-
RadioGroupPrimitive.Root,
|
|
91
|
-
{
|
|
92
|
-
className: cx(
|
|
93
|
-
"gap-small flex data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col",
|
|
94
|
-
className
|
|
95
|
-
),
|
|
96
|
-
"data-orientation": orientation,
|
|
97
|
-
"data-slot": "radio-group",
|
|
98
|
-
...props
|
|
99
|
-
}
|
|
100
|
-
);
|
|
101
|
-
}
|
|
102
|
-
function RadioItem({
|
|
103
|
-
className,
|
|
104
|
-
id,
|
|
105
|
-
label,
|
|
106
|
-
disabled = false,
|
|
107
|
-
...props
|
|
108
|
-
}) {
|
|
109
|
-
return /* @__PURE__ */ jsxs("div", { className: "gap-small flex items-center", children: [
|
|
110
|
-
/* @__PURE__ */ jsx2(
|
|
111
|
-
RadioGroupPrimitive.Item,
|
|
112
|
-
{
|
|
113
|
-
className: cx(
|
|
114
|
-
// layout
|
|
115
|
-
"size-large-alt rounded-circle inline-flex items-center justify-center transition-[border-color,box-shadow,background-color] duration-200 outline-none",
|
|
116
|
-
// base
|
|
117
|
-
"border-border-layer-2 bg-layer-2-idle cursor-pointer border-2",
|
|
118
|
-
// hover/focus (desmarcado)
|
|
119
|
-
"hover:border-primary-idle focus:border-primary-idle focus:shadow-focus-primary",
|
|
120
|
-
// estado checked
|
|
121
|
-
"data-[state=checked]:bg-primary-active data-[state=checked]:border-primary-active",
|
|
122
|
-
// hover quando estiver checked (opcional)
|
|
123
|
-
"data-[state=checked]:hover:border-primary-idle",
|
|
124
|
-
// disabled
|
|
125
|
-
"disabled:hover:border-border-layer-2 disabled:cursor-not-allowed disabled:opacity-[38%]",
|
|
126
|
-
className
|
|
127
|
-
),
|
|
128
|
-
"data-slot": "radio-group-item",
|
|
129
|
-
disabled,
|
|
130
|
-
id,
|
|
131
|
-
...props,
|
|
132
|
-
children: /* @__PURE__ */ jsx2(
|
|
133
|
-
RadioGroupPrimitive.Indicator,
|
|
134
|
-
{
|
|
135
|
-
className: "relative flex items-center justify-center",
|
|
136
|
-
"data-slot": "radio-group-indicator"
|
|
137
|
-
}
|
|
138
|
-
)
|
|
139
|
-
}
|
|
140
|
-
),
|
|
141
|
-
!!label && /* @__PURE__ */ jsx2(
|
|
142
|
-
Typography,
|
|
143
|
-
{
|
|
144
|
-
asChild: true,
|
|
145
|
-
className: "text-size-body-sm data-[disabled=true]:opacity-38",
|
|
146
|
-
"data-disabled": disabled,
|
|
147
|
-
weight: "medium",
|
|
148
|
-
children: /* @__PURE__ */ jsx2("label", { htmlFor: id, children: label })
|
|
149
|
-
}
|
|
150
|
-
)
|
|
151
|
-
] });
|
|
152
|
-
}
|
|
153
|
-
export {
|
|
154
|
-
RadioGroup,
|
|
155
|
-
RadioItem
|
|
156
|
-
};
|