@xjur-ui/react 2.0.0 → 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 +278 -119
- package/CHANGELOG.md +70 -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-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-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-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-OS53BV63.js +3 -0
- package/dist/chunk-OS53BV63.js.map +1 -0
- package/dist/{chunk-FASEHVMD.js → chunk-PKCW37CJ.js} +2 -2
- package/dist/chunk-PKCW37CJ.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-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/{components/switch.js → chunk-Z47R2CIM.js} +2 -2
- 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/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 +2 -1
- package/dist/components/chip.js +1 -1
- 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/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/form/button.js +2 -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.map +1 -0
- package/dist/components/form/radio.js +2 -0
- package/dist/components/form/radio.js.map +1 -0
- 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 +1 -1
- 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 +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/table.js +1 -1
- package/dist/components/tag.d.ts +2 -1
- package/dist/components/tag.js +1 -1
- 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/icons-CmDuL0gZ.d.ts +4 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/package.json +22 -13
- package/src/components/breadcrumb.tsx +119 -0
- 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} +2 -2
- 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} +6 -6
- 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/selection-bar.tsx +273 -0
- package/src/components/sheet.tsx +2 -2
- package/src/components/upload.tsx +647 -0
- package/src/resources/icons.ts +4 -1
- package/dist/chunk-FASEHVMD.js.map +0 -1
- package/dist/chunk-NPTLORW5.js +0 -2
- package/dist/chunk-NPTLORW5.js.map +0 -1
- package/dist/chunk-SHHXKVVR.js +0 -2
- package/dist/chunk-SHHXKVVR.js.map +0 -1
- package/dist/components/button.js +0 -2
- package/dist/components/calendar.js +0 -2
- package/dist/components/calendar.js.map +0 -1
- package/dist/components/checkbox.js +0 -2
- package/dist/components/checkbox.js.map +0 -1
- package/dist/components/date-picker.d.ts +0 -25
- package/dist/components/date-picker.js +0 -2
- package/dist/components/date-picker.js.map +0 -1
- package/dist/components/input.d.ts +0 -37
- package/dist/components/input.js +0 -2
- package/dist/components/input.js.map +0 -1
- package/dist/components/otp-input.js.map +0 -1
- package/dist/components/radio.js +0 -2
- package/dist/components/radio.js.map +0 -1
- package/dist/components/rich-editor.js +0 -2
- package/dist/components/rich-editor.js.map +0 -1
- package/dist/components/search-input.js +0 -2
- package/dist/components/search-input.js.map +0 -1
- package/dist/components/select.d.ts +0 -36
- package/dist/components/select.js +0 -2
- package/dist/components/select.js.map +0 -1
- package/dist/components/switch.js.map +0 -1
- package/src/components/date-picker.tsx +0 -263
- package/src/components/input.tsx +0 -320
- package/src/components/select.tsx +0 -318
- /package/dist/components/{button.d.ts → form/button.d.ts} +0 -0
- /package/dist/components/{button.js.map → form/button.js.map} +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/{otp-input.js → form/otp-input.js} +0 -0
- /package/dist/components/{radio.d.ts → form/radio.d.ts} +0 -0
- /package/dist/components/{rich-editor.d.ts → form/rich-editor.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/chunk-SHHXKVVR.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {cx}from'@xjur-ui/util';import {jsx}from'react/jsx-runtime';var a=["account_balance","ad_units","add_a_photo","add","adjust","archive","arrow_downward_alt","arrow_downward","arrow_drop_down","arrow_drop_up","arrow_split","arrow_upward_alt","arrow_upward","attach_file","attach_money","autorenew","brightness_1","calendar_today","call","chat_bubble","check_circle","check","chevron_left","chevron_right","close","collapse_all","contacts","content_copy","dangerous","dashboard","delete","download","draft","drafts","drag_handle","drag_indicator","edit_document","edit_square","edit","error","expand_all","file_export","filter_alt","filter_list","first_page","flag_2","folder_open","folder","format_bold","format_italic","format_italic","format_size","format_strikethrough","gavel","group","headphones","help","hourglass_bottom","imagesmode","import_contacts","inbox","info","inventory_2","keep","keep","keyboard_arrow_down","keyboard_arrow_up","keyboard_return","label_off","label","last_page","left_panel_close","left_panel_open","link_off","link","linked_services","list","location_on","lock","logout","mail","menu","mic","more_vert","notifications","numbers","person_add","person_off","person","play_circle","progress_activity","question_mark","radio_button_unchecked","refresh","remove","reply","right_panel_close","right_panel_open","schedule","search","sell","send","settings","share","smart_display","star","star","swap_vert","thumb_down","thumb_up","tune","unarchive","undo","upload","verified_user","videocam","view_list","view_module","view_object_track","visibility_off","visibility","warning","wifi_2_bar","wifi_off","wifi","work","workspaces","article","id_card","badge","home","save","code","favorite","analytics","reports","event","account_circle","history","security","bar_chart","category","format_underlined","format_list_bulleted","format_list_numbered","redo"];function s({className:o,filled:r=false,name:t,...e}){return jsx("span",{...e,className:cx("material-symbols-outlined","text-size-body-lg select-none",o),style:{fontVariationSettings:`'FILL' ${r?1:0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,...e.style},children:t})}export{a,s as b};//# sourceMappingURL=chunk-SHHXKVVR.js.map
|
|
2
|
-
//# sourceMappingURL=chunk-SHHXKVVR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resources/icons.ts","../src/components/icon.tsx"],"names":["icons","Icon","className","filled","name","props","jsx","cx"],"mappings":"mEAAO,IAAMA,EAAQ,CACnB,iBAAA,CACA,WACA,aAAA,CACA,KAAA,CACA,SACA,SAAA,CACA,oBAAA,CACA,iBACA,iBAAA,CACA,eAAA,CACA,cACA,kBAAA,CACA,cAAA,CACA,cACA,cAAA,CACA,WAAA,CACA,eACA,gBAAA,CACA,MAAA,CACA,cACA,cAAA,CACA,OAAA,CACA,eACA,eAAA,CACA,OAAA,CACA,eACA,UAAA,CACA,cAAA,CACA,YACA,WAAA,CACA,QAAA,CACA,WACA,OAAA,CACA,QAAA,CACA,cACA,gBAAA,CACA,eAAA,CACA,aAAA,CACA,MAAA,CACA,OAAA,CACA,YAAA,CACA,cACA,YAAA,CACA,aAAA,CACA,aACA,QAAA,CACA,aAAA,CACA,SACA,aAAA,CACA,eAAA,CACA,gBACA,aAAA,CACA,sBAAA,CACA,QACA,OAAA,CACA,YAAA,CACA,OACA,kBAAA,CACA,YAAA,CACA,kBACA,OAAA,CACA,MAAA,CACA,aAAA,CACA,MAAA,CACA,MAAA,CACA,qBAAA,CACA,oBACA,iBAAA,CACA,WAAA,CACA,QACA,WAAA,CACA,kBAAA,CACA,kBACA,UAAA,CACA,MAAA,CACA,kBACA,MAAA,CACA,aAAA,CACA,OACA,QAAA,CACA,MAAA,CACA,OACA,KAAA,CACA,WAAA,CACA,gBACA,SAAA,CACA,YAAA,CACA,YAAA,CACA,QAAA,CACA,aAAA,CACA,mBAAA,CACA,gBACA,wBAAA,CACA,SAAA,CACA,SACA,OAAA,CACA,mBAAA,CACA,mBACA,UAAA,CACA,QAAA,CACA,OACA,MAAA,CACA,UAAA,CACA,QACA,eAAA,CACA,MAAA,CACA,OACA,WAAA,CACA,YAAA,CACA,WACA,MAAA,CACA,WAAA,CACA,MAAA,CACA,QAAA,CACA,eAAA,CACA,UAAA,CACA,YACA,aAAA,CACA,mBAAA,CACA,iBACA,YAAA,CACA,SAAA,CACA,aACA,UAAA,CACA,MAAA,CACA,OACA,YAAA,CACA,SAAA,CACA,UACA,OAAA,CACA,MAAA,CACA,OACA,MAAA,CACA,UAAA,CACA,YACA,SAAA,CACA,OAAA,CACA,gBAAA,CACA,SAAA,CACA,UAAA,CACA,WAAA,CACA,WACA,mBAAA,CACA,sBAAA,CACA,uBACA,MACF,EC1IO,SAASC,CAAAA,CAAK,CAAE,UAAAC,CAAAA,CAAW,MAAA,CAAAC,EAAS,KAAA,CAAO,IAAA,CAAAC,EAAM,GAAGC,CAAM,CAAA,CAAc,CAC7E,OACEC,GAAAA,CAAC,QACE,GAAGD,CAAAA,CACJ,UAAWE,EAAAA,CACT,2BAAA,CACA,gCACAL,CACF,CAAA,CACA,MAAO,CACL,qBAAA,CAAuB,UAAUC,CAAAA,CAAS,CAAA,CAAI,CAAC,CAAA,iCAAA,CAAA,CAC/C,GAAGE,EAAM,KACX,CAAA,CAEC,QAAA,CAAAD,CAAAA,CACH,CAEJ","file":"chunk-SHHXKVVR.js","sourcesContent":["export const icons = [\n 'account_balance',\n 'ad_units',\n 'add_a_photo',\n 'add',\n 'adjust',\n 'archive',\n 'arrow_downward_alt',\n 'arrow_downward',\n 'arrow_drop_down',\n 'arrow_drop_up',\n 'arrow_split',\n 'arrow_upward_alt',\n 'arrow_upward',\n 'attach_file',\n 'attach_money',\n 'autorenew',\n 'brightness_1',\n 'calendar_today',\n 'call',\n 'chat_bubble',\n 'check_circle',\n 'check',\n 'chevron_left',\n 'chevron_right',\n 'close',\n 'collapse_all',\n 'contacts',\n 'content_copy',\n 'dangerous',\n 'dashboard',\n 'delete',\n 'download',\n 'draft',\n 'drafts',\n 'drag_handle',\n 'drag_indicator',\n 'edit_document',\n 'edit_square',\n 'edit',\n 'error',\n 'expand_all',\n 'file_export',\n 'filter_alt',\n 'filter_list',\n 'first_page',\n 'flag_2',\n 'folder_open',\n 'folder',\n 'format_bold',\n 'format_italic',\n 'format_italic',\n 'format_size',\n 'format_strikethrough',\n 'gavel',\n 'group',\n 'headphones',\n 'help',\n 'hourglass_bottom',\n 'imagesmode',\n 'import_contacts',\n 'inbox',\n 'info',\n 'inventory_2',\n 'keep',\n 'keep',\n 'keyboard_arrow_down',\n 'keyboard_arrow_up',\n 'keyboard_return',\n 'label_off',\n 'label',\n 'last_page',\n 'left_panel_close',\n 'left_panel_open',\n 'link_off',\n 'link',\n 'linked_services',\n 'list',\n 'location_on',\n 'lock',\n 'logout',\n 'mail',\n 'menu',\n 'mic',\n 'more_vert',\n 'notifications',\n 'numbers',\n 'person_add',\n 'person_off',\n 'person',\n 'play_circle',\n 'progress_activity',\n 'question_mark',\n 'radio_button_unchecked',\n 'refresh',\n 'remove',\n 'reply',\n 'right_panel_close',\n 'right_panel_open',\n 'schedule',\n 'search',\n 'sell',\n 'send',\n 'settings',\n 'share',\n 'smart_display',\n 'star',\n 'star',\n 'swap_vert',\n 'thumb_down',\n 'thumb_up',\n 'tune',\n 'unarchive',\n 'undo',\n 'upload',\n 'verified_user',\n 'videocam',\n 'view_list',\n 'view_module',\n 'view_object_track',\n 'visibility_off',\n 'visibility',\n 'warning',\n 'wifi_2_bar',\n 'wifi_off',\n 'wifi',\n 'work',\n 'workspaces',\n 'article',\n 'id_card',\n 'badge',\n 'home',\n 'save',\n 'code',\n 'favorite',\n 'analytics',\n 'reports',\n 'event',\n 'account_circle',\n 'history',\n 'security',\n 'bar_chart',\n 'category',\n 'format_underlined',\n 'format_list_bulleted',\n 'format_list_numbered',\n 'redo'\n] as const\n\nexport type IconType = (typeof icons)[number]\n","import type { ComponentProps } from 'react'\nimport { cx } from '@xjur-ui/util'\nimport type { IconType } from '../resources/icons'\n\nexport type IconProps = {\n name: IconType\n filled?: boolean\n} & ComponentProps<'span'>\n\nexport function Icon({ className, filled = false, name, ...props }: IconProps) {\n return (\n <span\n {...props}\n className={cx(\n 'material-symbols-outlined',\n 'text-size-body-lg select-none',\n className\n )}\n style={{\n fontVariationSettings: `'FILL' ${filled ? 1 : 0}, 'wght' 600, 'GRAD' 0, 'opsz' 20`,\n ...props.style\n }}\n >\n {name}\n </span>\n )\n}\n\nexport { icons, type IconType } from '../resources/icons'\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b}from'../chunk-FASEHVMD.js';import {b as b$1}from'../chunk-SHHXKVVR.js';import'react-day-picker/style.css';import {cx}from'@xjur-ui/util';import {getDefaultClassNames,DayPicker}from'react-day-picker';import {jsx,jsxs}from'react/jsx-runtime';function h(e){return (a={})=>{let t=a.width?String(a.width):e.defaultWidth;return e.formats[t]||e.formats[e.defaultWidth]}}function c(e){return (a,t)=>{let r=t?.context?String(t.context):"standalone",n;if(r==="formatting"&&e.formattingValues){let o=e.defaultFormattingWidth||e.defaultWidth,d=t?.width?String(t.width):o;n=e.formattingValues[d]||e.formattingValues[o];}else {let o=e.defaultWidth,d=t?.width?String(t.width):e.defaultWidth;n=e.values[d]||e.values[o];}let i=e.argumentCallback?e.argumentCallback(a):a;return n[i]}}function u(e){return (a,t={})=>{let r=t.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=a.match(n);if(!i)return null;let o=i[0],d=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(d)?j(d,p=>p.test(o)):C(d,p=>p.test(o)),s;s=e.valueCallback?e.valueCallback(l):l,s=t.valueCallback?t.valueCallback(s):s;let M=a.slice(o.length);return {value:s,rest:M}}}function C(e,a){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&a(e[t]))return t}function j(e,a){for(let t=0;t<e.length;t++)if(a(e[t]))return t}function v(e){return (a,t={})=>{let r=a.match(e.matchPattern);if(!r)return null;let n=r[0],i=a.match(e.parsePattern);if(!i)return null;let o=e.valueCallback?e.valueCallback(i[0]):i[0];o=t.valueCallback?t.valueCallback(o):o;let d=a.slice(n.length);return {value:o,rest:d}}}var D={lessThanXSeconds:{one:"menos de um segundo",other:"menos de {{count}} segundos"},xSeconds:{one:"1 segundo",other:"{{count}} segundos"},halfAMinute:"meio minuto",lessThanXMinutes:{one:"menos de um minuto",other:"menos de {{count}} minutos"},xMinutes:{one:"1 minuto",other:"{{count}} minutos"},aboutXHours:{one:"cerca de 1 hora",other:"cerca de {{count}} horas"},xHours:{one:"1 hora",other:"{{count}} horas"},xDays:{one:"1 dia",other:"{{count}} dias"},aboutXWeeks:{one:"cerca de 1 semana",other:"cerca de {{count}} semanas"},xWeeks:{one:"1 semana",other:"{{count}} semanas"},aboutXMonths:{one:"cerca de 1 m\xEAs",other:"cerca de {{count}} meses"},xMonths:{one:"1 m\xEAs",other:"{{count}} meses"},aboutXYears:{one:"cerca de 1 ano",other:"cerca de {{count}} anos"},xYears:{one:"1 ano",other:"{{count}} anos"},overXYears:{one:"mais de 1 ano",other:"mais de {{count}} anos"},almostXYears:{one:"quase 1 ano",other:"quase {{count}} anos"}},g=(e,a,t)=>{let r,n=D[e];return typeof n=="string"?r=n:a===1?r=n.one:r=n.other.replace("{{count}}",String(a)),t?.addSuffix?t.comparison&&t.comparison>0?"em "+r:"h\xE1 "+r:r};var z={full:"EEEE, d 'de' MMMM 'de' y",long:"d 'de' MMMM 'de' y",medium:"d MMM y",short:"dd/MM/yyyy"},q={full:"HH:mm:ss zzzz",long:"HH:mm:ss z",medium:"HH:mm:ss",short:"HH:mm"},F={full:"{{date}} '\xE0s' {{time}}",long:"{{date}} '\xE0s' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},P={date:h({formats:z,defaultWidth:"full"}),time:h({formats:q,defaultWidth:"full"}),dateTime:h({formats:F,defaultWidth:"full"})};var N={lastWeek:e=>{let a=e.getDay();return "'"+(a===0||a===6?"\xFAltimo":"\xFAltima")+"' eeee '\xE0s' p"},yesterday:"'ontem \xE0s' p",today:"'hoje \xE0s' p",tomorrow:"'amanh\xE3 \xE0s' p",nextWeek:"eeee '\xE0s' p",other:"P"},w=(e,a,t,r)=>{let n=N[e];return typeof n=="function"?n(a):n};var S={narrow:["AC","DC"],abbreviated:["AC","DC"],wide:["antes de cristo","depois de cristo"]},L={narrow:["1","2","3","4"],abbreviated:["T1","T2","T3","T4"],wide:["1\xBA trimestre","2\xBA trimestre","3\xBA trimestre","4\xBA trimestre"]},R={narrow:["j","f","m","a","m","j","j","a","s","o","n","d"],abbreviated:["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez"],wide:["janeiro","fevereiro","mar\xE7o","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"]},H={narrow:["D","S","T","Q","Q","S","S"],short:["dom","seg","ter","qua","qui","sex","sab"],abbreviated:["domingo","segunda","ter\xE7a","quarta","quinta","sexta","s\xE1bado"],wide:["domingo","segunda-feira","ter\xE7a-feira","quarta-feira","quinta-feira","sexta-feira","s\xE1bado"]},T={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"manh\xE3",afternoon:"tarde",evening:"tarde",night:"noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"manh\xE3",afternoon:"tarde",evening:"tarde",night:"noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"manh\xE3",afternoon:"tarde",evening:"tarde",night:"noite"}},V={narrow:{am:"a",pm:"p",midnight:"mn",noon:"md",morning:"da manh\xE3",afternoon:"da tarde",evening:"da tarde",night:"da noite"},abbreviated:{am:"AM",pm:"PM",midnight:"meia-noite",noon:"meio-dia",morning:"da manh\xE3",afternoon:"da tarde",evening:"da tarde",night:"da noite"},wide:{am:"a.m.",pm:"p.m.",midnight:"meia-noite",noon:"meio-dia",morning:"da manh\xE3",afternoon:"da tarde",evening:"da tarde",night:"da noite"}},A=(e,a)=>{let t=Number(e);return a?.unit==="week"?t+"\xAA":t+"\xBA"},x={ordinalNumber:A,era:c({values:S,defaultWidth:"wide"}),quarter:c({values:L,defaultWidth:"wide",argumentCallback:e=>e-1}),month:c({values:R,defaultWidth:"wide"}),day:c({values:H,defaultWidth:"wide"}),dayPeriod:c({values:T,defaultWidth:"wide",formattingValues:V,defaultFormattingWidth:"wide"})};var _=/^(\d+)[ºªo]?/i,B=/\d+/i,X={narrow:/^(ac|dc|a|d)/i,abbreviated:/^(a\.?\s?c\.?|d\.?\s?c\.?)/i,wide:/^(antes de cristo|depois de cristo)/i},E={any:[/^ac/i,/^dc/i],wide:[/^antes de cristo/i,/^depois de cristo/i]},O={narrow:/^[1234]/i,abbreviated:/^T[1234]/i,wide:/^[1234](º)? trimestre/i},I={any:[/1/i,/2/i,/3/i,/4/i]},Y={narrow:/^[jfmajsond]/i,abbreviated:/^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,wide:/^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i},Q={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^fev/i,/^mar/i,/^abr/i,/^mai/i,/^jun/i,/^jul/i,/^ago/i,/^set/i,/^out/i,/^nov/i,/^dez/i]},U={narrow:/^(dom|[23456]ª?|s[aá]b)/i,short:/^(dom|[23456]ª?|s[aá]b)/i,abbreviated:/^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,wide:/^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i},$={short:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],narrow:[/^d/i,/^2/i,/^3/i,/^4/i,/^5/i,/^6/i,/^s[aá]/i],any:[/^d/i,/^seg/i,/^t/i,/^qua/i,/^qui/i,/^sex/i,/^s[aá]b/i]},K={narrow:/^(a|p|mn|md|(da) (manhã|tarde|noite))/i,any:/^([ap]\.?\s?m\.?|meia[-\s]noite|meio[-\s]dia|(da) (manhã|tarde|noite))/i},G={any:{am:/^a/i,pm:/^p/i,midnight:/^mn|^meia[-\s]noite/i,noon:/^md|^meio[-\s]dia/i,morning:/manhã/i,afternoon:/tarde/i,evening:/tarde/i,night:/noite/i}},k={ordinalNumber:v({matchPattern:_,parsePattern:B,valueCallback:e=>parseInt(e,10)}),era:u({matchPatterns:X,defaultMatchWidth:"wide",parsePatterns:E,defaultParseWidth:"any"}),quarter:u({matchPatterns:O,defaultMatchWidth:"wide",parsePatterns:I,defaultParseWidth:"any",valueCallback:e=>e+1}),month:u({matchPatterns:Y,defaultMatchWidth:"wide",parsePatterns:Q,defaultParseWidth:"any"}),day:u({matchPatterns:U,defaultMatchWidth:"wide",parsePatterns:$,defaultParseWidth:"any"}),dayPeriod:u({matchPatterns:K,defaultMatchWidth:"any",parsePatterns:G,defaultParseWidth:"any"})};var W={code:"pt-BR",formatDistance:g,formatLong:P,formatRelative:w,localize:x,match:k,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ee(e){return e.charAt(0).toUpperCase()+e.slice(1)}function je({showOutsideDays:e=true,locale:a=W,navLayout:t="around",handleClear:r,handleToday:n,...i}){let o=getDefaultClassNames(),d={root:cx("bg-layer-2-idle shadow-elevation-2 rounded-[6px] p-small w-fit border border-border-layer-2 text-size-body-md text-neutral-dark font-inter",o.root),day:cx("rounded-circle hover:bg-layer-2-hover"),caption_label:cx("text-size-label-md text-neutral-dark font-medium",o.caption_label),outside:cx("text-neutral-placeholder",o.outside),selected:cx("text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:!bg-primary-alt-active"),disabled:cx("opacity-60",o.disabled),today:cx("text-neutral-dark font-medium bg-layer-2-active hover:!bg-layer-2-active"),range_start:cx("rounded-r-none text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:!bg-primary-alt-active"),range_end:cx("rounded-l-none text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:!bg-primary-alt-active"),range_middle:cx("!bg-primary-alt-active !text-primary-label-active rounded-none hover:!bg-primary-alt-active")};return jsx(DayPicker,{classNames:{...d,...i.classNames},components:{Chevron:({orientation:l})=>jsx(b$1,{className:"size-large text-icon-neutral-3",name:l==="left"?"chevron_left":"chevron_right"}),...i.components},footer:(r||n)&&jsxs("div",{className:"py-small border-border-layer-2 mt-small flex h-full w-full items-center justify-between border-t",children:[n&&jsx(b,{appearance:"ghost",variant:"secondary",onClick:n,children:"Hoje"}),r&&jsx(b,{appearance:"ghost",variant:"secondary",onClick:r,children:"Limpar"})]}),formatters:{formatWeekdayName:l=>{let s=l.toLocaleDateString("pt-BR",{weekday:"short"});return s.charAt(0).toUpperCase()+s.slice(1).replace(".","")},formatCaption(l){let s=l.toLocaleDateString("pt-BR",{month:"long"});return `${ee(s)} ${l.getFullYear()}`},...i.formatters},locale:a,mode:i.mode??"single",navLayout:t,showOutsideDays:e,...i})}export{je as Calendar};//# sourceMappingURL=calendar.js.map
|
|
2
|
-
//# sourceMappingURL=calendar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../node_modules/date-fns/locale/_lib/buildFormatLongFn.js","../../../../node_modules/date-fns/locale/_lib/buildLocalizeFn.js","../../../../node_modules/date-fns/locale/_lib/buildMatchFn.js","../../../../node_modules/date-fns/locale/_lib/buildMatchPatternFn.js","../../../../node_modules/date-fns/locale/pt-BR/_lib/formatDistance.js","../../../../node_modules/date-fns/locale/pt-BR/_lib/formatLong.js","../../../../node_modules/date-fns/locale/pt-BR/_lib/formatRelative.js","../../../../node_modules/date-fns/locale/pt-BR/_lib/localize.js","../../../../node_modules/date-fns/locale/pt-BR/_lib/match.js","../../../../node_modules/date-fns/locale/pt-BR.js","../../src/components/calendar.tsx"],"names":["buildFormatLongFn","args","options","width","buildLocalizeFn","value","context","valuesArray","defaultWidth","index","buildMatchFn","string","matchPattern","matchResult","matchedString","parsePatterns","key","findIndex","pattern","findKey","rest","object","predicate","array","buildMatchPatternFn","parseResult","formatDistanceLocale","formatDistance","token","count","result","tokenValue","dateFormats","timeFormats","dateTimeFormats","formatLong","formatRelativeLocale","date","weekday","formatRelative","_baseDate","_options","format","eraValues","quarterValues","monthValues","dayValues","dayPeriodValues","formattingDayPeriodValues","ordinalNumber","dirtyNumber","number","localize","quarter","matchOrdinalNumberPattern","parseOrdinalNumberPattern","matchEraPatterns","parseEraPatterns","matchQuarterPatterns","parseQuarterPatterns","matchMonthPatterns","parseMonthPatterns","matchDayPatterns","parseDayPatterns","matchDayPeriodPatterns","parseDayPeriodPatterns","match","ptBR","capitalize","str","Calendar","showOutsideDays","locale","navLayout","handleClear","handleToday","props","defaultClassNames","getDefaultClassNames","classNames","cx","jsx","DayPicker","orientation","Icon","jsxs","Button","month","monthName"],"mappings":"0PAAO,SAASA,CAAAA,CAAkBC,EAAM,CACtC,OAAO,CAACC,CAAAA,CAAU,KAAO,CAEvB,IAAMC,EAAQD,CAAAA,CAAQ,KAAA,CAAQ,OAAOA,CAAAA,CAAQ,KAAK,EAAID,CAAAA,CAAK,YAAA,CAE3D,OADeA,CAAAA,CAAK,QAAQE,CAAK,CAAA,EAAKF,EAAK,OAAA,CAAQA,CAAAA,CAAK,YAAY,CAEtE,CACF,CCgCO,SA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F,GAAAA,CAACG,GAAAA,CAAA,CACC,SAAA,CAAU,gCAAA,CACV,IAAA,CAJSD,CAAAA,GAAgB,OAAS,cAAA,CAAiB,eAAA,CAKrD,EAGJ,GAAGP,CAAAA,CAAM,UACX,CAAA,CACA,MAAA,CAAA,CACGF,GAAeC,CAAAA,GACdU,IAAAA,CAAC,OAAI,SAAA,CAAU,kGAAA,CACZ,UAAAV,CAAAA,EACCM,GAAAA,CAACK,EAAA,CACC,UAAA,CAAW,OAAA,CACX,OAAA,CAAQ,YACR,OAAA,CAASX,CAAAA,CACV,gBAED,CAAA,CAEDD,CAAAA,EACCO,IAACK,CAAAA,CAAA,CACC,WAAW,OAAA,CACX,OAAA,CAAQ,YACR,OAAA,CAASZ,CAAAA,CACV,kBAED,CAAA,CAAA,CAEJ,CAAA,CAGJ,WAAY,CACV,iBAAA,CAAmBrC,CAAAA,EAAQ,CACzB,IAAMC,CAAAA,CAAUD,CAAAA,CAAK,mBAAmB,OAAA,CAAS,CAAE,QAAS,OAAQ,CAAC,EACrE,OACEC,CAAAA,CAAQ,OAAO,CAAC,CAAA,CAAE,aAAY,CAAIA,CAAAA,CAAQ,MAAM,CAAC,CAAA,CAAE,OAAA,CAAQ,GAAA,CAAK,EAAE,CAEtE,CAAA,CACA,cAAciD,CAAAA,CAAO,CACnB,IAAMC,CAAAA,CAAYD,CAAAA,CAAM,mBAAmB,OAAA,CAAS,CAClD,MAAO,MACT,CAAC,EACD,OAAO,CAAA,EAAGnB,GAAWoB,CAAS,CAAC,IAAID,CAAAA,CAAM,WAAA,EAAa,CAAA,CACxD,CAAA,CACA,GAAGX,CAAAA,CAAM,UACX,EACA,MAAA,CAAQJ,CAAAA,CACR,KAAMI,CAAAA,CAAM,IAAA,EAAQ,SACpB,SAAA,CAAWH,CAAAA,CACX,gBAAiBF,CAAAA,CAChB,GAAGK,EACN,CAEJ","file":"calendar.js","sourcesContent":["export function buildFormatLongFn(args) {\n return (options = {}) => {\n // TODO: Remove String()\n const width = options.width ? String(options.width) : args.defaultWidth;\n const format = args.formats[width] || args.formats[args.defaultWidth];\n return format;\n };\n}\n","/**\n * The localize function argument callback which allows to convert raw value to\n * the actual type.\n *\n * @param value - The value to convert\n *\n * @returns The converted value\n */\n\n/**\n * The map of localized values for each width.\n */\n\n/**\n * The index type of the locale unit value. It types conversion of units of\n * values that don't start at 0 (i.e. quarters).\n */\n\n/**\n * Converts the unit value to the tuple of values.\n */\n\n/**\n * The tuple of localized era values. The first element represents BC,\n * the second element represents AD.\n */\n\n/**\n * The tuple of localized quarter values. The first element represents Q1.\n */\n\n/**\n * The tuple of localized day values. The first element represents Sunday.\n */\n\n/**\n * The tuple of localized month values. The first element represents January.\n */\n\nexport function buildLocalizeFn(args) {\n return (value, options) => {\n const context = options?.context ? String(options.context) : \"standalone\";\n\n let valuesArray;\n if (context === \"formatting\" && args.formattingValues) {\n const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;\n const width = options?.width ? String(options.width) : defaultWidth;\n\n valuesArray =\n args.formattingValues[width] || args.formattingValues[defaultWidth];\n } else {\n const defaultWidth = args.defaultWidth;\n const width = options?.width ? String(options.width) : args.defaultWidth;\n\n valuesArray = args.values[width] || args.values[defaultWidth];\n }\n const index = args.argumentCallback ? args.argumentCallback(value) : value;\n\n // @ts-expect-error - For some reason TypeScript just don't want to match it, no matter how hard we try. I challenge you to try to remove it!\n return valuesArray[index];\n };\n}\n","export function buildMatchFn(args) {\n return (string, options = {}) => {\n const width = options.width;\n\n const matchPattern =\n (width && args.matchPatterns[width]) ||\n args.matchPatterns[args.defaultMatchWidth];\n const matchResult = string.match(matchPattern);\n\n if (!matchResult) {\n return null;\n }\n const matchedString = matchResult[0];\n\n const parsePatterns =\n (width && args.parsePatterns[width]) ||\n args.parsePatterns[args.defaultParseWidth];\n\n const key = Array.isArray(parsePatterns)\n ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString))\n : // [TODO] -- I challenge you to fix the type\n findKey(parsePatterns, (pattern) => pattern.test(matchedString));\n\n let value;\n\n value = args.valueCallback ? args.valueCallback(key) : key;\n value = options.valueCallback\n ? // [TODO] -- I challenge you to fix the type\n options.valueCallback(value)\n : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n\nfunction findKey(object, predicate) {\n for (const key in object) {\n if (\n Object.prototype.hasOwnProperty.call(object, key) &&\n predicate(object[key])\n ) {\n return key;\n }\n }\n return undefined;\n}\n\nfunction findIndex(array, predicate) {\n for (let key = 0; key < array.length; key++) {\n if (predicate(array[key])) {\n return key;\n }\n }\n return undefined;\n}\n","export function buildMatchPatternFn(args) {\n return (string, options = {}) => {\n const matchResult = string.match(args.matchPattern);\n if (!matchResult) return null;\n const matchedString = matchResult[0];\n\n const parseResult = string.match(args.parsePattern);\n if (!parseResult) return null;\n let value = args.valueCallback\n ? args.valueCallback(parseResult[0])\n : parseResult[0];\n\n // [TODO] I challenge you to fix the type\n value = options.valueCallback ? options.valueCallback(value) : value;\n\n const rest = string.slice(matchedString.length);\n\n return { value, rest };\n };\n}\n","const formatDistanceLocale = {\n lessThanXSeconds: {\n one: \"menos de um segundo\",\n other: \"menos de {{count}} segundos\",\n },\n\n xSeconds: {\n one: \"1 segundo\",\n other: \"{{count}} segundos\",\n },\n\n halfAMinute: \"meio minuto\",\n\n lessThanXMinutes: {\n one: \"menos de um minuto\",\n other: \"menos de {{count}} minutos\",\n },\n\n xMinutes: {\n one: \"1 minuto\",\n other: \"{{count}} minutos\",\n },\n\n aboutXHours: {\n one: \"cerca de 1 hora\",\n other: \"cerca de {{count}} horas\",\n },\n\n xHours: {\n one: \"1 hora\",\n other: \"{{count}} horas\",\n },\n\n xDays: {\n one: \"1 dia\",\n other: \"{{count}} dias\",\n },\n\n aboutXWeeks: {\n one: \"cerca de 1 semana\",\n other: \"cerca de {{count}} semanas\",\n },\n\n xWeeks: {\n one: \"1 semana\",\n other: \"{{count}} semanas\",\n },\n\n aboutXMonths: {\n one: \"cerca de 1 mês\",\n other: \"cerca de {{count}} meses\",\n },\n\n xMonths: {\n one: \"1 mês\",\n other: \"{{count}} meses\",\n },\n\n aboutXYears: {\n one: \"cerca de 1 ano\",\n other: \"cerca de {{count}} anos\",\n },\n\n xYears: {\n one: \"1 ano\",\n other: \"{{count}} anos\",\n },\n\n overXYears: {\n one: \"mais de 1 ano\",\n other: \"mais de {{count}} anos\",\n },\n\n almostXYears: {\n one: \"quase 1 ano\",\n other: \"quase {{count}} anos\",\n },\n};\n\nexport const formatDistance = (token, count, options) => {\n let result;\n\n const tokenValue = formatDistanceLocale[token];\n if (typeof tokenValue === \"string\") {\n result = tokenValue;\n } else if (count === 1) {\n result = tokenValue.one;\n } else {\n result = tokenValue.other.replace(\"{{count}}\", String(count));\n }\n\n if (options?.addSuffix) {\n if (options.comparison && options.comparison > 0) {\n return \"em \" + result;\n } else {\n return \"há \" + result;\n }\n }\n\n return result;\n};\n","import { buildFormatLongFn } from \"../../_lib/buildFormatLongFn.js\";\n\nconst dateFormats = {\n full: \"EEEE, d 'de' MMMM 'de' y\",\n long: \"d 'de' MMMM 'de' y\",\n medium: \"d MMM y\",\n short: \"dd/MM/yyyy\",\n};\n\nconst timeFormats = {\n full: \"HH:mm:ss zzzz\",\n long: \"HH:mm:ss z\",\n medium: \"HH:mm:ss\",\n short: \"HH:mm\",\n};\n\nconst dateTimeFormats = {\n full: \"{{date}} 'às' {{time}}\",\n long: \"{{date}} 'às' {{time}}\",\n medium: \"{{date}}, {{time}}\",\n short: \"{{date}}, {{time}}\",\n};\n\nexport const formatLong = {\n date: buildFormatLongFn({\n formats: dateFormats,\n defaultWidth: \"full\",\n }),\n\n time: buildFormatLongFn({\n formats: timeFormats,\n defaultWidth: \"full\",\n }),\n\n dateTime: buildFormatLongFn({\n formats: dateTimeFormats,\n defaultWidth: \"full\",\n }),\n};\n","const formatRelativeLocale = {\n lastWeek: (date) => {\n const weekday = date.getDay();\n const last = weekday === 0 || weekday === 6 ? \"último\" : \"última\";\n return \"'\" + last + \"' eeee 'às' p\";\n },\n yesterday: \"'ontem às' p\",\n today: \"'hoje às' p\",\n tomorrow: \"'amanhã às' p\",\n nextWeek: \"eeee 'às' p\",\n other: \"P\",\n};\n\nexport const formatRelative = (token, date, _baseDate, _options) => {\n const format = formatRelativeLocale[token];\n\n if (typeof format === \"function\") {\n return format(date);\n }\n\n return format;\n};\n","import { buildLocalizeFn } from \"../../_lib/buildLocalizeFn.js\";\n\nconst eraValues = {\n narrow: [\"AC\", \"DC\"],\n abbreviated: [\"AC\", \"DC\"],\n wide: [\"antes de cristo\", \"depois de cristo\"],\n};\n\nconst quarterValues = {\n narrow: [\"1\", \"2\", \"3\", \"4\"],\n abbreviated: [\"T1\", \"T2\", \"T3\", \"T4\"],\n wide: [\"1º trimestre\", \"2º trimestre\", \"3º trimestre\", \"4º trimestre\"],\n};\n\nconst monthValues = {\n narrow: [\"j\", \"f\", \"m\", \"a\", \"m\", \"j\", \"j\", \"a\", \"s\", \"o\", \"n\", \"d\"],\n abbreviated: [\n \"jan\",\n \"fev\",\n \"mar\",\n \"abr\",\n \"mai\",\n \"jun\",\n \"jul\",\n \"ago\",\n \"set\",\n \"out\",\n \"nov\",\n \"dez\",\n ],\n\n wide: [\n \"janeiro\",\n \"fevereiro\",\n \"março\",\n \"abril\",\n \"maio\",\n \"junho\",\n \"julho\",\n \"agosto\",\n \"setembro\",\n \"outubro\",\n \"novembro\",\n \"dezembro\",\n ],\n};\n\nconst dayValues = {\n narrow: [\"D\", \"S\", \"T\", \"Q\", \"Q\", \"S\", \"S\"],\n short: [\"dom\", \"seg\", \"ter\", \"qua\", \"qui\", \"sex\", \"sab\"],\n abbreviated: [\n \"domingo\",\n \"segunda\",\n \"terça\",\n \"quarta\",\n \"quinta\",\n \"sexta\",\n \"sábado\",\n ],\n\n wide: [\n \"domingo\",\n \"segunda-feira\",\n \"terça-feira\",\n \"quarta-feira\",\n \"quinta-feira\",\n \"sexta-feira\",\n \"sábado\",\n ],\n};\n\nconst dayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mn\",\n noon: \"md\",\n morning: \"manhã\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noite\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"meia-noite\",\n noon: \"meio-dia\",\n morning: \"manhã\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noite\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"meia-noite\",\n noon: \"meio-dia\",\n morning: \"manhã\",\n afternoon: \"tarde\",\n evening: \"tarde\",\n night: \"noite\",\n },\n};\n\nconst formattingDayPeriodValues = {\n narrow: {\n am: \"a\",\n pm: \"p\",\n midnight: \"mn\",\n noon: \"md\",\n morning: \"da manhã\",\n afternoon: \"da tarde\",\n evening: \"da tarde\",\n night: \"da noite\",\n },\n abbreviated: {\n am: \"AM\",\n pm: \"PM\",\n midnight: \"meia-noite\",\n noon: \"meio-dia\",\n morning: \"da manhã\",\n afternoon: \"da tarde\",\n evening: \"da tarde\",\n night: \"da noite\",\n },\n wide: {\n am: \"a.m.\",\n pm: \"p.m.\",\n midnight: \"meia-noite\",\n noon: \"meio-dia\",\n morning: \"da manhã\",\n afternoon: \"da tarde\",\n evening: \"da tarde\",\n night: \"da noite\",\n },\n};\n\nconst ordinalNumber = (dirtyNumber, options) => {\n const number = Number(dirtyNumber);\n\n if (options?.unit === \"week\") {\n return number + \"ª\";\n }\n return number + \"º\";\n};\n\nexport const localize = {\n ordinalNumber,\n\n era: buildLocalizeFn({\n values: eraValues,\n defaultWidth: \"wide\",\n }),\n\n quarter: buildLocalizeFn({\n values: quarterValues,\n defaultWidth: \"wide\",\n argumentCallback: (quarter) => quarter - 1,\n }),\n\n month: buildLocalizeFn({\n values: monthValues,\n defaultWidth: \"wide\",\n }),\n\n day: buildLocalizeFn({\n values: dayValues,\n defaultWidth: \"wide\",\n }),\n\n dayPeriod: buildLocalizeFn({\n values: dayPeriodValues,\n defaultWidth: \"wide\",\n formattingValues: formattingDayPeriodValues,\n defaultFormattingWidth: \"wide\",\n }),\n};\n","import { buildMatchFn } from \"../../_lib/buildMatchFn.js\";\nimport { buildMatchPatternFn } from \"../../_lib/buildMatchPatternFn.js\";\n\nconst matchOrdinalNumberPattern = /^(\\d+)[ºªo]?/i;\nconst parseOrdinalNumberPattern = /\\d+/i;\n\nconst matchEraPatterns = {\n narrow: /^(ac|dc|a|d)/i,\n abbreviated: /^(a\\.?\\s?c\\.?|d\\.?\\s?c\\.?)/i,\n wide: /^(antes de cristo|depois de cristo)/i,\n};\nconst parseEraPatterns = {\n any: [/^ac/i, /^dc/i],\n wide: [/^antes de cristo/i, /^depois de cristo/i],\n};\n\nconst matchQuarterPatterns = {\n narrow: /^[1234]/i,\n abbreviated: /^T[1234]/i,\n wide: /^[1234](º)? trimestre/i,\n};\nconst parseQuarterPatterns = {\n any: [/1/i, /2/i, /3/i, /4/i],\n};\n\nconst matchMonthPatterns = {\n narrow: /^[jfmajsond]/i,\n abbreviated: /^(jan|fev|mar|abr|mai|jun|jul|ago|set|out|nov|dez)/i,\n wide: /^(janeiro|fevereiro|março|abril|maio|junho|julho|agosto|setembro|outubro|novembro|dezembro)/i,\n};\nconst parseMonthPatterns = {\n narrow: [\n /^j/i,\n /^f/i,\n /^m/i,\n /^a/i,\n /^m/i,\n /^j/i,\n /^j/i,\n /^a/i,\n /^s/i,\n /^o/i,\n /^n/i,\n /^d/i,\n ],\n\n any: [\n /^ja/i,\n /^fev/i,\n /^mar/i,\n /^abr/i,\n /^mai/i,\n /^jun/i,\n /^jul/i,\n /^ago/i,\n /^set/i,\n /^out/i,\n /^nov/i,\n /^dez/i,\n ],\n};\n\nconst matchDayPatterns = {\n narrow: /^(dom|[23456]ª?|s[aá]b)/i,\n short: /^(dom|[23456]ª?|s[aá]b)/i,\n abbreviated: /^(dom|seg|ter|qua|qui|sex|s[aá]b)/i,\n wide: /^(domingo|(segunda|ter[cç]a|quarta|quinta|sexta)([- ]feira)?|s[aá]bado)/i,\n};\nconst parseDayPatterns = {\n short: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],\n narrow: [/^d/i, /^2/i, /^3/i, /^4/i, /^5/i, /^6/i, /^s[aá]/i],\n any: [/^d/i, /^seg/i, /^t/i, /^qua/i, /^qui/i, /^sex/i, /^s[aá]b/i],\n};\n\nconst matchDayPeriodPatterns = {\n narrow: /^(a|p|mn|md|(da) (manhã|tarde|noite))/i,\n any: /^([ap]\\.?\\s?m\\.?|meia[-\\s]noite|meio[-\\s]dia|(da) (manhã|tarde|noite))/i,\n};\nconst parseDayPeriodPatterns = {\n any: {\n am: /^a/i,\n pm: /^p/i,\n midnight: /^mn|^meia[-\\s]noite/i,\n noon: /^md|^meio[-\\s]dia/i,\n morning: /manhã/i,\n afternoon: /tarde/i,\n evening: /tarde/i,\n night: /noite/i,\n },\n};\n\nexport const match = {\n ordinalNumber: buildMatchPatternFn({\n matchPattern: matchOrdinalNumberPattern,\n parsePattern: parseOrdinalNumberPattern,\n valueCallback: (value) => parseInt(value, 10),\n }),\n\n era: buildMatchFn({\n matchPatterns: matchEraPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseEraPatterns,\n defaultParseWidth: \"any\",\n }),\n\n quarter: buildMatchFn({\n matchPatterns: matchQuarterPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseQuarterPatterns,\n defaultParseWidth: \"any\",\n valueCallback: (index) => index + 1,\n }),\n\n month: buildMatchFn({\n matchPatterns: matchMonthPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseMonthPatterns,\n defaultParseWidth: \"any\",\n }),\n\n day: buildMatchFn({\n matchPatterns: matchDayPatterns,\n defaultMatchWidth: \"wide\",\n parsePatterns: parseDayPatterns,\n defaultParseWidth: \"any\",\n }),\n\n dayPeriod: buildMatchFn({\n matchPatterns: matchDayPeriodPatterns,\n defaultMatchWidth: \"any\",\n parsePatterns: parseDayPeriodPatterns,\n defaultParseWidth: \"any\",\n }),\n};\n","import { formatDistance } from \"./pt-BR/_lib/formatDistance.js\";\nimport { formatLong } from \"./pt-BR/_lib/formatLong.js\";\nimport { formatRelative } from \"./pt-BR/_lib/formatRelative.js\";\nimport { localize } from \"./pt-BR/_lib/localize.js\";\nimport { match } from \"./pt-BR/_lib/match.js\";\n\n/**\n * @category Locales\n * @summary Portuguese locale (Brazil).\n * @language Portuguese\n * @iso-639-2 por\n * @author Lucas Duailibe [@duailibe](https://github.com/duailibe)\n * @author Yago Carballo [@yagocarballo](https://github.com/YagoCarballo)\n */\nexport const ptBR = {\n code: \"pt-BR\",\n formatDistance: formatDistance,\n formatLong: formatLong,\n formatRelative: formatRelative,\n localize: localize,\n match: match,\n options: {\n weekStartsOn: 0 /* Sunday */,\n firstWeekContainsDate: 1,\n },\n};\n\n// Fallback for modularized imports:\nexport default ptBR;\n","import 'react-day-picker/style.css'\nimport { ptBR } from 'date-fns/locale'\nimport { cx } from '@xjur-ui/util'\nimport {\n type DayPickerProps,\n type ClassNames,\n DayPicker,\n getDefaultClassNames\n} from 'react-day-picker'\nimport { Icon, type IconType } from './icon'\nimport { Button } from './button'\n\nfunction capitalize(str: string) {\n return str.charAt(0).toUpperCase() + str.slice(1)\n}\n\nexport { type DateRange } from 'react-day-picker'\n\nexport type CalendarProps = DayPickerProps & {\n handleClear?: () => void\n handleToday?: () => void\n}\n\nexport function Calendar({\n showOutsideDays = true,\n locale = ptBR,\n navLayout = 'around',\n handleClear,\n handleToday,\n ...props\n}: CalendarProps) {\n const defaultClassNames = getDefaultClassNames()\n\n const classNames: Partial<ClassNames> = {\n root: cx(\n 'bg-layer-2-idle shadow-elevation-2 rounded-[6px] p-small w-fit border border-border-layer-2 text-size-body-md text-neutral-dark font-inter',\n defaultClassNames.root\n ),\n day: cx('rounded-circle hover:bg-layer-2-hover'),\n caption_label: cx(\n 'text-size-label-md text-neutral-dark font-medium',\n defaultClassNames.caption_label\n ),\n outside: cx('text-neutral-placeholder', defaultClassNames.outside),\n selected: cx(\n 'text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:!bg-primary-alt-active'\n ),\n disabled: cx('opacity-60', defaultClassNames.disabled),\n today: cx(\n 'text-neutral-dark font-medium bg-layer-2-active hover:!bg-layer-2-active'\n ),\n range_start: cx(\n 'rounded-r-none text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:!bg-primary-alt-active'\n ),\n range_end: cx(\n 'rounded-l-none text-size-body-md bg-primary-alt-active text-primary-label-active font-medium hover:!bg-primary-alt-active'\n ),\n range_middle: cx(\n '!bg-primary-alt-active !text-primary-label-active rounded-none hover:!bg-primary-alt-active'\n )\n }\n\n return (\n <DayPicker\n classNames={{ ...classNames, ...props.classNames }}\n components={{\n Chevron: ({ orientation }) => {\n const icon = orientation === 'left' ? 'chevron_left' : 'chevron_right'\n return (\n <Icon\n className=\"size-large text-icon-neutral-3\"\n name={icon as IconType}\n />\n )\n },\n ...props.components\n }}\n footer={\n (handleClear || handleToday) && (\n <div className=\"py-small border-border-layer-2 mt-small flex h-full w-full items-center justify-between border-t\">\n {handleToday && (\n <Button\n appearance=\"ghost\"\n variant=\"secondary\"\n onClick={handleToday}\n >\n Hoje\n </Button>\n )}\n {handleClear && (\n <Button\n appearance=\"ghost\"\n variant=\"secondary\"\n onClick={handleClear}\n >\n Limpar\n </Button>\n )}\n </div>\n )\n }\n formatters={{\n formatWeekdayName: date => {\n const weekday = date.toLocaleDateString('pt-BR', { weekday: 'short' })\n return (\n weekday.charAt(0).toUpperCase() + weekday.slice(1).replace('.', '')\n )\n },\n formatCaption(month) {\n const monthName = month.toLocaleDateString('pt-BR', {\n month: 'long'\n })\n return `${capitalize(monthName)} ${month.getFullYear()}`\n },\n ...props.formatters\n }}\n locale={locale}\n mode={props.mode ?? 'single'}\n navLayout={navLayout}\n showOutsideDays={showOutsideDays}\n {...props}\n />\n )\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'../chunk-EIG6CBTQ.js';import {b}from'../chunk-SHHXKVVR.js';import*as r from'@radix-ui/react-checkbox';import {cx}from'@xjur-ui/util';import {jsxs,jsx}from'react/jsx-runtime';function y({label:o,name:i,className:l,disabled:a$1=false,...s}){let t=`field-checkbox-${i}`;return jsxs("div",{className:"group gap-small flex items-center",children:[jsx(r.Root,{disabled:a$1,...s,className:cx("size-large-alt rounded-small-1x inline-flex items-center justify-center transition-[border-color,box-shadow,background-color] duration-200 outline-none","border-border-layer-2 bg-layer-2-idle cursor-pointer border-2","hover:border-primary-idle focus:border-primary-idle focus:shadow-focus-primary","data-[state=checked]:bg-primary-active data-[state=checked]:border-primary-active","data-[state=checked]:hover:border-primary-idle","disabled:hover:border-border-layer-2 disabled:cursor-not-allowed disabled:opacity-[38%]",l),id:t,name:i,children:jsx(r.Indicator,{className:"flex items-center justify-center",children:jsx(b,{className:"text-neutral-label",name:"check"})})}),!!o&&jsx(a,{asChild:true,className:"text-size-body-sm data-[disabled=true]:opacity-38","data-disabled":a$1,weight:"medium",children:jsx("label",{htmlFor:t,children:o})})]})}export{y as Checkbox};//# sourceMappingURL=checkbox.js.map
|
|
2
|
-
//# sourceMappingURL=checkbox.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/checkbox.tsx"],"names":["Checkbox","label","name","className","disabled","props","fieldId","jsxs","jsx","cx","Icon","Typography"],"mappings":"6LAKO,SAASA,CAAAA,CAAS,CACvB,KAAA,CAAAC,CAAAA,CACA,KAAAC,CAAAA,CACA,SAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,GAAAA,CAAW,KAAA,CACX,GAAGC,CACL,CAAA,CAEG,CACD,IAAMC,CAAAA,CAAU,kBAAkBJ,CAAI,CAAA,CAAA,CAEtC,OACEK,IAAAA,CAAC,KAAA,CAAA,CAAI,SAAA,CAAU,oCACb,QAAA,CAAA,CAAAC,GAAAA,CAAkB,OAAjB,CACC,QAAA,CAAUJ,IACT,GAAGC,CAAAA,CACJ,SAAA,CAAWI,EAAAA,CAET,yJAAA,CAEA,+DAAA,CAEA,iFAEA,mFAAA,CAEA,gDAAA,CAEA,0FACAN,CACF,CAAA,CACA,GAAIG,CAAAA,CACJ,IAAA,CAAMJ,CAAAA,CAEN,QAAA,CAAAM,GAAAA,CAAkB,CAAA,CAAA,SAAA,CAAjB,CAA2B,SAAA,CAAU,kCAAA,CACpC,SAAAA,GAAAA,CAACE,CAAAA,CAAA,CAAK,SAAA,CAAU,oBAAA,CAAqB,IAAA,CAAK,OAAA,CAAQ,CAAA,CACpD,CAAA,CACF,EAEC,CAAC,CAACT,GACDO,GAAAA,CAACG,CAAAA,CAAA,CACC,OAAA,CAAS,IAAA,CACT,SAAA,CAAU,mDAAA,CACV,eAAA,CAAeP,GAAAA,CACf,OAAO,QAAA,CAEP,QAAA,CAAAI,IAAC,OAAA,CAAA,CAAM,OAAA,CAASF,EAAU,QAAA,CAAAL,CAAAA,CAAM,CAAA,CAClC,CAAA,CAAA,CAEJ,CAEJ","file":"checkbox.js","sourcesContent":["import * as CheckoxPrimitive from '@radix-ui/react-checkbox'\nimport { cx } from '@xjur-ui/util'\nimport { Icon } from './icon'\nimport { Typography } from './typography'\n\nexport function Checkbox({\n label,\n name,\n className,\n disabled = false,\n ...props\n}: CheckoxPrimitive.CheckboxProps & {\n label?: string\n}) {\n const fieldId = `field-checkbox-${name}`\n\n return (\n <div className=\"group gap-small flex items-center\">\n <CheckoxPrimitive.Root\n disabled={disabled}\n {...props}\n className={cx(\n // layout\n 'size-large-alt rounded-small-1x inline-flex items-center justify-center transition-[border-color,box-shadow,background-color] duration-200 outline-none',\n // base\n 'border-border-layer-2 bg-layer-2-idle cursor-pointer border-2',\n // hover/focus (desmarcado)\n 'hover:border-primary-idle focus:border-primary-idle focus:shadow-focus-primary',\n // estado checked\n 'data-[state=checked]:bg-primary-active data-[state=checked]:border-primary-active',\n // hover quando estiver checked (opcional)\n 'data-[state=checked]:hover:border-primary-idle',\n // disabled\n 'disabled:hover:border-border-layer-2 disabled:cursor-not-allowed disabled:opacity-[38%]',\n className\n )}\n id={fieldId}\n name={name}\n >\n <CheckoxPrimitive.Indicator className=\"flex items-center justify-center\">\n <Icon className=\"text-neutral-label\" name=\"check\" />\n </CheckoxPrimitive.Indicator>\n </CheckoxPrimitive.Root>\n\n {!!label && (\n <Typography\n asChild={true}\n className=\"text-size-body-sm data-[disabled=true]:opacity-38\"\n data-disabled={disabled}\n weight=\"medium\"\n >\n <label htmlFor={fieldId}>{label}</label>\n </Typography>\n )}\n </div>\n )\n}\n"]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
import * as RadixPopover from '@radix-ui/react-popover';
|
|
4
|
-
import { TypographyProps, Typography } from './typography.js';
|
|
5
|
-
import 'class-variance-authority/types';
|
|
6
|
-
import '@xjur-ui/util';
|
|
7
|
-
|
|
8
|
-
declare function DatePickerRoot({ disabled, variant, hasError, ...props }: ComponentProps<typeof RadixPopover.Root> & {
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
variant?: 'filled' | 'outlined';
|
|
11
|
-
hasError?: boolean;
|
|
12
|
-
}): react_jsx_runtime.JSX.Element;
|
|
13
|
-
declare function DatePickerTrigger({ className, ...props }: ComponentProps<typeof RadixPopover.Trigger>): react_jsx_runtime.JSX.Element;
|
|
14
|
-
declare function DatePickerContent({ className, sideOffset, side, align, ...props }: ComponentProps<typeof RadixPopover.Content>): react_jsx_runtime.JSX.Element;
|
|
15
|
-
declare function DatePickerValue({ className, displayValue, value, ...props }: ComponentProps<'input'> & {
|
|
16
|
-
displayValue?: string;
|
|
17
|
-
}): react_jsx_runtime.JSX.Element;
|
|
18
|
-
declare function DatePickerLabel({ className, htmlFor, children, ...props }: TypographyProps & {
|
|
19
|
-
htmlFor?: string;
|
|
20
|
-
}): react_jsx_runtime.JSX.Element;
|
|
21
|
-
declare function DatePickerLeftSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
22
|
-
declare function DatePickerRightSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
23
|
-
declare function DatePickerCaption({ className, variant, size, weight, ...props }: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
|
|
24
|
-
|
|
25
|
-
export { DatePickerCaption, DatePickerContent, DatePickerLabel, DatePickerLeftSlot, DatePickerRightSlot, DatePickerRoot, DatePickerTrigger, DatePickerValue };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'../chunk-EIG6CBTQ.js';import {createContext,useContext}from'react';import*as l from'@radix-ui/react-popover';import {tv,twMerge,twJoin}from'@xjur-ui/util';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var g=createContext({disabled:false,variant:"filled",hasError:false});function u(){let e=useContext(g);if(!e)throw new Error("useDatePicker must be used within a DatePickerRoot");return e}function w({disabled:e=false,variant:t="filled",hasError:a=false,...o}){return jsx(g.Provider,{value:{disabled:e,variant:t,hasError:a},children:jsx(l.Root,{...o})})}function k({className:e,...t}){let{disabled:a,variant:o,hasError:i}=u(),s=tv({base:twMerge("border border-transparent group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full items-center cursor-pointer","data-[state=open]:border-primary-idle","has-[input:not(:placeholder-shown)]:text-primary-idle","has-[input:not(:placeholder-shown)]:border-primary-idle","focus-within:border-primary-idle focus-within:hover:border-primary-idle","hover:border-border-layer-1"),variants:{variant:{filled:"bg-layer-2-hover",outlined:"bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3",disabled:"hover:border-transparent border-none bg-layer-2-idle cursor-text select-text"},state:{idle:"",error:twMerge("focus-within:border-danger-idle hover:border-danger-idle border-danger-idle focus-within:hover:border-danger-idle","data-[state=open]:border-danger-idle has-[input:not(:placeholder-shown)]:border-danger-idle")}},defaultVariants:{variant:"filled",state:"idle"}});return jsx(l.Trigger,{className:s({variant:a?"disabled":o,state:i?"error":"idle",className:e}),...t,disabled:a})}function C({className:e,sideOffset:t=5,side:a="bottom",align:o="start",...i}){return jsx(l.Portal,{children:jsx(l.Content,{align:o,className:twJoin(e,"group z-10 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]"),side:a,sideOffset:t,...i})})}function R({className:e,displayValue:t="",value:a$1,...o}){return jsxs(Fragment,{children:[!!t&&jsx(a,{className:"text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x",children:t}),jsx("input",{...o,"aria-readonly":true,className:twJoin("pointer-events-none",e),hidden:true,placeholder:o.placeholder??" ",readOnly:true,value:a$1??""})]})}function D({className:e,htmlFor:t,children:a$1,...o}){let{variant:i,disabled:s,hasError:p}=u();return jsx(a,{asChild:true,className:twJoin("group inline-block max-w-full truncate text-left font-normal","left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2","ease transition-all duration-250","group-data-[state=open]:text-primary-idle group-data-[state=open]:data-[error=true]:text-danger-label-active","group-data-[state=open]:-top-[3px]","group-data-[state=open]:text-size-label-sm-1x","group-data-[state=open]:font-medium","group-has-[input:not(:placeholder-shown)]:text-primary-idle group-has-[input:not(:placeholder-shown)]:data-[error=true]:text-danger-label-active","group-has-[input:not(:placeholder-shown)]:-top-[3px]","group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x","group-has-[input:not(:placeholder-shown)]:font-medium","group-has-[div[data-slot=date-picker-left-slot]]:left-large-4x","group-has-[div[data-slot=date-picker-left-slot]]:group-data-[state=open]:left-small","group-has-[div[data-slot=date-picker-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small","group-has-[div[data-slot=date-picker-right-slot]]:right-large-4x","group-has-[div[data-slot=date-picker-right-slot]]:group-data-[state=open]:right-small","group-has-[div[data-slot=date-picker-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small","group-data-[state=open]:animate-in","group-data-[state=closed]:animate-out","group-has-[input:not(:placeholder-shown)]:animate-out","data-[disabled=true]:hidden",e),"data-disabled":s,"data-error":p,"data-variant":i,weight:"medium",...o,children:jsx("label",{htmlFor:t,children:jsx("span",{className:twJoin("rounded-small-1x max-w-full","group-data-[variant=outlined]:bg-layer-2-idle","group-data-[variant=filled]:bg-layer-2-hover"),children:a$1})})})}function N({className:e,...t}){return jsx("div",{...t,className:twJoin(e,"left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center"),"data-slot":"date-picker-left-slot"})}function T({className:e,...t}){return jsx("div",{...t,className:twJoin(e,"right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center"),"data-slot":"date-picker-right-slot"})}function E({className:e,variant:t="body",size:a$1="sm",weight:o="normal",...i}){let{hasError:s}=u(),p=tv({base:"text-size-body-sm mt-small-1x font-normal",variants:{state:{error:"text-danger-label-active",idle:"text-neutral-dark"}}});return jsx(a,{className:p({state:s?"error":"idle",className:e}),size:a$1,variant:t,weight:o,...i})}export{E as DatePickerCaption,C as DatePickerContent,D as DatePickerLabel,N as DatePickerLeftSlot,T as DatePickerRightSlot,w as DatePickerRoot,k as DatePickerTrigger,R as DatePickerValue};//# sourceMappingURL=date-picker.js.map
|
|
2
|
-
//# sourceMappingURL=date-picker.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/date-picker.tsx"],"names":["DatePickerContext","createContext","useDatePicker","context","useContext","DatePickerRoot","disabled","variant","hasError","props","jsx","DatePickerTrigger","className","trigger","tv","twMerge","DatePickerContent","sideOffset","side","align","twJoin","DatePickerValue","displayValue","value","jsxs","Fragment","Typography","DatePickerLabel","htmlFor","children","DatePickerLeftSlot","DatePickerRightSlot","DatePickerCaption","size","weight","caption"],"mappings":"4NAMA,IAAMA,CAAAA,CAAoBC,aAAAA,CAAc,CACtC,QAAA,CAAU,KAAA,CACV,OAAA,CAAS,QAAA,CACT,QAAA,CAAU,KACZ,CAAC,CAAA,CAED,SAASC,CAAAA,EAAgB,CACvB,IAAMC,CAAAA,CAAUC,U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AClC,SAAA,CAAAnB,CAAAA,CACA,GAAGH,CACL,CAAA,CAA0B,CACxB,OACEC,GAAAA,CAAC,KAAA,CAAA,CACE,GAAGD,CAAAA,CACJ,SAAA,CAAWW,OACTR,CAAAA,CACA,gFACF,CAAA,CACA,WAAA,CAAU,wBAAA,CACZ,CAEJ,CAEO,SAASoB,CAAAA,CAAkB,CAChC,SAAA,CAAApB,CAAAA,CACA,OAAA,CAAAL,CAAAA,CAAU,OACV,IAAA,CAAA0B,GAAAA,CAAO,IAAA,CACP,MAAA,CAAAC,CAAAA,CAAS,QAAA,CACT,GAAGzB,CACL,CAAA,CAAsC,CACpC,GAAM,CAAE,QAAA,CAAAD,CAAS,EAAIN,CAAAA,EAAc,CAE7BiC,CAAAA,CAAUrB,EAAAA,CAAG,CACjB,IAAA,CAAM,2CAAA,CACN,QAAA,CAAU,CACR,KAAA,CAAO,CACL,KAAA,CAAO,0BAAA,CACP,IAAA,CAAM,mBACR,CACF,CACF,CAAC,CAAA,CAED,OACEJ,GAAAA,CAACgB,CAAAA,CAAA,CACC,SAAA,CAAWS,CAAAA,CAAQ,CACjB,KAAA,CAAO3B,CAAAA,CAAW,OAAA,CAAU,OAC5B,SAAA,CAAAI,CACF,CAAC,CAAA,CACD,IAAA,CAAMqB,GAAAA,CACN,OAAA,CAAS1B,CAAAA,CACT,MAAA,CAAQ2B,CAAAA,CACP,GAAGzB,CAAAA,CACN,CAEJ","file":"date-picker.js","sourcesContent":["import { createContext, useContext } from 'react'\nimport type { ComponentProps } from 'react'\nimport * as RadixPopover from '@radix-ui/react-popover'\nimport { tv, twJoin, twMerge } from '@xjur-ui/util'\nimport { Typography, type TypographyProps } from './typography'\n\nconst DatePickerContext = createContext({\n disabled: false,\n variant: 'filled' as 'filled' | 'outlined',\n hasError: false\n})\n\nfunction useDatePicker() {\n const context = useContext(DatePickerContext)\n if (!context) {\n throw new Error('useDatePicker must be used within a DatePickerRoot')\n }\n return context\n}\n\nexport function DatePickerRoot({\n disabled = false,\n variant = 'filled',\n hasError = false,\n ...props\n}: ComponentProps<typeof RadixPopover.Root> & {\n disabled?: boolean\n variant?: 'filled' | 'outlined'\n hasError?: boolean\n}) {\n return (\n <DatePickerContext.Provider value={{ disabled, variant, hasError }}>\n <RadixPopover.Root {...props} />\n </DatePickerContext.Provider>\n )\n}\n\nexport function DatePickerTrigger({\n className,\n ...props\n}: ComponentProps<typeof RadixPopover.Trigger>) {\n const { disabled, variant, hasError } = useDatePicker()\n\n const trigger = tv({\n base: twMerge(\n 'border border-transparent group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full items-center cursor-pointer',\n 'data-[state=open]:border-primary-idle',\n 'has-[input:not(:placeholder-shown)]:text-primary-idle',\n 'has-[input:not(:placeholder-shown)]:border-primary-idle',\n 'focus-within:border-primary-idle focus-within:hover:border-primary-idle',\n 'hover:border-border-layer-1'\n ),\n variants: {\n variant: {\n filled: 'bg-layer-2-hover',\n outlined:\n 'bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3',\n disabled:\n 'hover:border-transparent border-none bg-layer-2-idle cursor-text select-text'\n },\n state: {\n idle: '',\n error: twMerge(\n 'focus-within:border-danger-idle hover:border-danger-idle border-danger-idle focus-within:hover:border-danger-idle',\n 'data-[state=open]:border-danger-idle has-[input:not(:placeholder-shown)]:border-danger-idle'\n )\n }\n },\n defaultVariants: {\n variant: 'filled',\n state: 'idle'\n }\n })\n\n return (\n <RadixPopover.Trigger\n className={trigger({\n variant: disabled ? 'disabled' : variant,\n state: hasError ? 'error' : 'idle',\n className\n })}\n {...props}\n disabled={disabled}\n />\n )\n}\n\nexport function DatePickerContent({\n className,\n sideOffset = 5,\n side = 'bottom',\n align = 'start',\n ...props\n}: ComponentProps<typeof RadixPopover.Content>) {\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n align={align}\n className={twJoin(\n className,\n 'group z-10 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]'\n )}\n side={side}\n sideOffset={sideOffset}\n {...props}\n />\n </RadixPopover.Portal>\n )\n}\n\nexport function DatePickerValue({\n className,\n displayValue = '',\n value,\n ...props\n}: ComponentProps<'input'> & { displayValue?: string }) {\n return (\n <>\n {!!displayValue && (\n <Typography className=\"text-neutral-dark group-has-[div[data-slot=date-picker-left-slot]]:pl-large-1x\">\n {displayValue}\n </Typography>\n )}\n\n <input\n {...props}\n aria-readonly={true}\n className={twJoin('pointer-events-none', className)}\n hidden={true}\n placeholder={props.placeholder ?? ' '}\n readOnly={true}\n value={value ?? ''}\n />\n </>\n )\n}\n\nexport function DatePickerLabel({\n className,\n htmlFor,\n children,\n ...props\n}: TypographyProps & { htmlFor?: string }) {\n const { variant, disabled, hasError } = useDatePicker()\n\n return (\n <Typography\n asChild={true}\n className={twJoin(\n 'group inline-block max-w-full truncate text-left font-normal',\n 'left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2',\n 'ease transition-all duration-250',\n // Content Open\n 'group-data-[state=open]:text-primary-idle group-data-[state=open]:data-[error=true]:text-danger-label-active',\n 'group-data-[state=open]:-top-[3px]',\n 'group-data-[state=open]:text-size-label-sm-1x',\n 'group-data-[state=open]:font-medium',\n // Filled\n 'group-has-[input:not(:placeholder-shown)]:text-primary-idle group-has-[input:not(:placeholder-shown)]:data-[error=true]:text-danger-label-active',\n 'group-has-[input:not(:placeholder-shown)]:-top-[3px]',\n 'group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x',\n 'group-has-[input:not(:placeholder-shown)]:font-medium',\n // If has left slot\n 'group-has-[div[data-slot=date-picker-left-slot]]:left-large-4x',\n 'group-has-[div[data-slot=date-picker-left-slot]]:group-data-[state=open]:left-small',\n 'group-has-[div[data-slot=date-picker-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small',\n // If has right slot\n 'group-has-[div[data-slot=date-picker-right-slot]]:right-large-4x',\n 'group-has-[div[data-slot=date-picker-right-slot]]:group-data-[state=open]:right-small',\n 'group-has-[div[data-slot=date-picker-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small',\n // Animate\n 'group-data-[state=open]:animate-in',\n 'group-data-[state=closed]:animate-out',\n 'group-has-[input:not(:placeholder-shown)]:animate-out',\n 'data-[disabled=true]:hidden',\n\n className\n )}\n data-disabled={disabled}\n data-error={hasError}\n data-variant={variant}\n weight=\"medium\"\n {...props}\n >\n <label htmlFor={htmlFor}>\n <span\n className={twJoin(\n 'rounded-small-1x max-w-full',\n 'group-data-[variant=outlined]:bg-layer-2-idle',\n 'group-data-[variant=filled]:bg-layer-2-hover'\n )}\n >\n {children}\n </span>\n </label>\n </Typography>\n )\n}\n\nexport function DatePickerLeftSlot({\n className,\n ...props\n}: ComponentProps<'div'>) {\n return (\n <div\n {...props}\n className={twJoin(\n className,\n 'left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'\n )}\n data-slot=\"date-picker-left-slot\"\n />\n )\n}\n\nexport function DatePickerRightSlot({\n className,\n ...props\n}: ComponentProps<'div'>) {\n return (\n <div\n {...props}\n className={twJoin(\n className,\n 'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'\n )}\n data-slot=\"date-picker-right-slot\"\n />\n )\n}\n\nexport function DatePickerCaption({\n className,\n variant = 'body',\n size = 'sm',\n weight = 'normal',\n ...props\n}: ComponentProps<typeof Typography>) {\n const { hasError } = useDatePicker()\n\n const caption = tv({\n base: 'text-size-body-sm mt-small-1x font-normal',\n variants: {\n state: {\n error: 'text-danger-label-active',\n idle: 'text-neutral-dark'\n }\n }\n })\n\n return (\n <Typography\n className={caption({\n state: hasError ? 'error' : 'idle',\n className\n })}\n size={size}\n variant={variant}\n weight={weight}\n {...props}\n />\n )\n}\n"]}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
import { MaskOptions } from '@react-input/mask';
|
|
4
|
-
export { MaskOptions } from '@react-input/mask';
|
|
5
|
-
import { InputNumberFormatProps } from '@react-input/number-format';
|
|
6
|
-
import { Typography } from './typography.js';
|
|
7
|
-
import 'class-variance-authority/types';
|
|
8
|
-
import '@xjur-ui/util';
|
|
9
|
-
|
|
10
|
-
type InputMaskType = 'cpf' | 'cnpj' | 'telefone' | 'cep' | 'numero-processo' | 'custom' | 'data' | 'hora' | 'data-hora';
|
|
11
|
-
declare function inputMask(type: InputMaskType, options?: MaskOptions): MaskOptions;
|
|
12
|
-
|
|
13
|
-
type InputProps = {
|
|
14
|
-
variant?: 'outlined' | 'filled';
|
|
15
|
-
disabled?: boolean;
|
|
16
|
-
hasError?: boolean;
|
|
17
|
-
};
|
|
18
|
-
declare function InputRoot({ className, children, variant, disabled, hasError, ...props }: ComponentProps<'div'> & InputProps): react_jsx_runtime.JSX.Element;
|
|
19
|
-
declare function InputContent({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
20
|
-
declare function InputLabel({ htmlFor, className, children, ...props }: ComponentProps<typeof Typography> & {
|
|
21
|
-
htmlFor: string;
|
|
22
|
-
}): react_jsx_runtime.JSX.Element;
|
|
23
|
-
declare function InputText({ className, maskOptions, maskType, ...props }: ComponentProps<'input'> & {
|
|
24
|
-
maskOptions?: MaskOptions;
|
|
25
|
-
maskType?: InputMaskType;
|
|
26
|
-
}): react_jsx_runtime.JSX.Element;
|
|
27
|
-
declare function InputNumber({ className, locales, ...props }: InputNumberFormatProps): react_jsx_runtime.JSX.Element;
|
|
28
|
-
declare function InputLeftSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
29
|
-
declare function InputRightSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
30
|
-
declare function InputCaption({ className, variant, size, weight, ...props }: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
|
|
31
|
-
declare function InputContainer({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
32
|
-
declare function InputAction({ className, side, ...props }: ComponentProps<'div'> & {
|
|
33
|
-
side: 'left' | 'right';
|
|
34
|
-
}): react_jsx_runtime.JSX.Element;
|
|
35
|
-
declare function InputActionButton({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
36
|
-
|
|
37
|
-
export { InputAction, InputActionButton, InputCaption, InputContainer, InputContent, InputLabel, InputLeftSlot, type InputMaskType, InputNumber, type InputProps, InputRightSlot, InputRoot, InputText, inputMask };
|
package/dist/components/input.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'../chunk-EIG6CBTQ.js';import {twMerge,tv}from'@xjur-ui/util';import {createContext,useMemo,useContext}from'react';import {InputMask}from'@react-input/mask';import {InputNumberFormat}from'@react-input/number-format';import {jsx}from'react/jsx-runtime';function c(e,t){switch(e){case "cpf":return {...t,...h};case "cnpj":return {...t,...f};case "telefone":return {...t,...g};case "cep":return {...t,...x};case "numero-processo":return {...t,...b};case "data":return {...t,...v};case "hora":return {...t,...y};case "data-hora":return {...t,...w};case "custom":if(!t)throw new Error("Options are required for custom mask");return t}}var h={mask:"###.###.###-##",replacement:{"#":/\d/}},f={mask:"##.###.###/####-##",replacement:{"#":/\d/}},g={mask:"(##) #####-####",replacement:{"#":/\d/}},x={mask:"#####-###",replacement:{"#":/\d/}},b={mask:"#######-##.####.#.##.####",replacement:{"#":/\d/}},v={mask:"##/##/####",replacement:{"#":/\d/}},y={mask:"##:##",replacement:{"#":/\d/}},w={mask:"##/##/#### ##:##",replacement:{"#":/\d/}};var p=createContext({variant:"filled",disabled:false,hasError:false});function u(){let e=useContext(p);if(!e)throw new Error("useInput must be used within a InputRoot");return e}function _({className:e,children:t,variant:r="filled",disabled:a=false,hasError:l=false,...s}){let i=useMemo(()=>({variant:r,disabled:a,hasError:l}),[r,a,l]);return jsx(p.Provider,{value:i,children:jsx("div",{className:twMerge("group relative flex w-full flex-col",e),...s,children:t})})}function K({className:e,...t}){let r=tv({base:twMerge("border border-transparent relative h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small flex items-center w-full","group-has-[div[data-slot=input-right-action-slot]]:rounded-r-none","group-has-[div[data-slot=input-left-action-slot]]:rounded-l-none","focus-within:border-primary-idle focus-within:hover:border-primary-idle","hover:border-border-layer-1"),variants:{variant:{filled:"bg-layer-2-hover",outlined:"bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3",disabled:"hover:border-transparent border-none bg-layer-2-idle"},state:{idle:"",error:"focus-within:border-danger-idle hover:border-danger-idle border-danger-idle focus-within:hover:border-danger-idle"}},defaultVariants:{variant:"filled",state:"idle"}});return jsx(p.Consumer,{children:({variant:a,disabled:l,hasError:s})=>jsx("div",{className:r({variant:l?"disabled":a,state:s?"error":"idle",className:e}),...t})})}function z({htmlFor:e,className:t,children:r,...a$1}){return jsx(p.Consumer,{children:({variant:l,disabled:s,hasError:i})=>jsx(a,{asChild:true,className:twMerge("group inline-block max-w-full truncate text-left","ease animate-in left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2 transition-all duration-250","group-focus-within:!text-primary-idle group-focus-within:data-[has-error=true]:!text-danger-label-active group-focus-within:-top-[3px]","group-focus-within:text-size-label-sm-1x group-focus-within:font-medium","group-has-[input:not(:placeholder-shown)]:-top-[3px]","group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x","group-has-[input:not(:placeholder-shown)]:font-medium","group-has-[input:not(:placeholder-shown)]:!text-primary-idle","group-has-[input:not(:placeholder-shown)]:!text-danger-label-active","group-has-[div[data-slot=input-left-slot]]:left-large-4x","group-has-[div[data-slot=input-left-slot]]:group-focus-within:left-small","group-has-[div[data-slot=input-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small","group-has-[div[data-slot=input-right-slot]]:right-large-4x","group-has-[div[data-slot=input-right-slot]]:group-focus-within:right-small","group-has-[div[data-slot=input-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small","group-focus-within:animate-in","group-has-[input:not(:placeholder-shown)]:animate-out","data-[disabled=true]:hidden",t),"data-disabled":s,"data-has-error":i,"data-variant":l,...a$1,children:jsx("label",{htmlFor:e,children:jsx("span",{className:twMerge("rounded-small-1x max-w-full","group-data-[variant=outlined]:group-focus-within:bg-layer-2-idle group-data-[variant=filled]:group-focus-within:bg-layer-2-hover","group-data-[variant=outlined]:bg-layer-2-idle group-data-[variant=filled]:bg-layer-2-hover"),children:r})})})})}function R({className:e,maskOptions:t,maskType:r,...a}){let{disabled:l}=u();return jsx(t||r?InputMask:"input",{...a,disabled:l,...r?{...c(r)}:t&&{...t},className:twMerge(e,"peer !text-size-body-md text-neutral-dark flex-1 outline-none","group-has-[div[data-slot=input-left-slot]]:pl-large-1x ml-small-1x"),placeholder:a.placeholder||" ",...t&&{...t}})}function j({className:e,locales:t="pt-BR",...r}){let{disabled:a}=u();return jsx(InputNumberFormat,{...r,className:twMerge(e,"peer !text-size-body-md text-neutral-dark flex-1 font-medium outline-none","group-has-[div[data-slot=input-left-slot]]:pl-large-1x ml-small-1x"),disabled:a,locales:t,placeholder:r.placeholder||" "})}function B({className:e,...t}){return jsx("div",{...t,className:twMerge(e,"left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center"),"data-slot":"input-left-slot"})}function D({className:e,...t}){return jsx("div",{...t,className:twMerge(e,"right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center"),"data-slot":"input-right-slot"})}function L({className:e,variant:t="body",size:r="sm",weight:a$1="normal",...l}){let{hasError:s}=u(),i=tv({base:"text-size-body-sm mt-small-1x font-normal",variants:{state:{error:"text-danger-label-active",idle:"text-neutral-dark"}}});return jsx(a,{className:i({state:s?"error":"idle",className:e}),size:r,variant:t,weight:a$1,...l})}function V({className:e,...t}){return jsx("div",{...t,className:twMerge(e,"flex items-center"),"data-slot":"input-content"})}function q({className:e,side:t,...r}){let{disabled:a}=u();return jsx("div",{...r,className:twMerge(e,"group h-large-4x flex items-center justify-center data-[disabled=true]:hidden"),"data-disabled":a,"data-side":t,"data-slot":`input-${t}-action-slot`})}function H({className:e,...t}){return jsx("div",{...t,className:twMerge(e,"h-large-4x w-large-4x bg-layer-2-hover flex cursor-pointer items-center justify-center")})}export{q as InputAction,H as InputActionButton,L as InputCaption,V as InputContainer,K as InputContent,z as InputLabel,B as InputLeftSlot,j as InputNumber,D as InputRightSlot,_ as InputRoot,R as InputText,c as inputMask};//# sourceMappingURL=input.js.map
|
|
2
|
-
//# sourceMappingURL=input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/resources/input-mask.ts","../../src/components/input.tsx"],"names":["inputMask","type","options","CPF_MASK","CNPJ_MASK","PHONE_MASK","CEP_MASK","NUMERO_PROCESSO_MASK","DATE_MASK","TIME_MASK","DATETIME_MASK","FieldContext","createContext","useInput","context","useContext","InputRoot","className","children","variant","disabled","hasError","props","providerValue","useMemo","jsx","twMerge","InputContent","content","tv","InputLabel","htmlFor","Typography","InputText","maskOptions","maskType","InputMask","InputNumber","locales","InputNumberFormat","InputLeftSlot","InputRightSlot","InputCaption","size","weight","caption","InputContainer","InputAction","side","InputActionButton"],"mappings":"0QAaO,SAASA,CAAAA,CACdC,CAAAA,CACAC,EACa,CACb,OAAQD,GACN,KAAK,MACH,OAAO,CAAE,GAAGC,CAAAA,CAAS,GAAGC,CAAS,CAAA,CACnC,KAAK,OACH,OAAO,CAAE,GAAGD,CAAAA,CAAS,GAAGE,CAAU,CAAA,CACpC,KAAK,UAAA,CACH,OAAO,CAAE,GAAGF,CAAAA,CAAS,GAAGG,CAAW,CAAA,CACrC,KAAK,KAAA,CACH,OAAO,CAAE,GAAGH,CAAAA,CAAS,GAAGI,CAAS,CAAA,CACnC,KAAK,iBAAA,CACH,OAAO,CAAE,GAAGJ,CAAAA,CAAS,GAAGK,CAAqB,CAAA,CAC/C,KAAK,MAAA,CACH,OAAO,CAAE,GAAGL,CAAAA,CAAS,GAAGM,CAAU,CAAA,CACpC,KAAK,MAAA,CACH,OAAO,CAAE,GAAGN,CAAAA,CAAS,GAAGO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L,KAAA,CAAO,0BAAA,CACP,KAAM,mBACR,CACF,CACF,CAAC,CAAA,CAED,OACEJ,GAAAA,CAACO,CAAAA,CAAA,CACC,SAAA,CAAWa,CAAAA,CAAQ,CACjB,KAAA,CAAOxB,CAAAA,CAAW,QAAU,MAAA,CAC5B,SAAA,CAAAJ,CACF,CAAC,EACD,IAAA,CAAM0B,CAAAA,CACN,QAASxB,CAAAA,CACT,MAAA,CAAQyB,IACP,GAAGtB,CAAAA,CACN,CAEJ,CAEO,SAASwB,EAAe,CAAE,SAAA,CAAA7B,EAAW,GAAGK,CAAM,EAA0B,CAC7E,OACEG,IAAC,KAAA,CAAA,CACE,GAAGH,EACJ,SAAA,CAAWI,OAAAA,CAAQT,EAAW,mBAAmB,CAAA,CACjD,YAAU,eAAA,CACZ,CAEJ,CAEO,SAAS8B,CAAAA,CAAY,CAC1B,SAAA,CAAA9B,CAAAA,CACA,KAAA+B,CAAAA,CACA,GAAG1B,CACL,CAAA,CAEG,CACD,GAAM,CAAE,QAAA,CAAAF,CAAS,CAAA,CAAIP,CAAAA,GACrB,OACEY,GAAAA,CAAC,OACE,GAAGH,CAAAA,CACJ,UAAWI,OAAAA,CACTT,CAAAA,CACA,+EACF,CAAA,CACA,eAAA,CAAeG,EACf,WAAA,CAAW4B,CAAAA,CACX,YAAW,CAAA,MAAA,EAASA,CAAI,eAC1B,CAEJ,CAEO,SAASC,CAAAA,CAAkB,CAChC,UAAAhC,CAAAA,CACA,GAAGK,CACL,CAAA,CAA0B,CACxB,OACEG,GAAAA,CAAC,KAAA,CAAA,CACE,GAAGH,CAAAA,CACJ,SAAA,CAAWI,QACTT,CAAAA,CACA,wFACF,EACF,CAEJ","file":"input.js","sourcesContent":["import type { MaskOptions } from '@react-input/mask'\n\nexport type InputMaskType =\n | 'cpf'\n | 'cnpj'\n | 'telefone'\n | 'cep'\n | 'numero-processo'\n | 'custom'\n | 'data'\n | 'hora'\n | 'data-hora'\n\nexport function inputMask(\n type: InputMaskType,\n options?: MaskOptions\n): MaskOptions {\n switch (type) {\n case 'cpf':\n return { ...options, ...CPF_MASK }\n case 'cnpj':\n return { ...options, ...CNPJ_MASK }\n case 'telefone':\n return { ...options, ...PHONE_MASK }\n case 'cep':\n return { ...options, ...CEP_MASK }\n case 'numero-processo':\n return { ...options, ...NUMERO_PROCESSO_MASK }\n case 'data':\n return { ...options, ...DATE_MASK }\n case 'hora':\n return { ...options, ...TIME_MASK }\n case 'data-hora':\n return { ...options, ...DATETIME_MASK }\n case 'custom':\n if (!options) {\n throw new Error('Options are required for custom mask')\n }\n\n return options\n }\n}\n\nconst CPF_MASK: MaskOptions = {\n mask: '###.###.###-##',\n replacement: {\n '#': /\\d/\n }\n}\nconst CNPJ_MASK: MaskOptions = {\n mask: '##.###.###/####-##',\n replacement: {\n '#': /\\d/\n }\n}\nconst PHONE_MASK: MaskOptions = {\n mask: '(##) #####-####',\n replacement: {\n '#': /\\d/\n }\n}\nconst CEP_MASK: MaskOptions = {\n mask: '#####-###',\n replacement: {\n '#': /\\d/\n }\n}\nconst NUMERO_PROCESSO_MASK: MaskOptions = {\n mask: '#######-##.####.#.##.####',\n replacement: {\n '#': /\\d/\n }\n}\nconst DATE_MASK: MaskOptions = {\n mask: '##/##/####',\n replacement: {\n '#': /\\d/\n }\n}\nconst TIME_MASK: MaskOptions = {\n mask: '##:##',\n replacement: {\n '#': /\\d/\n }\n}\nconst DATETIME_MASK: MaskOptions = {\n mask: '##/##/#### ##:##',\n replacement: {\n '#': /\\d/\n }\n}\n","import { tv, twMerge } from '@xjur-ui/util'\nimport type { ComponentProps } from 'react'\nimport { createContext, useContext, useMemo } from 'react'\nimport { InputMask, type MaskOptions } from '@react-input/mask'\nimport {\n InputNumberFormat,\n type InputNumberFormatProps\n} from '@react-input/number-format'\nimport { inputMask, type InputMaskType } from '../resources/input-mask'\nimport { Typography } from './typography'\n\nexport { inputMask, type InputMaskType, type MaskOptions }\n\nexport type InputProps = {\n variant?: 'outlined' | 'filled'\n disabled?: boolean\n hasError?: boolean\n}\n\nconst FieldContext = createContext<InputProps>({\n variant: 'filled',\n disabled: false,\n hasError: false\n})\n\nfunction useInput() {\n const context = useContext(FieldContext)\n if (!context) {\n throw new Error('useInput must be used within a InputRoot')\n }\n return context\n}\n\nexport function InputRoot({\n className,\n children,\n variant = 'filled',\n disabled = false,\n hasError = false,\n ...props\n}: ComponentProps<'div'> & InputProps) {\n const providerValue = useMemo(\n () => ({ variant, disabled, hasError }),\n [variant, disabled, hasError]\n )\n\n return (\n <FieldContext.Provider value={providerValue}>\n <div\n className={twMerge('group relative flex w-full flex-col', className)}\n {...props}\n >\n {children}\n </div>\n </FieldContext.Provider>\n )\n}\n\nexport function InputContent({ className, ...props }: ComponentProps<'div'>) {\n const content = tv({\n base: twMerge(\n 'border border-transparent relative h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small flex items-center w-full',\n 'group-has-[div[data-slot=input-right-action-slot]]:rounded-r-none',\n 'group-has-[div[data-slot=input-left-action-slot]]:rounded-l-none',\n 'focus-within:border-primary-idle focus-within:hover:border-primary-idle',\n 'hover:border-border-layer-1'\n ),\n variants: {\n variant: {\n filled: 'bg-layer-2-hover',\n outlined:\n 'bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3',\n disabled: 'hover:border-transparent border-none bg-layer-2-idle'\n },\n state: {\n idle: '',\n error:\n 'focus-within:border-danger-idle hover:border-danger-idle border-danger-idle focus-within:hover:border-danger-idle'\n }\n },\n defaultVariants: {\n variant: 'filled',\n state: 'idle'\n }\n })\n\n return (\n <FieldContext.Consumer>\n {({ variant, disabled, hasError }) => {\n return (\n <div\n className={content({\n variant: disabled ? 'disabled' : variant,\n state: hasError ? 'error' : 'idle',\n className\n })}\n {...props}\n />\n )\n }}\n </FieldContext.Consumer>\n )\n}\n\nexport function InputLabel({\n htmlFor,\n className,\n children,\n ...props\n}: ComponentProps<typeof Typography> & { htmlFor: string }) {\n return (\n <FieldContext.Consumer>\n {({ variant, disabled, hasError }) => {\n return (\n <Typography\n asChild={true}\n className={twMerge(\n 'group inline-block max-w-full truncate text-left',\n 'ease animate-in left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2 transition-all duration-250',\n // Filled\n 'group-focus-within:!text-primary-idle group-focus-within:data-[has-error=true]:!text-danger-label-active group-focus-within:-top-[3px]',\n 'group-focus-within:text-size-label-sm-1x group-focus-within:font-medium',\n 'group-has-[input:not(:placeholder-shown)]:-top-[3px]',\n 'group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x',\n 'group-has-[input:not(:placeholder-shown)]:font-medium',\n 'group-has-[input:not(:placeholder-shown)]:!text-primary-idle',\n 'group-has-[input:not(:placeholder-shown)]:!text-danger-label-active',\n // If has left slot\n 'group-has-[div[data-slot=input-left-slot]]:left-large-4x',\n 'group-has-[div[data-slot=input-left-slot]]:group-focus-within:left-small',\n 'group-has-[div[data-slot=input-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small',\n // If has right slot\n 'group-has-[div[data-slot=input-right-slot]]:right-large-4x',\n 'group-has-[div[data-slot=input-right-slot]]:group-focus-within:right-small',\n 'group-has-[div[data-slot=input-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small',\n // Animate\n 'group-focus-within:animate-in',\n 'group-has-[input:not(:placeholder-shown)]:animate-out',\n 'data-[disabled=true]:hidden',\n className\n )}\n data-disabled={disabled}\n data-has-error={hasError}\n data-variant={variant}\n {...props}\n >\n <label htmlFor={htmlFor}>\n <span\n className={twMerge(\n 'rounded-small-1x max-w-full',\n 'group-data-[variant=outlined]:group-focus-within:bg-layer-2-idle group-data-[variant=filled]:group-focus-within:bg-layer-2-hover',\n 'group-data-[variant=outlined]:bg-layer-2-idle group-data-[variant=filled]:bg-layer-2-hover'\n )}\n >\n {children}\n </span>\n </label>\n </Typography>\n )\n }}\n </FieldContext.Consumer>\n )\n}\n\nexport function InputText({\n className,\n maskOptions,\n maskType,\n ...props\n}: ComponentProps<'input'> & {\n maskOptions?: MaskOptions\n maskType?: InputMaskType\n}) {\n const { disabled } = useInput()\n const Component = maskOptions || maskType ? InputMask : 'input'\n\n return (\n <Component\n {...props}\n disabled={disabled}\n {...(maskType\n ? { ...inputMask(maskType) }\n : maskOptions && { ...maskOptions })}\n className={twMerge(\n className,\n 'peer !text-size-body-md text-neutral-dark flex-1 outline-none',\n 'group-has-[div[data-slot=input-left-slot]]:pl-large-1x ml-small-1x'\n )}\n placeholder={props.placeholder || ' '}\n {...(maskOptions && { ...maskOptions })}\n />\n )\n}\n\nexport function InputNumber({\n className,\n locales = 'pt-BR',\n ...props\n}: InputNumberFormatProps) {\n const { disabled } = useInput()\n return (\n <InputNumberFormat\n {...props}\n className={twMerge(\n className,\n 'peer !text-size-body-md text-neutral-dark flex-1 font-medium outline-none',\n 'group-has-[div[data-slot=input-left-slot]]:pl-large-1x ml-small-1x'\n )}\n disabled={disabled}\n locales={locales}\n placeholder={props.placeholder || ' '}\n />\n )\n}\n\nexport function InputLeftSlot({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n {...props}\n className={twMerge(\n className,\n 'left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'\n )}\n data-slot=\"input-left-slot\"\n />\n )\n}\n\nexport function InputRightSlot({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n {...props}\n className={twMerge(\n className,\n 'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'\n )}\n data-slot=\"input-right-slot\"\n />\n )\n}\n\nexport function InputCaption({\n className,\n variant = 'body',\n size = 'sm',\n weight = 'normal',\n ...props\n}: ComponentProps<typeof Typography>) {\n const { hasError } = useInput()\n\n const caption = tv({\n base: 'text-size-body-sm mt-small-1x font-normal',\n variants: {\n state: {\n error: 'text-danger-label-active',\n idle: 'text-neutral-dark'\n }\n }\n })\n\n return (\n <Typography\n className={caption({\n state: hasError ? 'error' : 'idle',\n className\n })}\n size={size}\n variant={variant}\n weight={weight}\n {...props}\n />\n )\n}\n\nexport function InputContainer({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n {...props}\n className={twMerge(className, 'flex items-center')}\n data-slot=\"input-content\"\n />\n )\n}\n\nexport function InputAction({\n className,\n side,\n ...props\n}: ComponentProps<'div'> & {\n side: 'left' | 'right'\n}) {\n const { disabled } = useInput()\n return (\n <div\n {...props}\n className={twMerge(\n className,\n 'group h-large-4x flex items-center justify-center data-[disabled=true]:hidden'\n )}\n data-disabled={disabled}\n data-side={side}\n data-slot={`input-${side}-action-slot`}\n />\n )\n}\n\nexport function InputActionButton({\n className,\n ...props\n}: ComponentProps<'div'>) {\n return (\n <div\n {...props}\n className={twMerge(\n className,\n 'h-large-4x w-large-4x bg-layer-2-hover flex cursor-pointer items-center justify-center'\n )}\n />\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/otp-input.tsx"],"names":["Root","children","className","props","jsx","cx","Input","HiddenInput","OTPInput"],"mappings":"6HAGA,SAASA,EAAK,CACZ,QAAA,CAAAC,EACA,SAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAA+C,CAC7C,OACEC,IAAkB,CAAA,CAAA,IAAA,CAAjB,CACC,SAAA,CAAWC,EAAAA,CAAGH,EAAW,mCAAmC,CAAA,CAC3D,GAAGC,CAAAA,CAEH,SAAAF,CAAAA,CACH,CAEJ,CAEA,SAASK,CAAAA,CAAM,CACb,SAAA,CAAAJ,CAAAA,CACA,GAAGC,CACL,EAAoD,CAClD,OACEC,GAAAA,CAAkB,CAAA,CAAA,KAAA,CAAjB,CACC,SAAA,CAAWC,EAAAA,CACTH,CAAAA,CACA,6FAAA,CACA,sDACF,CAAA,CACC,GAAGC,EACN,CAEJ,CAEA,SAASI,CAAAA,CAAY,CACnB,GAAGJ,CACL,EAA0D,CACxD,OAAOC,IAAkB,CAAA,CAAA,WAAA,CAAjB,CAA8B,GAAGD,CAAAA,CAAO,CAClD,CAEO,IAAMK,EAAW,CACtB,IAAA,CAAAR,EACA,KAAA,CAAAM,CAAAA,CACA,YAAAC,CACF","file":"otp-input.js","sourcesContent":["import * as OTPPasswordField from '@radix-ui/react-one-time-password-field'\nimport { cx } from '@xjur-ui/util'\n\nfunction Root({\n children,\n className,\n ...props\n}: OTPPasswordField.OneTimePasswordFieldProps) {\n return (\n <OTPPasswordField.Root\n className={cx(className, 'group gap-small flex items-center')}\n {...props}\n >\n {children}\n </OTPPasswordField.Root>\n )\n}\n\nfunction Input({\n className,\n ...props\n}: OTPPasswordField.OneTimePasswordFieldInputProps) {\n return (\n <OTPPasswordField.Input\n className={cx(\n className,\n 'text-neutral-dark h-large-6x bg-layer-2-hover rounded-small-1x w-full text-center outline-0',\n 'focus-within:border-primary-idle focus-within:border'\n )}\n {...props}\n />\n )\n}\n\nfunction HiddenInput({\n ...props\n}: OTPPasswordField.OneTimePasswordFieldHiddenInputProps) {\n return <OTPPasswordField.HiddenInput {...props} />\n}\n\nexport const OTPInput = {\n Root,\n Input,\n HiddenInput\n}\n"]}
|
package/dist/components/radio.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a}from'../chunk-EIG6CBTQ.js';import'react';import*as r from'@radix-ui/react-radio-group';import {cx}from'@xjur-ui/util';import {jsx,jsxs}from'react/jsx-runtime';function u({className:i,orientation:o="vertical",...a}){return jsx(r.Root,{className:cx("gap-small flex data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col",i),"data-orientation":o,"data-slot":"radio-group",...a})}function b({className:i,id:o,label:a$1,disabled:t=false,...s}){return jsxs("div",{className:"gap-small flex items-center",children:[jsx(r.Item,{className:cx("size-large-alt rounded-circle inline-flex items-center justify-center transition-[border-color,box-shadow,background-color] duration-200 outline-none","border-border-layer-2 bg-layer-2-idle cursor-pointer border-2","hover:border-primary-idle focus:border-primary-idle focus:shadow-focus-primary","data-[state=checked]:bg-primary-active data-[state=checked]:border-primary-active","data-[state=checked]:hover:border-primary-idle","disabled:hover:border-border-layer-2 disabled:cursor-not-allowed disabled:opacity-[38%]",i),"data-slot":"radio-group-item",disabled:t,id:o,...s,children:jsx(r.Indicator,{className:"relative flex items-center justify-center","data-slot":"radio-group-indicator"})}),!!a$1&&jsx(a,{asChild:true,className:"text-size-body-sm data-[disabled=true]:opacity-38","data-disabled":t,weight:"medium",children:jsx("label",{htmlFor:o,children:a$1})})]})}export{u as RadioGroup,b as RadioItem};//# sourceMappingURL=radio.js.map
|
|
2
|
-
//# sourceMappingURL=radio.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/radio.tsx"],"names":["RadioGroup","className","orientation","props","jsx","cx","RadioItem","id","label","disabled","jsxs","Typography"],"mappings":"yKAKO,SAASA,CAAAA,CAAW,CACzB,SAAA,CAAAC,CAAAA,CACA,WAAA,CAAAC,CAAAA,CAAc,UAAA,CACd,GAAGC,CACL,CAAA,CAA0D,CACxD,OACEC,GAAAA,CAAqB,CAAA,CAAA,IAAA,CAApB,CACC,SAAA,CAAWC,EAAAA,CACT,4FAAA,CACAJ,CACF,CAAA,CACA,kBAAA,CAAkBC,CAAAA,CAClB,WAAA,CAAU,aAAA,CACT,GAAGC,CAAAA,CACN,CAEJ,CAEO,SAASG,CAAAA,CAAU,CACxB,SAAA,CAAAL,CAAAA,CACA,EAAA,CAAAM,CAAAA,CACA,KAAA,CAAAC,GAAAA,CACA,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,GAAGN,CACL,CAAA,CAEG,CACD,OACEO,KAAC,KAAA,CAAA,CAAI,SAAA,CAAU,6BAAA,CACb,QAAA,CAAA,CAAAN,GAAAA,CAAqB,CAAA,CAAA,IAAA,CAApB,CACC,SAAA,CAAWC,EAAAA,CAET,uJAAA,CAEA,+DAAA,CAEA,gFAAA,CAEA,mFAAA,CAEA,gDAAA,CAEA,0FACAJ,CACF,CAAA,CACA,WAAA,CAAU,kBAAA,CACV,QAAA,CAAUQ,CAAAA,CACV,EAAA,CAAIF,CAAAA,CACH,GAAGJ,CAAAA,CAEJ,QAAA,CAAAC,GAAAA,CAAqB,CAAA,CAAA,SAAA,CAApB,CACC,UAAU,2CAAA,CACV,WAAA,CAAU,uBAAA,CACZ,CAAA,CACF,CAAA,CAEC,CAAC,CAACI,GAAAA,EACDJ,GAAAA,CAACO,CAAAA,CAAA,CACC,OAAA,CAAS,IAAA,CACT,SAAA,CAAU,mDAAA,CACV,eAAA,CAAeF,CAAAA,CACf,MAAA,CAAO,QAAA,CAEP,QAAA,CAAAL,GAAAA,CAAC,OAAA,CAAA,CAAM,OAAA,CAASG,CAAAA,CAAK,QAAA,CAAAC,GAAAA,CAAM,CAAA,CAC7B,CAAA,CAAA,CAEJ,CAEJ","file":"radio.js","sourcesContent":["import * as React from 'react'\nimport * as RadioGroupPrimitive from '@radix-ui/react-radio-group'\nimport { cx } from '@xjur-ui/util'\nimport { Typography } from './typography'\n\nexport function RadioGroup({\n className,\n orientation = 'vertical',\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {\n return (\n <RadioGroupPrimitive.Root\n className={cx(\n 'gap-small flex data-[orientation=horizontal]:flex-row data-[orientation=vertical]:flex-col',\n className\n )}\n data-orientation={orientation}\n data-slot=\"radio-group\"\n {...props}\n />\n )\n}\n\nexport function RadioItem({\n className,\n id,\n label,\n disabled = false,\n ...props\n}: React.ComponentProps<typeof RadioGroupPrimitive.Item> & {\n label?: string\n}) {\n return (\n <div className=\"gap-small flex items-center\">\n <RadioGroupPrimitive.Item\n className={cx(\n // layout\n 'size-large-alt rounded-circle inline-flex items-center justify-center transition-[border-color,box-shadow,background-color] duration-200 outline-none',\n // base\n 'border-border-layer-2 bg-layer-2-idle cursor-pointer border-2',\n // hover/focus (desmarcado)\n 'hover:border-primary-idle focus:border-primary-idle focus:shadow-focus-primary',\n // estado checked\n 'data-[state=checked]:bg-primary-active data-[state=checked]:border-primary-active',\n // hover quando estiver checked (opcional)\n 'data-[state=checked]:hover:border-primary-idle',\n // disabled\n 'disabled:hover:border-border-layer-2 disabled:cursor-not-allowed disabled:opacity-[38%]',\n className\n )}\n data-slot=\"radio-group-item\"\n disabled={disabled}\n id={id}\n {...props}\n >\n <RadioGroupPrimitive.Indicator\n className=\"relative flex items-center justify-center\"\n data-slot=\"radio-group-indicator\"\n />\n </RadioGroupPrimitive.Item>\n\n {!!label && (\n <Typography\n asChild={true}\n className=\"text-size-body-sm data-[disabled=true]:opacity-38\"\n data-disabled={disabled}\n weight=\"medium\"\n >\n <label htmlFor={id}>{label}</label>\n </Typography>\n )}\n </div>\n )\n}\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {b as b$1,c as c$1,d}from'../chunk-NELCN6E2.js';import {a}from'../chunk-KS6WGBHQ.js';import {a as a$2,c as c$2,d as d$1,e,h,i}from'../chunk-RWMV7APX.js';import'../chunk-CBFC4QME.js';import'../chunk-KIFR5VIE.js';import {b}from'../chunk-FASEHVMD.js';import {a as a$1}from'../chunk-EIG6CBTQ.js';import {b as b$2}from'../chunk-SHHXKVVR.js';import {cx}from'@xjur-ui/util';import {useMemo,useCallback,useState}from'react';import {useEditor,EditorContext,useCurrentEditor,EditorContent,useEditorState}from'@tiptap/react';export{useCurrentEditor as useRichTextEditor,useEditorState as useRichTextEditorState}from'@tiptap/react';import {StarterKit}from'@tiptap/starter-kit';import {Heading}from'@tiptap/extension-heading';import {Placeholder}from'@tiptap/extension-placeholder';import {jsx,jsxs}from'react/jsx-runtime';var c={1:"text-size-body-md",2:"text-size-title-lg",3:"text-size-headline-lg"};function X({className:t,editorOptions:n,...r}){let i=useEditor({...n,extensions:[StarterKit.configure({bulletList:{HTMLAttributes:{class:"list-disc list-outside pl-large-1x"}},orderedList:{HTMLAttributes:{class:"list-decimal list-outside pl-large-1x"}},heading:false}),Placeholder.configure({placeholder:({node:o,editor:s})=>o.type.name==="paragraph"&&s.isEmpty?"Digite aqui\u2026":"",showOnlyWhenEditable:true,includeChildren:false,emptyNodeClass:"before:content-[attr(data-placeholder)] before:absolute before:top-0 before:left-0 before:text-neutral-placeholder first:before:float-left first:before:content-[attr(data-placeholder)] first:before:pointer-events-none"}),Heading.configure({levels:[1,2,3]}).extend({renderHTML({node:o,HTMLAttributes:s}){let u=o.attrs.level??1;return ["h",{...s,class:c[u]},0]}}),...n?.extensions??[]]}),a=useMemo(()=>({editor:i}),[i]);return jsx(EditorContext.Provider,{value:a,children:jsx("div",{className:cx("gap-small flex w-full flex-col",t),"data-slot":"text-area-root",...r})})}function j({className:t,...n}){return jsx("div",{className:cx("bg-layer-2-hover py-small_1x-alt px-small rounded-small-1x min-h-[116px] w-full border border-transparent","hover:border-border-layer-2 transition-colors duration-200","[&_ul_ul]:list-[circle]","[&_ul_ul_ul]:list-[square]","[&_ol_ol]:list-[lower-alpha]","[&_ol_ol_ol]:list-[lower-roman]","gap-small flex flex-col overflow-x-hidden overflow-y-auto",t),"data-slot":"text-area-content",...n})}function ee({className:t,...n}){return jsx("p",{...n,className:cx("text-size-body-sm text-neutral-dark font-normal",t),"data-slot":"text-area-caption"})}function te({className:t,...n}){let{editor:r}=useCurrentEditor();return jsx(EditorContent,{className:cx("text-size-body-md text-neutral-dark max-h-[116px] *:h-full *:w-full *:outline-0",t),editor:r,...n})}function oe({className:t,...n}){return jsx("div",{className:cx("h-large-4x gap-small-1x h-large-6px scrollbar-hide flex flex-nowrap items-center overflow-x-auto overflow-y-hidden",t),"data-slot":"text-area-toolbar",...n})}function $({appearance:t="ghost",variant:n="secondary",onMouseDown:r,onPointerDown:i,...a}){return jsx(b,{appearance:t,size:"icon_md",tabIndex:-1,type:"button",variant:n,onMouseDown:o=>{o.preventDefault(),r?.(o);},onPointerDown:o=>{o.preventDefault(),i?.(o);},...a})}function re({name:t,...n}){let{editor:r}=useCurrentEditor(),{shortcut:i}=a(),a$2=useEditorState({editor:r,selector:d=>d.editor?.isActive(t)??false}),o=useMemo(()=>new Map([["bold","format_bold"],["italic","format_italic"],["underline","format_underlined"],["strike","format_strikethrough"],["bulletList","format_list_bulleted"],["orderedList","format_list_numbered"],["undo","undo"],["redo","redo"]]).get(t),[t]),s=useMemo(()=>new Map([["bold",`Negrito (${i} + B)`],["italic",`It\xE1lico (${i} + I)`],["underline",`Sublinhado (${i} + U)`],["strike",`Tachado (${i} + S)`],["bulletList",`Lista (${i} + Shift + 7)`],["orderedList",`Lista numerada (${i} + Shift + 8)`],["undo",`Desfazer (${i} + Z)`],["redo",`Refazer (${i} + Y)`]]).get(t),[t,i]),u=useCallback(()=>{if(!r)throw new Error("Editor not found");new Map([["bold",()=>r.chain().focus().toggleBold().run()],["italic",()=>r.chain().focus().toggleItalic().run()],["underline",()=>r.chain().focus().toggleUnderline().run()],["strike",()=>r.chain().focus().toggleStrike().run()],["bulletList",()=>r.chain().focus().toggleBulletList().run()],["orderedList",()=>r.chain().focus().toggleOrderedList().run()],["undo",()=>r.chain().focus().undo().run()],["redo",()=>r.chain().focus().redo().run()]]).get(t)?.();},[r,t]);return jsxs(b$1,{children:[jsx(c$1,{asChild:true,children:jsx($,{onClick:u,...a$2&&{appearance:"solid"},...n,children:o&&jsx(b$2,{className:"text-icon-neutral-3",name:o})})}),jsx(d,{children:s&&jsx(a$1,{size:"sm",children:s})})]})}function ne({appearance:t="ghost",variant:n="secondary",...r}){let[i$1,a]=useState(false),{editor:o}=useCurrentEditor(),s=useEditorState({editor:o,selector:l=>l.editor?.isActive("heading")??false}),u=useCallback(l=>{if(!o)throw new Error("Editor not found");return o.isActive("heading",{level:l})},[o]),d$2=useCallback(l=>{if(!o)throw new Error("Editor not found");a(false),setTimeout(()=>{o.chain().focus().toggleHeading({level:l}).run();},0);},[o]),P=[{level:1,label:"Normal",className:c[1]},{level:2,label:"Grande",className:c[2]},{level:3,label:"Enorme",className:c[3]}];return jsxs(a$2,{open:i$1,onOpenChange:l=>a(l),children:[jsx(c$2,{asChild:true,children:jsx(b,{appearance:s?"solid":t,size:"icon_md",tabIndex:-1,type:"button",variant:n,...r,children:jsxs(b$1,{children:[jsx(c$1,{asChild:true,children:jsx(b$2,{className:"text-icon-neutral-3",name:"format_size"})}),jsx(d,{children:jsx(a$1,{size:"sm",children:"Tamanho"})})]})})}),jsx(d$1,{children:jsx(e,{children:P.map(l=>jsx(h,{isActive:u(l.level),onPointerDown:()=>d$2(l.level),children:jsx(i,{className:l.className,children:l.label})},l.level))})})]})}export{ne as HeadingButton,te as RichEditorAreaText,ee as RichEditorCaption,j as RichEditorContent,X as RichEditorRoot,oe as RichEditorToolbar,re as ToggleButton,$ as ToolbarButton};//# sourceMappingURL=rich-editor.js.map
|
|
2
|
-
//# sourceMappingURL=rich-editor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/rich-editor.tsx"],"names":["headingClasses","RichEditorRoot","className","editorOptions","props","editor","useEditor","StarterKit","Placeholder","node","Heading","HTMLAttributes","level","value","useMemo","jsx","EditorContext","cx","RichEditorContent","RichEditorCaption","RichEditorAreaText","useRichTextEditor","EditorContent","RichEditorToolbar","ToolbarButton","appearance","variant","onMouseDown","onPointerDown","Button","e","ToggleButton","name","shortcut","useOS","isActive","useRichTextEditorState","ctx","icon","description","handleToggle","useCallback","jsxs","Tooltip","TooltipTrigger","Icon","TooltipContent","Typography","HeadingButton","isOpen","setIsOpen","useState","isLevelActive","toggleHeading","levels","DropdownMenuRoot","open","DropdownMenuTrigger","DropdownMenuContent","DropdownMenuList","DropdownMenuItem","DropdownMenuItemText"],"mappings":"izBA6BA,IAAMA,CAAAA,CAAiD,CACrD,CAAA,CAAG,mBAAA,CACH,CAAA,CAAG,oBAAA,CACH,CAAA,CAAG,uBACL,CAAA,CAEO,SAASC,CAAAA,CAAe,CAC7B,SAAA,CAAAC,CAAAA,CACA,aAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAMG,CACD,IAAMC,CAAAA,CAASC,SAAAA,CAAU,CACvB,GAAGH,CAAAA,CACH,UAAA,CAAY,CACVI,UAAAA,CAAW,SAAA,CAAU,CACnB,UAAA,CAAY,CACV,cAAA,CAAgB,CACd,KAAA,CAAO,oCACT,CACF,CAAA,CAC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AAC8C,CAAAA,CAAA,CAAqB,UAAWjD,CAAAA,CAAM,SAAA,CACpC,QAAA,CAAAA,CAAAA,CAAM,KAAA,CACT,CAAA,CAAA,CALKA,CAAAA,CAAM,KAMb,CACD,CAAA,CACH,CAAA,CACF,CAAA,CAAA,CACF,CAEJ","file":"rich-editor.js","sourcesContent":["import { cx } from '@xjur-ui/util'\nimport { useCallback, useMemo, useState, type ComponentProps } from 'react'\nimport {\n EditorContent,\n EditorContext,\n useCurrentEditor as useRichTextEditor,\n useEditorState as useRichTextEditorState,\n useEditor,\n type EditorOptions\n} from '@tiptap/react'\nimport type { Extension } from '@tiptap/core'\nimport { StarterKit } from '@tiptap/starter-kit'\nimport { Heading, type Level } from '@tiptap/extension-heading'\n// Import specific extension instead of full extensions bundle\nimport { Placeholder } from '@tiptap/extension-placeholder'\nimport { useOS } from '../hooks'\nimport { Icon, type IconType } from './icon'\nimport { Button, type ButtonProps } from './button'\nimport {\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuItemText,\n DropdownMenuList,\n DropdownMenuRoot,\n DropdownMenuTrigger\n} from './dropdown-menu'\nimport { Tooltip, TooltipTrigger, TooltipContent } from './tooltip'\nimport { Typography } from './typography'\n\nconst headingClasses: Partial<Record<Level, string>> = {\n 1: 'text-size-body-md',\n 2: 'text-size-title-lg',\n 3: 'text-size-headline-lg'\n}\n\nexport function RichEditorRoot({\n className,\n editorOptions,\n ...props\n}: ComponentProps<'div'> & {\n editorOptions?: Partial<\n Omit<EditorOptions, 'extensions'> & {\n extensions?: Extension[]\n }\n >\n}) {\n const editor = useEditor({\n ...editorOptions,\n extensions: [\n StarterKit.configure({\n bulletList: {\n HTMLAttributes: {\n class: 'list-disc list-outside pl-large-1x'\n }\n },\n orderedList: {\n HTMLAttributes: {\n class: 'list-decimal list-outside pl-large-1x'\n }\n },\n heading: false\n }),\n Placeholder.configure({\n placeholder: ({ node, editor }) =>\n node.type.name === 'paragraph' && editor.isEmpty\n ? 'Digite aqui…'\n : '',\n showOnlyWhenEditable: true,\n includeChildren: false,\n emptyNodeClass:\n 'before:content-[attr(data-placeholder)] before:absolute before:top-0 before:left-0 before:text-neutral-placeholder first:before:float-left first:before:content-[attr(data-placeholder)] first:before:pointer-events-none'\n }),\n Heading.configure({\n levels: [1, 2, 3]\n }).extend({\n renderHTML({ node, HTMLAttributes }) {\n const level: Level = node.attrs.level ?? 1\n\n return [\n 'h',\n {\n ...HTMLAttributes,\n class: headingClasses[level]\n },\n 0\n ]\n }\n }),\n ...(editorOptions?.extensions ?? [])\n ]\n })\n\n const value = useMemo(() => ({ editor }), [editor])\n\n return (\n <EditorContext.Provider value={value}>\n <div\n className={cx('gap-small flex w-full flex-col', className)}\n data-slot=\"text-area-root\"\n {...props}\n />\n </EditorContext.Provider>\n )\n}\n\nexport function RichEditorContent({\n className,\n ...props\n}: ComponentProps<'div'>) {\n return (\n <div\n className={cx(\n 'bg-layer-2-hover py-small_1x-alt px-small rounded-small-1x min-h-[116px] w-full border border-transparent',\n 'hover:border-border-layer-2 transition-colors duration-200',\n '[&_ul_ul]:list-[circle]',\n '[&_ul_ul_ul]:list-[square]',\n '[&_ol_ol]:list-[lower-alpha]',\n '[&_ol_ol_ol]:list-[lower-roman]',\n 'gap-small flex flex-col overflow-x-hidden overflow-y-auto',\n className\n )}\n data-slot=\"text-area-content\"\n {...props}\n />\n )\n}\n\nexport function RichEditorCaption({\n className,\n ...props\n}: ComponentProps<'p'>) {\n return (\n <p\n {...props}\n className={cx(\n 'text-size-body-sm text-neutral-dark font-normal',\n className\n )}\n data-slot=\"text-area-caption\"\n />\n )\n}\n\nexport function RichEditorAreaText({\n className,\n ...props\n}: Omit<ComponentProps<typeof EditorContent>, 'editor'>) {\n const { editor } = useRichTextEditor()\n\n return (\n <EditorContent\n className={cx(\n 'text-size-body-md text-neutral-dark max-h-[116px] *:h-full *:w-full *:outline-0',\n className\n )}\n editor={editor}\n {...props}\n />\n )\n}\n\nexport function RichEditorToolbar({\n className,\n ...props\n}: ComponentProps<'div'>) {\n return (\n <div\n className={cx(\n 'h-large-4x gap-small-1x h-large-6px scrollbar-hide flex flex-nowrap items-center overflow-x-auto overflow-y-hidden',\n className\n )}\n data-slot=\"text-area-toolbar\"\n {...props}\n />\n )\n}\n\nexport function ToolbarButton({\n appearance = 'ghost',\n variant = 'secondary',\n onMouseDown,\n onPointerDown,\n ...props\n}: ButtonProps) {\n return (\n <Button\n appearance={appearance}\n size=\"icon_md\"\n tabIndex={-1}\n type=\"button\"\n variant={variant}\n onMouseDown={e => {\n e.preventDefault()\n onMouseDown?.(e)\n }}\n onPointerDown={e => {\n e.preventDefault()\n onPointerDown?.(e)\n }}\n {...props}\n />\n )\n}\n\ntype ToggleButtonName =\n | 'bold'\n | 'italic'\n | 'underline'\n | 'strike'\n | 'bulletList'\n | 'orderedList'\n | 'undo'\n | 'redo'\n\nexport function ToggleButton({\n name,\n ...props\n}: ButtonProps & { name: ToggleButtonName }) {\n const { editor } = useRichTextEditor()\n const { shortcut } = useOS()\n\n const isActive = useRichTextEditorState({\n editor,\n selector: ctx => ctx.editor?.isActive(name) ?? false\n })\n\n const icon = useMemo(() => {\n const iconsMap = new Map<ToggleButtonName, IconType>([\n ['bold', 'format_bold'],\n ['italic', 'format_italic'],\n ['underline', 'format_underlined'],\n ['strike', 'format_strikethrough'],\n ['bulletList', 'format_list_bulleted'],\n ['orderedList', 'format_list_numbered'],\n ['undo', 'undo'],\n ['redo', 'redo']\n ])\n\n return iconsMap.get(name)\n }, [name])\n\n const description = useMemo(() => {\n const descriptionsMap = new Map<ToggleButtonName, string>([\n ['bold', `Negrito (${shortcut} + B)`],\n ['italic', `Itálico (${shortcut} + I)`],\n ['underline', `Sublinhado (${shortcut} + U)`],\n ['strike', `Tachado (${shortcut} + S)`],\n ['bulletList', `Lista (${shortcut} + Shift + 7)`],\n ['orderedList', `Lista numerada (${shortcut} + Shift + 8)`],\n ['undo', `Desfazer (${shortcut} + Z)`],\n ['redo', `Refazer (${shortcut} + Y)`]\n ])\n\n return descriptionsMap.get(name)\n }, [name, shortcut])\n\n const handleToggle = useCallback(() => {\n if (!editor) throw new Error('Editor not found')\n\n const commandsMap = new Map<ToggleButtonName, () => void>([\n ['bold', () => editor.chain().focus().toggleBold().run()],\n ['italic', () => editor.chain().focus().toggleItalic().run()],\n ['underline', () => editor.chain().focus().toggleUnderline().run()],\n ['strike', () => editor.chain().focus().toggleStrike().run()],\n ['bulletList', () => editor.chain().focus().toggleBulletList().run()],\n ['orderedList', () => editor.chain().focus().toggleOrderedList().run()],\n ['undo', () => editor.chain().focus().undo().run()],\n ['redo', () => editor.chain().focus().redo().run()]\n ])\n\n commandsMap.get(name)?.()\n }, [editor, name])\n\n return (\n <Tooltip>\n <TooltipTrigger asChild={true}>\n <ToolbarButton\n onClick={handleToggle}\n {...(isActive && { appearance: 'solid' })}\n {...props}\n >\n {icon && <Icon className=\"text-icon-neutral-3\" name={icon} />}\n </ToolbarButton>\n </TooltipTrigger>\n\n <TooltipContent>\n {description && <Typography size=\"sm\">{description}</Typography>}\n </TooltipContent>\n </Tooltip>\n )\n}\n\nexport function HeadingButton({\n appearance = 'ghost',\n variant = 'secondary',\n ...props\n}: ButtonProps) {\n const [isOpen, setIsOpen] = useState(false)\n const { editor } = useRichTextEditor()\n\n const isActive = useRichTextEditorState({\n editor,\n selector: ctx => ctx.editor?.isActive('heading') ?? false\n })\n\n const isLevelActive = useCallback(\n (level: Level) => {\n if (!editor) throw new Error('Editor not found')\n return editor.isActive('heading', { level })\n },\n [editor]\n )\n\n const toggleHeading = useCallback(\n (level: Level) => {\n if (!editor) throw new Error('Editor not found')\n setIsOpen(false)\n setTimeout(() => {\n editor.chain().focus().toggleHeading({ level }).run()\n }, 0)\n },\n [editor]\n )\n\n const levels: { level: Level; label: string; className?: string }[] = [\n { level: 1, label: 'Normal', className: headingClasses[1] },\n { level: 2, label: 'Grande', className: headingClasses[2] },\n { level: 3, label: 'Enorme', className: headingClasses[3] }\n ]\n\n return (\n <DropdownMenuRoot open={isOpen} onOpenChange={open => setIsOpen(open)}>\n <DropdownMenuTrigger asChild={true}>\n <Button\n appearance={isActive ? 'solid' : appearance}\n size=\"icon_md\"\n tabIndex={-1}\n type=\"button\"\n variant={variant}\n {...props}\n >\n <Tooltip>\n <TooltipTrigger asChild={true}>\n <Icon className=\"text-icon-neutral-3\" name=\"format_size\" />\n </TooltipTrigger>\n\n <TooltipContent>\n <Typography size=\"sm\">Tamanho</Typography>\n </TooltipContent>\n </Tooltip>\n </Button>\n </DropdownMenuTrigger>\n <DropdownMenuContent>\n <DropdownMenuList>\n {levels.map(level => (\n <DropdownMenuItem\n isActive={isLevelActive(level.level)}\n key={level.level}\n onPointerDown={() => toggleHeading(level.level)}\n >\n <DropdownMenuItemText className={level.className}>\n {level.label}\n </DropdownMenuItemText>\n </DropdownMenuItem>\n ))}\n </DropdownMenuList>\n </DropdownMenuContent>\n </DropdownMenuRoot>\n )\n}\n\nexport { useRichTextEditorState, useRichTextEditor }\n"]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
export{f as SearchInputAction,b as SearchInputContent,c as SearchInputLabel,a as SearchInputRoot,e as SearchInputSlot,d as SearchInputText}from'../chunk-NPTLORW5.js';import'../chunk-FASEHVMD.js';import'../chunk-EIG6CBTQ.js';//# sourceMappingURL=search-input.js.map
|
|
2
|
-
//# sourceMappingURL=search-input.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"search-input.js"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ComponentProps } from 'react';
|
|
3
|
-
import * as RadixPopover from '@radix-ui/react-popover';
|
|
4
|
-
import { ListContent, ListItem, ListHeader, ListHeaderTitle } from './list.js';
|
|
5
|
-
import { SearchInputText } from './search-input.js';
|
|
6
|
-
import { TypographyProps, Typography } from './typography.js';
|
|
7
|
-
import 'class-variance-authority/types';
|
|
8
|
-
import '@xjur-ui/util';
|
|
9
|
-
import './button.js';
|
|
10
|
-
|
|
11
|
-
declare function SelectRoot({ disabled, hasError, ...props }: ComponentProps<typeof RadixPopover.Root> & {
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
hasError?: boolean;
|
|
14
|
-
}): react_jsx_runtime.JSX.Element;
|
|
15
|
-
declare function SelectTrigger({ className, ...props }: ComponentProps<typeof RadixPopover.Trigger>): react_jsx_runtime.JSX.Element;
|
|
16
|
-
declare function SelectContent({ className, children, sideOffset, side, align, ...props }: ComponentProps<typeof RadixPopover.Content>): react_jsx_runtime.JSX.Element;
|
|
17
|
-
declare function SelectValue({ className, displayValue, ...props }: ComponentProps<'input'> & {
|
|
18
|
-
displayValue?: string;
|
|
19
|
-
}): react_jsx_runtime.JSX.Element;
|
|
20
|
-
declare function SelectMultiValue({ className, values, children, ...props }: ComponentProps<'div'> & {
|
|
21
|
-
values: string[];
|
|
22
|
-
}): react_jsx_runtime.JSX.Element;
|
|
23
|
-
declare function SelectLabel({ className, htmlFor, children, ...props }: TypographyProps & {
|
|
24
|
-
htmlFor?: string;
|
|
25
|
-
}): react_jsx_runtime.JSX.Element;
|
|
26
|
-
declare function SelectOptions(props: ComponentProps<typeof ListContent>): react_jsx_runtime.JSX.Element;
|
|
27
|
-
declare function SelectOption({ className, ...props }: ComponentProps<typeof ListItem>): react_jsx_runtime.JSX.Element;
|
|
28
|
-
declare function SelectOptionText(props: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
|
|
29
|
-
declare function SelectHeader(props: ComponentProps<typeof ListHeader>): react_jsx_runtime.JSX.Element;
|
|
30
|
-
declare function SelectHeaderTitle(props: ComponentProps<typeof ListHeaderTitle>): react_jsx_runtime.JSX.Element;
|
|
31
|
-
declare function SelectLeftSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
32
|
-
declare function SelectRightSlot({ className, ...props }: ComponentProps<'div'>): react_jsx_runtime.JSX.Element;
|
|
33
|
-
declare function SelectSearch(props: ComponentProps<typeof SearchInputText>): react_jsx_runtime.JSX.Element;
|
|
34
|
-
declare function SelectCaption({ className, variant, size, weight, ...props }: ComponentProps<typeof Typography>): react_jsx_runtime.JSX.Element;
|
|
35
|
-
|
|
36
|
-
export { SelectCaption, SelectContent, SelectHeader, SelectHeaderTitle, SelectLabel, SelectLeftSlot, SelectMultiValue, SelectOption, SelectOptionText, SelectOptions, SelectRightSlot, SelectRoot, SelectSearch, SelectTrigger, SelectValue };
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import {a as a$2,b as b$1,e as e$1,d as d$2}from'../chunk-NPTLORW5.js';import {a,d as d$1,e,b,c}from'../chunk-KIFR5VIE.js';import'../chunk-FASEHVMD.js';import {a as a$1}from'../chunk-EIG6CBTQ.js';import {b as b$2}from'../chunk-SHHXKVVR.js';import {createContext,useContext}from'react';import*as n from'@radix-ui/react-popover';import {twMerge,tv}from'@xjur-ui/util';import {jsx,jsxs,Fragment}from'react/jsx-runtime';var P=createContext({disabled:false,hasError:false});function d(){let e=useContext(P);if(!e)throw new Error("useSelect must be used within a SelectRoot");return e}function k({disabled:e=false,hasError:o=false,...r}){return jsx(P.Provider,{value:{disabled:e,hasError:o},children:jsx(n.Root,{...r})})}function j({className:e,...o}){let{disabled:r,hasError:l}=d();return jsx(n.Trigger,{className:twMerge(e,"group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full cursor-pointer items-center","bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3 border","data-[state=open]:border-primary-idle data-[state=open]:data-[has-error=true]:border-danger-label-active","has-[input:not(:placeholder-shown)]:text-primary-idle has-[input:not(:placeholder-shown)]:data-[has-error=true]:text-danger-label-active","has-[input:not(:placeholder-shown)]:border-primary-idle has-[input:not(:placeholder-shown)]:data-[has-error=true]:border-danger-label-active","disabled:bg-layer-2-idle disabled:cursor-text disabled:border-none disabled:select-text","data-[has-error=true]:border-danger-idle data-[has-error=true]:hover:border-danger-idle"),...o,"data-has-error":l,disabled:r})}function F({className:e,children:o,sideOffset:r=4,side:l="bottom",align:s="start",...i}){return jsx(n.Portal,{children:jsx(n.Content,{align:s,className:twMerge(e,"group z-10 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]"),side:l,sideOffset:r,...i,children:jsx(a,{children:o})})})}function M({className:e,displayValue:o="",...r}){return jsxs(Fragment,{children:[!!o&&jsx(a$1,{className:twMerge(e,"text-neutral-dark","group-has-[div[data-slot=select-left-slot]]:pl-large-1x"),children:o}),jsx("input",{...r,"aria-readonly":true,className:twMerge(e,"pointer-events-none"),hidden:true,placeholder:r.placeholder??" ",readOnly:true})]})}function V({className:e,values:o,children:r,...l}){return jsxs("div",{className:twMerge(e,"gap-small-1x scrollbar-hide overflow-x-small flex","group-has-[div[data-slot=select-left-slot]]:pl-large-1x","group-disabled:!pl-0"),...l,children:[r,jsx("input",{"aria-readonly":true,className:twMerge(e,"pointer-events-none"),hidden:true,placeholder:" ",readOnly:true,value:o.join(",")})]})}function _({className:e,htmlFor:o,children:r,...l}){let{hasError:s}=d();return jsx(a$1,{asChild:true,className:twMerge("inline-block max-w-full truncate text-left font-normal","left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2","ease transition-all duration-250","group-data-[state=open]:!text-primary-idle group-data-[state=open]:data-[has-error=true]:!text-danger-label-active","group-data-[state=open]:-top-[3px]","group-data-[state=open]:text-size-label-sm-1x","group-data-[state=open]:font-medium","group-has-[input:not(:placeholder-shown)]:!text-primary-idle group-has-[input:not(:placeholder-shown)]:data-[has-error=true]:!text-danger-label-active","group-has-[input:not(:placeholder-shown)]:-top-[3px]","group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x","group-has-[input:not(:placeholder-shown)]:font-medium","group-has-[div[data-slot=select-left-slot]]:left-large-4x","group-has-[div[data-slot=select-left-slot]]:group-data-[state=open]:left-small","group-has-[div[data-slot=select-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small","group-has-[div[data-slot=select-right-slot]]:right-large-4x","group-has-[div[data-slot=select-right-slot]]:group-data-[state=open]:right-small","group-has-[div[data-slot=select-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small","group-data-[state=open]:animate-in","group-data-[state=closed]:animate-out","group-has-[input:not(:placeholder-shown)]:animate-out","group-disabled:hidden",e),"data-has-error":s,...l,children:jsx("label",{htmlFor:o,children:jsx("span",{className:"bg-layer-2-idle rounded-small-1x max-w-full",children:r})})})}function q(e){return jsx(d$1,{...e})}function A({className:e$1,...o}){return jsx(e,{className:twMerge(e$1,"cursor-pointer"),...o})}function B(e){return jsx(a$1,{...e})}function D(e){return jsx(b,{...e})}function G(e){return jsx(c,{...e})}function J({className:e,...o}){return jsx("div",{...o,className:twMerge(e,"left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center"),"data-slot":"select-left-slot"})}function K({className:e,...o}){return jsx("div",{...o,className:twMerge(e,"right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center","group-disabled:hidden"),"data-slot":"select-right-slot"})}function Q(e){return jsx(a$2,{variant:"line",children:jsxs(b$1,{children:[jsx(e$1,{children:jsx(b$2,{className:"text-icon-neutral-3",name:"search"})}),jsx(d$2,{...e})]})})}function U({className:e,variant:o="body",size:r="sm",weight:l="normal",...s}){let{hasError:i}=d(),C=tv({base:"text-size-body-sm mt-small-1x font-normal",variants:{state:{error:"text-danger-label-active",idle:"text-neutral-dark"}}});return jsx(a$1,{className:C({state:i?"error":"idle",className:e}),size:r,variant:o,weight:l,...s})}export{U as SelectCaption,F as SelectContent,D as SelectHeader,G as SelectHeaderTitle,_ as SelectLabel,J as SelectLeftSlot,V as SelectMultiValue,A as SelectOption,B as SelectOptionText,q as SelectOptions,K as SelectRightSlot,k as SelectRoot,Q as SelectSearch,j as SelectTrigger,M as SelectValue};//# sourceMappingURL=select.js.map
|
|
2
|
-
//# sourceMappingURL=select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/select.tsx"],"names":["SelectContext","createContext","useSelect","context","useContext","SelectRoot","disabled","hasError","props","jsx","SelectTrigger","className","twMerge","SelectContent","children","sideOffset","side","align","ListRoot","SelectValue","displayValue","jsxs","Fragment","Typography","SelectMultiValue","values","SelectLabel","htmlFor","SelectOptions","ListContent","SelectOption","ListItem","SelectOptionText","SelectHeader","ListHeader","SelectHeaderTitle","ListHeaderTitle","SelectLeftSlot","SelectRightSlot","SelectSearch","SearchInputRoot","SearchInputContent","SearchInputSlot","Icon","SearchInputText","SelectCaption","variant","size","weight","caption","tv"],"mappings":"gaAmBA,IAAMA,CAAAA,CAAgBC,aAAAA,CAAc,CAClC,QAAA,CAAU,KAAA,CACV,QAAA,CAAU,KACZ,CAAC,CAAA,CAED,SAASC,CAAAA,EAAY,CACnB,IAAMC,CAAAA,CAAUC,UAAAA,CAAWJ,CAAa,EAExC,GAAI,CAACG,CAAAA,CACH,MAAM,IAAI,KAAA,CAAM,4CAA4C,CAAA,CAG9D,OAAOA,CACT,CAEO,SAASE,CAAAA,CAAW,CACzB,QAAA,CAAAC,CAAAA,CAAW,KAAA,CACX,SAAAC,CAAAA,CAAW,KAAA,CACX,GAAGC,CACL,CAAA,CAGG,CACD,OACEC,GAAAA,CAACT,EAAc,QAAA,CAAd,CAAuB,KAAA,CAAO,CAAE,QAAA,CAAAM,CAAAA,CAAU,QAAA,CAAAC,CAAS,EAClD,QAAA,CAAAE,GAAAA,CAAc,CAAA,CAAA,IAAA,CAAb,CAAmB,GAAGD,CAAAA,CAAO,CAAA,CAChC,CAEJ,CAEO,SAASE,CAAAA,CAAc,CAC5B,SAAA,CAAAC,CAAAA,CACA,GAAGH,CACL,CAAA,CAAgD,CAC9C,GAAM,CAAE,QAAA,CAAAF,CAAAA,CAAU,QAAA,CAAAC,CAAS,CAAA,CAAIL,CAAAA,GAE/B,OACEO,GAAAA,CAAc,CAAA,CAAA,OAAA,CAAb,CACC,SAAA,CAAWG,OAAAA,CACTD,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AAAA,CACTD,CAAAA,CACA,iFACA,uBACF,CAAA,CACA,WAAA,CAAU,mBAAA,CACZ,CAEJ,CAEO,SAAS4B,CAAAA,CAAa/B,EAA+C,CAC1E,OACEC,GAAAA,CAAC+B,GAAAA,CAAA,CAAgB,OAAA,CAAQ,MAAA,CACvB,QAAA,CAAAnB,KAACoB,GAAAA,CAAA,CACC,QAAA,CAAA,CAAAhC,GAAAA,CAACiC,GAAAA,CAAA,CACC,QAAA,CAAAjC,GAAAA,CAACkC,IAAA,CAAK,SAAA,CAAU,qBAAA,CAAsB,IAAA,CAAK,QAAA,CAAS,CAAA,CACtD,CAAA,CACAlC,GAAAA,CAACmC,IAAA,CAAiB,GAAGpC,CAAAA,CAAO,CAAA,CAAA,CAC9B,CAAA,CACF,CAEJ,CAEO,SAASqC,EAAc,CAC5B,SAAA,CAAAlC,CAAAA,CACA,OAAA,CAAAmC,CAAAA,CAAU,MAAA,CACV,IAAA,CAAAC,CAAAA,CAAO,KACP,MAAA,CAAAC,CAAAA,CAAS,QAAA,CACT,GAAGxC,CACL,CAAA,CAAsC,CACpC,GAAM,CAAE,QAAA,CAAAD,CAAS,CAAA,CAAIL,CAAAA,EAAU,CAEzB+C,CAAAA,CAAUC,EAAAA,CAAG,CACjB,KAAM,2CAAA,CACN,QAAA,CAAU,CACR,KAAA,CAAO,CACL,KAAA,CAAO,0BAAA,CACP,IAAA,CAAM,mBACR,CACF,CACF,CAAC,CAAA,CAED,OACEzC,GAAAA,CAACc,GAAAA,CAAA,CACC,UAAW0B,CAAAA,CAAQ,CACjB,KAAA,CAAO1C,CAAAA,CAAW,OAAA,CAAU,MAAA,CAC5B,SAAA,CAAAI,CACF,CAAC,CAAA,CACD,IAAA,CAAMoC,CAAAA,CACN,OAAA,CAASD,CAAAA,CACT,MAAA,CAAQE,CAAAA,CACP,GAAGxC,EACN,CAEJ","file":"select.js","sourcesContent":["import { createContext, useContext, type ComponentProps } from 'react'\nimport * as RadixPopover from '@radix-ui/react-popover'\nimport { tv, twMerge } from '@xjur-ui/util'\nimport {\n ListContent,\n ListItem,\n ListRoot,\n ListHeader,\n ListHeaderTitle\n} from './list'\nimport {\n SearchInputContent,\n SearchInputText,\n SearchInputRoot,\n SearchInputSlot\n} from './search-input'\nimport { Icon } from './icon'\nimport { Typography, type TypographyProps } from './typography'\n\nconst SelectContext = createContext({\n disabled: false,\n hasError: false\n})\n\nfunction useSelect() {\n const context = useContext(SelectContext)\n\n if (!context) {\n throw new Error('useSelect must be used within a SelectRoot')\n }\n\n return context\n}\n\nexport function SelectRoot({\n disabled = false,\n hasError = false,\n ...props\n}: ComponentProps<typeof RadixPopover.Root> & {\n disabled?: boolean\n hasError?: boolean\n}) {\n return (\n <SelectContext.Provider value={{ disabled, hasError }}>\n <RadixPopover.Root {...props} />\n </SelectContext.Provider>\n )\n}\n\nexport function SelectTrigger({\n className,\n ...props\n}: ComponentProps<typeof RadixPopover.Trigger>) {\n const { disabled, hasError } = useSelect()\n\n return (\n <RadixPopover.Trigger\n className={twMerge(\n className,\n 'group h-large-4x rounded-small-1x gap-small py-small_1x-alt px-small relative flex w-full cursor-pointer items-center',\n 'bg-layer-2-idle border-border-layer-2 hover:border-border-layer-3 border',\n 'data-[state=open]:border-primary-idle data-[state=open]:data-[has-error=true]:border-danger-label-active',\n 'has-[input:not(:placeholder-shown)]:text-primary-idle has-[input:not(:placeholder-shown)]:data-[has-error=true]:text-danger-label-active',\n 'has-[input:not(:placeholder-shown)]:border-primary-idle has-[input:not(:placeholder-shown)]:data-[has-error=true]:border-danger-label-active',\n 'disabled:bg-layer-2-idle disabled:cursor-text disabled:border-none disabled:select-text',\n 'data-[has-error=true]:border-danger-idle data-[has-error=true]:hover:border-danger-idle'\n )}\n {...props}\n data-has-error={hasError}\n disabled={disabled}\n />\n )\n}\n\nexport function SelectContent({\n className,\n children,\n sideOffset = 4,\n side = 'bottom',\n align = 'start',\n ...props\n}: ComponentProps<typeof RadixPopover.Content>) {\n return (\n <RadixPopover.Portal>\n <RadixPopover.Content\n align={align}\n className={twMerge(\n className,\n 'group z-10 max-h-[var(--radix-popover-content-available-height)] max-w-[var(--radix-popover-content-available-width)] min-w-[var(--radix-popover-trigger-width)]'\n )}\n side={side}\n sideOffset={sideOffset}\n {...props}\n >\n <ListRoot>{children}</ListRoot>\n </RadixPopover.Content>\n </RadixPopover.Portal>\n )\n}\n\nexport function SelectValue({\n className,\n displayValue = '',\n ...props\n}: ComponentProps<'input'> & { displayValue?: string }) {\n return (\n <>\n {!!displayValue && (\n <Typography\n className={twMerge(\n className,\n 'text-neutral-dark',\n // if has left slot, add the left slot padding\n 'group-has-[div[data-slot=select-left-slot]]:pl-large-1x'\n )}\n >\n {displayValue}\n </Typography>\n )}\n\n <input\n {...props}\n aria-readonly={true}\n className={twMerge(className, 'pointer-events-none')}\n hidden={true}\n placeholder={props.placeholder ?? ' '}\n readOnly={true}\n />\n </>\n )\n}\n\nexport function SelectMultiValue({\n className,\n values,\n children,\n ...props\n}: ComponentProps<'div'> & { values: string[] }) {\n return (\n <div\n className={twMerge(\n className,\n 'gap-small-1x scrollbar-hide overflow-x-small flex',\n // if has left slot, add the left slot padding\n 'group-has-[div[data-slot=select-left-slot]]:pl-large-1x',\n // if the trigger is disabled, remove the left slot padding\n 'group-disabled:!pl-0'\n )}\n {...props}\n >\n {children}\n\n <input\n aria-readonly={true}\n className={twMerge(className, 'pointer-events-none')}\n hidden={true}\n placeholder={' '}\n readOnly={true}\n value={values.join(',')}\n />\n </div>\n )\n}\n\nexport function SelectLabel({\n className,\n htmlFor,\n children,\n ...props\n}: TypographyProps & { htmlFor?: string }) {\n const { hasError } = useSelect()\n\n return (\n <Typography\n asChild={true}\n className={twMerge(\n 'inline-block max-w-full truncate text-left font-normal',\n 'left-small right-small pointer-events-none absolute top-1/2 -translate-y-1/2',\n 'ease transition-all duration-250',\n // Content Open\n 'group-data-[state=open]:!text-primary-idle group-data-[state=open]:data-[has-error=true]:!text-danger-label-active',\n 'group-data-[state=open]:-top-[3px]',\n 'group-data-[state=open]:text-size-label-sm-1x',\n 'group-data-[state=open]:font-medium',\n // Filled\n 'group-has-[input:not(:placeholder-shown)]:!text-primary-idle group-has-[input:not(:placeholder-shown)]:data-[has-error=true]:!text-danger-label-active',\n 'group-has-[input:not(:placeholder-shown)]:-top-[3px]',\n 'group-has-[input:not(:placeholder-shown)]:text-size-label-sm-1x',\n 'group-has-[input:not(:placeholder-shown)]:font-medium',\n // If has left slot\n 'group-has-[div[data-slot=select-left-slot]]:left-large-4x',\n 'group-has-[div[data-slot=select-left-slot]]:group-data-[state=open]:left-small',\n 'group-has-[div[data-slot=select-left-slot]]:group-has-[input:not(:placeholder-shown)]:left-small',\n // If has right slot\n 'group-has-[div[data-slot=select-right-slot]]:right-large-4x',\n 'group-has-[div[data-slot=select-right-slot]]:group-data-[state=open]:right-small',\n 'group-has-[div[data-slot=select-right-slot]]:group-has-[input:not(:placeholder-shown)]:right-small',\n // Animate\n 'group-data-[state=open]:animate-in',\n 'group-data-[state=closed]:animate-out',\n 'group-has-[input:not(:placeholder-shown)]:animate-out',\n 'group-disabled:hidden',\n className\n )}\n data-has-error={hasError}\n {...props}\n >\n <label htmlFor={htmlFor}>\n <span className=\"bg-layer-2-idle rounded-small-1x max-w-full\">\n {children}\n </span>\n </label>\n </Typography>\n )\n}\n\nexport function SelectOptions(props: ComponentProps<typeof ListContent>) {\n return <ListContent {...props} />\n}\n\nexport function SelectOption({\n className,\n ...props\n}: ComponentProps<typeof ListItem>) {\n return (\n <ListItem className={twMerge(className, 'cursor-pointer')} {...props} />\n )\n}\n\nexport function SelectOptionText(props: ComponentProps<typeof Typography>) {\n return <Typography {...props} />\n}\n\nexport function SelectHeader(props: ComponentProps<typeof ListHeader>) {\n return <ListHeader {...props} />\n}\n\nexport function SelectHeaderTitle(\n props: ComponentProps<typeof ListHeaderTitle>\n) {\n return <ListHeaderTitle {...props} />\n}\n\nexport function SelectLeftSlot({ className, ...props }: ComponentProps<'div'>) {\n return (\n <div\n {...props}\n className={twMerge(\n className,\n 'left-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center'\n )}\n data-slot=\"select-left-slot\"\n />\n )\n}\n\nexport function SelectRightSlot({\n className,\n ...props\n}: ComponentProps<'div'>) {\n return (\n <div\n {...props}\n className={twMerge(\n className,\n 'right-small absolute top-1/2 flex -translate-y-1/2 items-center justify-center',\n 'group-disabled:hidden'\n )}\n data-slot=\"select-right-slot\"\n />\n )\n}\n\nexport function SelectSearch(props: ComponentProps<typeof SearchInputText>) {\n return (\n <SearchInputRoot variant=\"line\">\n <SearchInputContent>\n <SearchInputSlot>\n <Icon className=\"text-icon-neutral-3\" name=\"search\" />\n </SearchInputSlot>\n <SearchInputText {...props} />\n </SearchInputContent>\n </SearchInputRoot>\n )\n}\n\nexport function SelectCaption({\n className,\n variant = 'body',\n size = 'sm',\n weight = 'normal',\n ...props\n}: ComponentProps<typeof Typography>) {\n const { hasError } = useSelect()\n\n const caption = tv({\n base: 'text-size-body-sm mt-small-1x font-normal',\n variants: {\n state: {\n error: 'text-danger-label-active',\n idle: 'text-neutral-dark'\n }\n }\n })\n\n return (\n <Typography\n className={caption({\n state: hasError ? 'error' : 'idle',\n className\n })}\n size={size}\n variant={variant}\n weight={weight}\n {...props}\n />\n )\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/components/switch.tsx"],"names":["Switch","className","props","jsx","cx"],"mappings":"0HAIA,SAASA,CAAAA,CAAO,CACd,SAAA,CAAAC,CAAAA,CACA,GAAGC,CACL,CAAA,CAAsD,CACpD,OACEC,GAAAA,CAAiB,CAAA,CAAA,IAAA,CAAhB,CACC,SAAA,CAAWC,EAAAA,CACT,gGACA,2EAAA,CACA,kIAAA,CACA,qCACAH,CACF,CAAA,CACA,WAAA,CAAU,QAAA,CACT,GAAGC,CAAAA,CAEJ,SAAAC,GAAAA,CAAiB,CAAA,CAAA,KAAA,CAAhB,CACC,SAAA,CAAWC,EAAAA,CACT,iLACF,CAAA,CACA,WAAA,CAAU,cAAA,CACZ,CAAA,CACF,CAEJ","file":"switch.js","sourcesContent":["import * as React from 'react'\nimport * as SwitchPrimitive from '@radix-ui/react-switch'\nimport { cx } from '@xjur-ui/util'\n\nfunction Switch({\n className,\n ...props\n}: React.ComponentProps<typeof SwitchPrimitive.Root>) {\n return (\n <SwitchPrimitive.Root\n className={cx(\n 'w-large-3x h-large rounded-circle inline-flex shrink-0 items-center border border-transparent',\n 'peer data-[state=checked]:bg-primary-idle data-[state=unchecked]:bg-alt-4',\n 'focus-visible:border-ring focus-visible:ring-ring/50 transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50',\n 'hover:shadow-focus-primary p-[2px]',\n className\n )}\n data-slot=\"switch\"\n {...props}\n >\n <SwitchPrimitive.Thumb\n className={cx(\n 'bg-layer-2-idle size-medium pointer-events-none rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0'\n )}\n data-slot=\"switch-thumb\"\n />\n </SwitchPrimitive.Root>\n )\n}\n\nexport { Switch }\n"]}
|