@xjur-ui/react 2.1.0 → 2.2.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/CHANGELOG.md +18 -0
- package/dist/{chunk-IRHU7PDO.js → chunk-2JQVYVAT.js} +2 -2
- package/dist/chunk-2JQVYVAT.js.map +1 -0
- package/dist/chunk-2JU3PFV2.js +2 -0
- package/dist/chunk-2JU3PFV2.js.map +1 -0
- package/dist/chunk-3H75F4Y2.js +2 -0
- package/dist/chunk-3H75F4Y2.js.map +1 -0
- package/dist/{chunk-Z47R2CIM.js → chunk-3L772WC6.js} +2 -2
- package/dist/chunk-3L772WC6.js.map +1 -0
- package/dist/chunk-43DUEHUA.js +2 -0
- package/dist/chunk-43DUEHUA.js.map +1 -0
- package/dist/chunk-4BGAERSD.js +2 -0
- package/dist/chunk-4BGAERSD.js.map +1 -0
- package/dist/{chunk-5WLIDYZH.js → chunk-4PTFZTVU.js} +2 -2
- package/dist/{chunk-5WLIDYZH.js.map → chunk-4PTFZTVU.js.map} +1 -1
- package/dist/chunk-6PHXO2YA.js +2 -0
- package/dist/{chunk-RWMV7APX.js.map → chunk-6PHXO2YA.js.map} +1 -1
- package/dist/{chunk-2CTBH6VI.js → chunk-7HG6Y3VV.js} +2 -2
- package/dist/{chunk-2CTBH6VI.js.map → chunk-7HG6Y3VV.js.map} +1 -1
- package/dist/chunk-7HMMMRDA.js +2 -0
- package/dist/chunk-7HMMMRDA.js.map +1 -0
- package/dist/chunk-7QGN6XFA.js +2 -0
- package/dist/chunk-7QGN6XFA.js.map +1 -0
- package/dist/chunk-AKR2BJRB.js +2 -0
- package/dist/chunk-AKR2BJRB.js.map +1 -0
- package/dist/{chunk-BK6FP63A.js → chunk-ASZAHSU5.js} +2 -2
- package/dist/{chunk-BK6FP63A.js.map → chunk-ASZAHSU5.js.map} +1 -1
- package/dist/chunk-DOC3XTYC.js +2 -0
- package/dist/chunk-DOC3XTYC.js.map +1 -0
- package/dist/{chunk-IKL6PSXU.js → chunk-DT44JTXB.js} +2 -2
- package/dist/{chunk-IKL6PSXU.js.map → chunk-DT44JTXB.js.map} +1 -1
- package/dist/chunk-DVDHTP4C.js +2 -0
- package/dist/chunk-DVDHTP4C.js.map +1 -0
- package/dist/chunk-EITO7GZX.js +2 -0
- package/dist/chunk-EITO7GZX.js.map +1 -0
- package/dist/chunk-F7ANJ4HD.js +2 -0
- package/dist/chunk-F7ANJ4HD.js.map +1 -0
- package/dist/chunk-FQTUN47L.js +2 -0
- package/dist/chunk-FQTUN47L.js.map +1 -0
- package/dist/chunk-FUHASFGU.js +2 -0
- package/dist/chunk-FUHASFGU.js.map +1 -0
- package/dist/{chunk-CI3ZXWEX.js → chunk-G6NSC3FL.js} +2 -2
- package/dist/{chunk-CI3ZXWEX.js.map → chunk-G6NSC3FL.js.map} +1 -1
- package/dist/{chunk-6AD6O6II.js → chunk-GKILN5HI.js} +2 -2
- package/dist/chunk-GKILN5HI.js.map +1 -0
- package/dist/chunk-GVKH2BG2.js +2 -0
- package/dist/chunk-GVKH2BG2.js.map +1 -0
- package/dist/chunk-JF7JKJES.js +2 -0
- package/dist/chunk-JF7JKJES.js.map +1 -0
- package/dist/{chunk-TSVURBUY.js → chunk-JGPHBUVM.js} +2 -2
- package/dist/chunk-JGPHBUVM.js.map +1 -0
- package/dist/{chunk-PKCW37CJ.js → chunk-M6ZI7M3R.js} +2 -2
- package/dist/chunk-M6ZI7M3R.js.map +1 -0
- package/dist/{chunk-UXIVZWLB.js → chunk-MQ7YTZBI.js} +2 -2
- package/dist/{chunk-UXIVZWLB.js.map → chunk-MQ7YTZBI.js.map} +1 -1
- package/dist/chunk-O3JK6QF6.js +2 -0
- package/dist/chunk-O3JK6QF6.js.map +1 -0
- package/dist/{chunk-L4ET6GIZ.js → chunk-OKSGVAQQ.js} +2 -2
- package/dist/chunk-OKSGVAQQ.js.map +1 -0
- package/dist/chunk-OLWYBKQR.js +2 -0
- package/dist/chunk-OLWYBKQR.js.map +1 -0
- package/dist/chunk-PBR7SFWY.js +2 -0
- package/dist/chunk-PBR7SFWY.js.map +1 -0
- package/dist/chunk-Q2BZSHS2.js +2 -0
- package/dist/chunk-Q2BZSHS2.js.map +1 -0
- package/dist/{chunk-OS53BV63.js → chunk-RGKXZJJS.js} +3 -3
- package/dist/{chunk-OS53BV63.js.map → chunk-RGKXZJJS.js.map} +1 -1
- package/dist/chunk-SSTXFHNX.js +2 -0
- package/dist/chunk-SSTXFHNX.js.map +1 -0
- package/dist/chunk-TORICLEW.js +2 -0
- package/dist/chunk-TORICLEW.js.map +1 -0
- package/dist/chunk-TYWCS7GS.js +2 -0
- package/dist/chunk-TYWCS7GS.js.map +1 -0
- package/dist/chunk-URDL5OKH.js +2 -0
- package/dist/chunk-URDL5OKH.js.map +1 -0
- package/dist/chunk-V2FCP4FA.js +2 -0
- package/dist/chunk-V2FCP4FA.js.map +1 -0
- package/dist/chunk-VCNKCHFF.js +2 -0
- package/dist/chunk-VCNKCHFF.js.map +1 -0
- package/dist/chunk-WEGFAS5P.js +2 -0
- package/dist/chunk-WEGFAS5P.js.map +1 -0
- package/dist/chunk-X6SOSTUN.js +2 -0
- package/dist/chunk-X6SOSTUN.js.map +1 -0
- package/dist/chunk-XGPKBYDY.js +2 -0
- package/dist/chunk-XGPKBYDY.js.map +1 -0
- package/dist/chunk-YOLTIAFT.js +2 -0
- package/dist/{chunk-KIFR5VIE.js.map → chunk-YOLTIAFT.js.map} +1 -1
- package/dist/chunk-ZPQPJJQJ.js +2 -0
- package/dist/chunk-ZPQPJJQJ.js.map +1 -0
- package/dist/components/breadcrumb.js +1 -1
- package/dist/components/chip.d.ts +1 -1
- package/dist/components/chip.js +1 -1
- package/dist/components/controls/button.js +2 -0
- package/dist/components/{form → controls}/calendar.js +1 -1
- package/dist/components/controls/calendar.js.map +1 -0
- package/dist/components/{form → controls}/checkbox.js +1 -1
- package/dist/components/controls/checkbox.js.map +1 -0
- package/dist/components/{form → controls}/context/field.context.d.ts +1 -2
- package/dist/components/controls/context/field.context.js +2 -0
- package/dist/components/{form → controls}/date-picker.d.ts +2 -1
- package/dist/components/{form → controls}/date-picker.js +1 -1
- package/dist/components/controls/date-picker.js.map +1 -0
- package/dist/components/controls/floating-label.js +2 -0
- package/dist/components/{form → controls}/input.d.ts +3 -2
- package/dist/components/controls/input.js +2 -0
- package/dist/components/controls/otp-input.js.map +1 -0
- package/dist/components/controls/radio.js.map +1 -0
- package/dist/components/{form → controls}/rich-editor.js +1 -1
- package/dist/components/controls/rich-editor.js.map +1 -0
- package/dist/components/{form → controls}/search-input.d.ts +9 -1
- package/dist/components/controls/search-input.js +2 -0
- package/dist/components/controls/search-input.js.map +1 -0
- package/dist/components/controls/search-selector.d.ts +19 -0
- package/dist/components/controls/search-selector.js +2 -0
- package/dist/components/controls/search-selector.js.map +1 -0
- package/dist/components/{form → controls}/select.d.ts +2 -1
- package/dist/components/{form → controls}/select.js +1 -1
- package/dist/components/controls/switch.js +2 -0
- package/dist/components/custom/pessoa/index.d.ts +16 -0
- package/dist/components/custom/pessoa/index.js +2 -0
- package/dist/components/custom/pessoa/index.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-add-button.d.ts +9 -0
- package/dist/components/custom/pessoa/pessoa-add-button.js +2 -0
- package/dist/components/custom/pessoa/pessoa-add-button.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-body.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-body.js +2 -0
- package/dist/components/custom/pessoa/pessoa-body.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-close-button.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-close-button.js +2 -0
- package/dist/components/custom/pessoa/pessoa-close-button.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-content.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-content.js +2 -0
- package/dist/components/custom/pessoa/pessoa-content.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-footer.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-footer.js +2 -0
- package/dist/components/custom/pessoa/pessoa-footer.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-header.d.ts +10 -0
- package/dist/components/custom/pessoa/pessoa-header.js +2 -0
- package/dist/components/custom/pessoa/pessoa-header.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa-trigger.d.ts +8 -0
- package/dist/components/custom/pessoa/pessoa-trigger.js +2 -0
- package/dist/components/custom/pessoa/pessoa-trigger.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa.context.d.ts +25 -0
- package/dist/components/custom/pessoa/pessoa.context.js +2 -0
- package/dist/components/custom/pessoa/pessoa.context.js.map +1 -0
- package/dist/components/custom/pessoa/pessoa.d.ts +11 -0
- package/dist/components/custom/pessoa/pessoa.js +2 -0
- package/dist/components/custom/pessoa/pessoa.js.map +1 -0
- package/dist/components/dialog.js +1 -1
- package/dist/components/dialog.js.map +1 -1
- package/dist/components/drag-and-drop/index.js +1 -1
- package/dist/components/dropdown-menu.js +1 -1
- package/dist/components/full-calendar/calendar-add-event.js +1 -1
- package/dist/components/full-calendar/calendar-add-event.js.map +1 -1
- package/dist/components/full-calendar/calendar-cell.js +1 -1
- package/dist/components/full-calendar/calendar-day-view.js +1 -1
- package/dist/components/full-calendar/calendar-month-view.js +1 -1
- package/dist/components/full-calendar/calendar-more-events-dropdown.js +1 -1
- package/dist/components/full-calendar/calendar-navigator.js +1 -1
- package/dist/components/full-calendar/calendar-today-button.d.ts +1 -1
- package/dist/components/full-calendar/calendar-today-button.js +1 -1
- package/dist/components/full-calendar/calendar-toggle-view.js +1 -1
- package/dist/components/full-calendar/calendar-view-renderer.js +1 -1
- package/dist/components/full-calendar/calendar-week-view.js +1 -1
- package/dist/components/full-calendar/index.d.ts +1 -1
- package/dist/components/full-calendar/index.js +1 -1
- package/dist/components/horizontal-scroll.js +1 -1
- package/dist/components/horizontal-scroll.js.map +1 -1
- package/dist/components/icon.d.ts +2 -2
- package/dist/components/icon.js +1 -1
- package/dist/components/list.js +1 -1
- package/dist/components/selection-bar.d.ts +1 -1
- package/dist/components/selection-bar.js +1 -1
- package/dist/components/selection-bar.js.map +1 -1
- package/dist/components/sheet.js +1 -1
- package/dist/components/sheet.js.map +1 -1
- package/dist/components/steps/index.d.ts +11 -0
- package/dist/components/steps/index.js +2 -0
- package/dist/components/steps/index.js.map +1 -0
- package/dist/components/steps/step.d.ts +8 -0
- package/dist/components/steps/step.js +2 -0
- package/dist/components/steps/step.js.map +1 -0
- package/dist/components/steps/steps-action.d.ts +12 -0
- package/dist/components/steps/steps-action.js +2 -0
- package/dist/components/steps/steps-action.js.map +1 -0
- package/dist/components/steps/steps-content.d.ts +6 -0
- package/dist/components/steps/steps-content.js +2 -0
- package/dist/components/steps/steps-content.js.map +1 -0
- package/dist/components/steps/steps-context.d.ts +22 -0
- package/dist/components/steps/steps-context.js +2 -0
- package/dist/components/steps/steps-context.js.map +1 -0
- package/dist/components/steps/steps-navigation.d.ts +6 -0
- package/dist/components/steps/steps-navigation.js +2 -0
- package/dist/components/steps/steps-navigation.js.map +1 -0
- package/dist/components/steps/steps-root.d.ts +7 -0
- package/dist/components/steps/steps-root.js +2 -0
- package/dist/components/steps/steps-root.js.map +1 -0
- package/dist/components/table/index.d.ts +9 -0
- package/dist/components/table/index.js +2 -0
- package/dist/components/table/index.js.map +1 -0
- package/dist/components/table/table-body.d.ts +5 -0
- package/dist/components/table/table-body.js +2 -0
- package/dist/components/table/table-body.js.map +1 -0
- package/dist/components/table/table-cell.d.ts +5 -0
- package/dist/components/table/table-cell.js +2 -0
- package/dist/components/table/table-cell.js.map +1 -0
- package/dist/components/table/table-footer.d.ts +5 -0
- package/dist/components/table/table-footer.js +2 -0
- package/dist/components/table/table-footer.js.map +1 -0
- package/dist/components/table/table-head.d.ts +6 -0
- package/dist/components/table/table-head.js +2 -0
- package/dist/components/table/table-head.js.map +1 -0
- package/dist/components/table/table-header.d.ts +5 -0
- package/dist/components/table/table-header.js +2 -0
- package/dist/components/table/table-header.js.map +1 -0
- package/dist/components/table/table-row.d.ts +7 -0
- package/dist/components/table/table-row.js +2 -0
- package/dist/components/table/table-row.js.map +1 -0
- package/dist/components/table/table-sort.d.ts +7 -0
- package/dist/components/table/table-sort.js +2 -0
- package/dist/components/table/table-sort.js.map +1 -0
- package/dist/components/table/table.d.ts +5 -0
- package/dist/components/table/table.js +2 -0
- package/dist/components/table/table.js.map +1 -0
- package/dist/components/tag.d.ts +1 -1
- package/dist/components/tag.js +1 -1
- package/dist/components/upload.js +1 -1
- package/dist/components/upload.js.map +1 -1
- package/dist/icons-C-hGI45d.d.ts +4 -0
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/input-mask-DhbtCxF7.d.ts +3 -0
- package/package.json +22 -16
- package/.turbo/turbo-build.log +0 -288
- package/dist/chunk-2CM3SFOY.js +0 -2
- package/dist/chunk-2CM3SFOY.js.map +0 -1
- package/dist/chunk-6AD6O6II.js.map +0 -1
- package/dist/chunk-AA6V5YEC.js +0 -2
- package/dist/chunk-AA6V5YEC.js.map +0 -1
- package/dist/chunk-IRHU7PDO.js.map +0 -1
- package/dist/chunk-KIFR5VIE.js +0 -2
- package/dist/chunk-L4ET6GIZ.js.map +0 -1
- package/dist/chunk-PKCW37CJ.js.map +0 -1
- package/dist/chunk-RWMV7APX.js +0 -2
- package/dist/chunk-TSVURBUY.js.map +0 -1
- package/dist/chunk-WV7QV2PU.js +0 -2
- package/dist/chunk-WV7QV2PU.js.map +0 -1
- package/dist/chunk-Z47R2CIM.js.map +0 -1
- package/dist/components/form/button.js +0 -2
- package/dist/components/form/calendar.js.map +0 -1
- package/dist/components/form/checkbox.js.map +0 -1
- package/dist/components/form/context/field.context.js +0 -2
- package/dist/components/form/date-picker.js.map +0 -1
- package/dist/components/form/floating-label.js +0 -2
- package/dist/components/form/input.js +0 -2
- package/dist/components/form/otp-input.js.map +0 -1
- package/dist/components/form/radio.js.map +0 -1
- package/dist/components/form/rich-editor.js.map +0 -1
- package/dist/components/form/search-input.js +0 -2
- package/dist/components/form/search-input.js.map +0 -1
- package/dist/components/form/switch.js +0 -2
- package/dist/components/table.d.ts +0 -17
- package/dist/components/table.js +0 -2
- package/dist/components/table.js.map +0 -1
- package/dist/icons-CmDuL0gZ.d.ts +0 -4
- package/eslint.config.js +0 -10
- package/postcss.config.js +0 -5
- package/prettier.config.js +0 -7
- package/src/components/avatar-group.tsx +0 -76
- package/src/components/avatar.tsx +0 -54
- package/src/components/badge.tsx +0 -40
- package/src/components/breadcrumb.tsx +0 -119
- package/src/components/chip.tsx +0 -117
- package/src/components/collapsible.tsx +0 -35
- package/src/components/dialog.tsx +0 -242
- package/src/components/divider.tsx +0 -24
- package/src/components/drag-and-drop/drag-handle.tsx +0 -46
- package/src/components/drag-and-drop/drag-list-item.tsx +0 -91
- package/src/components/drag-and-drop/drag-list.tsx +0 -47
- package/src/components/drag-and-drop/drag-root.tsx +0 -30
- package/src/components/drag-and-drop/index.ts +0 -39
- package/src/components/drag-and-drop/types/drag-item.ts +0 -7
- package/src/components/dropdown-menu.tsx +0 -101
- package/src/components/form/button.tsx +0 -107
- package/src/components/form/calendar.tsx +0 -124
- package/src/components/form/checkbox.tsx +0 -57
- package/src/components/form/context/field.context.ts +0 -27
- package/src/components/form/date-picker.tsx +0 -199
- package/src/components/form/floating-label.tsx +0 -60
- package/src/components/form/input.tsx +0 -235
- package/src/components/form/otp-input.tsx +0 -45
- package/src/components/form/radio.tsx +0 -74
- package/src/components/form/rich-editor.tsx +0 -372
- package/src/components/form/search-input.tsx +0 -111
- package/src/components/form/select.tsx +0 -274
- package/src/components/form/switch.tsx +0 -31
- package/src/components/full-calendar/calendar-add-event.tsx +0 -15
- package/src/components/full-calendar/calendar-body.tsx +0 -12
- package/src/components/full-calendar/calendar-cell.tsx +0 -120
- package/src/components/full-calendar/calendar-day-view.tsx +0 -76
- package/src/components/full-calendar/calendar-event.tsx +0 -178
- package/src/components/full-calendar/calendar-header.tsx +0 -14
- package/src/components/full-calendar/calendar-month-view.tsx +0 -69
- package/src/components/full-calendar/calendar-more-events-dropdown.tsx +0 -39
- package/src/components/full-calendar/calendar-navigator.tsx +0 -86
- package/src/components/full-calendar/calendar-root.tsx +0 -165
- package/src/components/full-calendar/calendar-today-button.tsx +0 -21
- package/src/components/full-calendar/calendar-toggle-view.tsx +0 -61
- package/src/components/full-calendar/calendar-view-renderer.tsx +0 -19
- package/src/components/full-calendar/calendar-week-day.tsx +0 -49
- package/src/components/full-calendar/calendar-week-view.tsx +0 -88
- package/src/components/full-calendar/helpers/calendar.ts +0 -158
- package/src/components/full-calendar/index.ts +0 -16
- package/src/components/full-calendar/types/calendar-cell.ts +0 -4
- package/src/components/full-calendar/types/calendar-event.ts +0 -7
- package/src/components/full-calendar/types/calendar-view.ts +0 -1
- package/src/components/full-calendar/types/calendar-week-hour.ts +0 -4
- package/src/components/horizontal-scroll.tsx +0 -159
- package/src/components/icon.tsx +0 -29
- package/src/components/list.tsx +0 -111
- package/src/components/logo.tsx +0 -44
- package/src/components/selection-bar.tsx +0 -273
- package/src/components/sheet.tsx +0 -141
- package/src/components/skeleton.tsx +0 -12
- package/src/components/status.tsx +0 -43
- package/src/components/table.tsx +0 -160
- package/src/components/tabs.tsx +0 -72
- package/src/components/tag.tsx +0 -99
- package/src/components/tooltip.tsx +0 -63
- package/src/components/typography.tsx +0 -85
- package/src/components/upload.tsx +0 -647
- package/src/hooks/index.ts +0 -1
- package/src/hooks/use-os.ts +0 -32
- package/src/index.css +0 -5
- package/src/resources/icons.ts +0 -153
- package/src/resources/input-mask.ts +0 -91
- package/src/resources/logo/horizontal.tsx +0 -70
- package/src/resources/logo/icon.tsx +0 -54
- package/src/resources/logo/index.tsx +0 -33
- package/src/resources/logo/vertical.tsx +0 -70
- package/src/types.d.ts +0 -4
- package/tsconfig.json +0 -4
- package/tsup.config.ts +0 -30
- /package/dist/components/{form → controls}/button.d.ts +0 -0
- /package/dist/components/{form → controls}/button.js.map +0 -0
- /package/dist/components/{form → controls}/calendar.d.ts +0 -0
- /package/dist/components/{form → controls}/checkbox.d.ts +0 -0
- /package/dist/components/{form → controls}/context/field.context.js.map +0 -0
- /package/dist/components/{form → controls}/floating-label.d.ts +0 -0
- /package/dist/components/{form → controls}/floating-label.js.map +0 -0
- /package/dist/components/{form → controls}/input.js.map +0 -0
- /package/dist/components/{form → controls}/otp-input.d.ts +0 -0
- /package/dist/components/{form → controls}/otp-input.js +0 -0
- /package/dist/components/{form → controls}/radio.d.ts +0 -0
- /package/dist/components/{form → controls}/radio.js +0 -0
- /package/dist/components/{form → controls}/rich-editor.d.ts +0 -0
- /package/dist/components/{form → controls}/select.js.map +0 -0
- /package/dist/components/{form → controls}/switch.d.ts +0 -0
- /package/dist/components/{form → controls}/switch.js.map +0 -0
|
@@ -1,273 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps, ReactNode } from 'react'
|
|
2
|
-
import { createContext, useContext, useState, useCallback } from 'react'
|
|
3
|
-
import { cva, cx, type ClassVariantProps } from '@xjur-ui/util'
|
|
4
|
-
import { Icon, type IconType } from './icon'
|
|
5
|
-
import { Button } from './form/button'
|
|
6
|
-
|
|
7
|
-
const selectionBarVariants = cva(
|
|
8
|
-
[
|
|
9
|
-
'flex items-center gap-4 rounded-lg px-4 py-3 shadow-lg transition-colors duration-200 ease-in-out',
|
|
10
|
-
'fixed bottom-6 left-1/2 -translate-x-1/2 transform z-50',
|
|
11
|
-
'backdrop-blur-sm bg-white/95 border border-border-layer-2'
|
|
12
|
-
],
|
|
13
|
-
{
|
|
14
|
-
variants: {
|
|
15
|
-
size: {
|
|
16
|
-
sm: 'px-3 py-2 text-sm',
|
|
17
|
-
md: 'px-4 py-3 text-base',
|
|
18
|
-
lg: 'px-6 py-4 text-lg'
|
|
19
|
-
},
|
|
20
|
-
variant: {
|
|
21
|
-
primary:
|
|
22
|
-
'bg-primary-idle text-neutral-label hover:bg-primary-hover rounded-circle active:bg-primary-pressed',
|
|
23
|
-
secondary:
|
|
24
|
-
'bg-secondary-idle text-white border-secondary-idle hover:bg-secondary-hover rounded-circle',
|
|
25
|
-
success:
|
|
26
|
-
'bg-success-idle text-white border-success-idle hover:bg-success-hover rounded-circle',
|
|
27
|
-
warning:
|
|
28
|
-
'bg-warning-idle text-white border-warning-idle hover:bg-warning-hover rounded-circle',
|
|
29
|
-
destructive:
|
|
30
|
-
'bg-destructive-idle text-white border-destructive-idle hover:bg-destructive-hover rounded-circle',
|
|
31
|
-
neutral:
|
|
32
|
-
'bg-neutral-dark text-white border-neutral-dark hover:bg-neutral-hover rounded-circle',
|
|
33
|
-
outline:
|
|
34
|
-
'bg-white text-neutral-dark border-border-layer-2 hover:bg-layer-2-hover rounded-circle'
|
|
35
|
-
},
|
|
36
|
-
position: {
|
|
37
|
-
fixed: 'fixed bottom-6 left-1/2 -translate-x-1/2 transform',
|
|
38
|
-
absolute: 'absolute bottom-6 left-1/2 -translate-x-1/2 transform',
|
|
39
|
-
relative: 'relative',
|
|
40
|
-
sticky: 'sticky bottom-6'
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
defaultVariants: {
|
|
44
|
-
size: 'md',
|
|
45
|
-
variant: 'primary',
|
|
46
|
-
position: 'fixed'
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
|
|
51
|
-
export interface SelectionAction {
|
|
52
|
-
id: string
|
|
53
|
-
label?: string
|
|
54
|
-
icon: IconType
|
|
55
|
-
onClick: () => void
|
|
56
|
-
variant?: 'primary' | 'secondary' | 'destructive' | 'tertiary' | 'outlined'
|
|
57
|
-
disabled?: boolean
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
interface SelectionBarProps
|
|
61
|
-
extends Omit<ComponentProps<'div'>, 'onClose'>,
|
|
62
|
-
ClassVariantProps<typeof selectionBarVariants> {
|
|
63
|
-
selectedCount: number
|
|
64
|
-
onClose: () => void
|
|
65
|
-
actions?: SelectionAction[]
|
|
66
|
-
showCloseButton?: boolean
|
|
67
|
-
closeButtonText?: string
|
|
68
|
-
selectedText?: string
|
|
69
|
-
className?: string
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function SelectionBar({
|
|
73
|
-
selectedCount,
|
|
74
|
-
onClose,
|
|
75
|
-
actions = [],
|
|
76
|
-
showCloseButton = true,
|
|
77
|
-
selectedText,
|
|
78
|
-
size = 'md',
|
|
79
|
-
variant = 'primary',
|
|
80
|
-
position = 'fixed',
|
|
81
|
-
className,
|
|
82
|
-
...props
|
|
83
|
-
}: SelectionBarProps) {
|
|
84
|
-
if (selectedCount === 0) return null
|
|
85
|
-
|
|
86
|
-
const getSelectedText = () => {
|
|
87
|
-
if (selectedText) return selectedText
|
|
88
|
-
return selectedCount === 1
|
|
89
|
-
? '1 item selecionado'
|
|
90
|
-
: `${selectedCount} itens selecionados`
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
const getIconSize = () => {
|
|
94
|
-
switch (size) {
|
|
95
|
-
case 'sm':
|
|
96
|
-
return 'text-sm'
|
|
97
|
-
case 'md':
|
|
98
|
-
return 'text-base'
|
|
99
|
-
case 'lg':
|
|
100
|
-
return 'text-lg'
|
|
101
|
-
default:
|
|
102
|
-
return 'text-base'
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return (
|
|
107
|
-
<div
|
|
108
|
-
className={cx(
|
|
109
|
-
selectionBarVariants({ size, variant, position }),
|
|
110
|
-
className
|
|
111
|
-
)}
|
|
112
|
-
{...props}
|
|
113
|
-
>
|
|
114
|
-
{showCloseButton && (
|
|
115
|
-
<Button
|
|
116
|
-
appearance="ghost"
|
|
117
|
-
className="rounded-full text-current"
|
|
118
|
-
size={size === 'lg' ? 'md' : 'sm'}
|
|
119
|
-
variant="secondary"
|
|
120
|
-
onClick={() => onClose()}
|
|
121
|
-
>
|
|
122
|
-
<Icon className={getIconSize()} name="close" />
|
|
123
|
-
</Button>
|
|
124
|
-
)}
|
|
125
|
-
|
|
126
|
-
<span className="font-medium whitespace-nowrap">{getSelectedText()}</span>
|
|
127
|
-
|
|
128
|
-
{actions.map(action => (
|
|
129
|
-
<Button
|
|
130
|
-
appearance="ghost"
|
|
131
|
-
className="rounded-full text-current"
|
|
132
|
-
disabled={action.disabled}
|
|
133
|
-
key={action.id}
|
|
134
|
-
size={size === 'lg' ? 'md' : 'sm'}
|
|
135
|
-
variant={action.variant || 'secondary'}
|
|
136
|
-
onClick={() => action.onClick()}
|
|
137
|
-
>
|
|
138
|
-
<Icon className={getIconSize()} name={action.icon} />
|
|
139
|
-
{action.label && <span className="ml-2">{action.label}</span>}
|
|
140
|
-
</Button>
|
|
141
|
-
))}
|
|
142
|
-
</div>
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
interface SelectionBarContextType {
|
|
147
|
-
selectedItems: Set<string>
|
|
148
|
-
toggleSelection: (id: string) => void
|
|
149
|
-
clearSelection: () => void
|
|
150
|
-
selectAll: (ids: string[]) => void
|
|
151
|
-
isSelected: (id: string) => boolean
|
|
152
|
-
selectedCount: number
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const SelectionBarContext = createContext<SelectionBarContextType | null>(null)
|
|
156
|
-
|
|
157
|
-
interface SelectionBarProviderProps {
|
|
158
|
-
children: ReactNode
|
|
159
|
-
onSelectionChange?: (selectedIds: string[]) => void
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
function SelectionBarProvider({
|
|
163
|
-
children,
|
|
164
|
-
onSelectionChange
|
|
165
|
-
}: SelectionBarProviderProps) {
|
|
166
|
-
const [selectedItems, setSelectedItems] = useState<Set<string>>(new Set())
|
|
167
|
-
|
|
168
|
-
const toggleSelection = useCallback(
|
|
169
|
-
(id: string) => {
|
|
170
|
-
setSelectedItems(prev => {
|
|
171
|
-
const newSet = new Set(prev)
|
|
172
|
-
if (newSet.has(id)) {
|
|
173
|
-
newSet.delete(id)
|
|
174
|
-
} else {
|
|
175
|
-
newSet.add(id)
|
|
176
|
-
}
|
|
177
|
-
onSelectionChange?.(Array.from(newSet))
|
|
178
|
-
return newSet
|
|
179
|
-
})
|
|
180
|
-
},
|
|
181
|
-
[onSelectionChange]
|
|
182
|
-
)
|
|
183
|
-
|
|
184
|
-
const clearSelection = useCallback(() => {
|
|
185
|
-
setSelectedItems(new Set())
|
|
186
|
-
onSelectionChange?.([])
|
|
187
|
-
}, [onSelectionChange])
|
|
188
|
-
|
|
189
|
-
const selectAll = useCallback(
|
|
190
|
-
(ids: string[]) => {
|
|
191
|
-
setSelectedItems(new Set(ids))
|
|
192
|
-
onSelectionChange?.(ids)
|
|
193
|
-
},
|
|
194
|
-
[onSelectionChange]
|
|
195
|
-
)
|
|
196
|
-
|
|
197
|
-
const isSelected = useCallback(
|
|
198
|
-
(id: string) => {
|
|
199
|
-
return selectedItems.has(id)
|
|
200
|
-
},
|
|
201
|
-
[selectedItems]
|
|
202
|
-
)
|
|
203
|
-
|
|
204
|
-
const value: SelectionBarContextType = {
|
|
205
|
-
selectedItems,
|
|
206
|
-
toggleSelection,
|
|
207
|
-
clearSelection,
|
|
208
|
-
selectAll,
|
|
209
|
-
isSelected,
|
|
210
|
-
selectedCount: selectedItems.size
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
return (
|
|
214
|
-
<SelectionBarContext.Provider value={value}>
|
|
215
|
-
{children}
|
|
216
|
-
</SelectionBarContext.Provider>
|
|
217
|
-
)
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
function useSelectionBar() {
|
|
221
|
-
const context = useContext(SelectionBarContext)
|
|
222
|
-
if (!context) {
|
|
223
|
-
throw new Error(
|
|
224
|
-
'useSelectionBar must be used within a SelectionBarProvider'
|
|
225
|
-
)
|
|
226
|
-
}
|
|
227
|
-
return context
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
interface SelectionBarContainerProps
|
|
231
|
-
extends Omit<SelectionBarProps, 'selectedCount' | 'onClose'> {
|
|
232
|
-
showCloseButton?: boolean
|
|
233
|
-
closeButtonText?: string
|
|
234
|
-
selectedText?: string
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
function SelectionBarContainer({
|
|
238
|
-
actions = [],
|
|
239
|
-
showCloseButton = true,
|
|
240
|
-
selectedText,
|
|
241
|
-
...props
|
|
242
|
-
}: SelectionBarContainerProps) {
|
|
243
|
-
const { selectedCount, clearSelection } = useSelectionBar()
|
|
244
|
-
|
|
245
|
-
return (
|
|
246
|
-
<SelectionBar
|
|
247
|
-
actions={actions}
|
|
248
|
-
selectedCount={selectedCount}
|
|
249
|
-
selectedText={selectedText}
|
|
250
|
-
showCloseButton={showCloseButton}
|
|
251
|
-
onClose={() => clearSelection()}
|
|
252
|
-
{...props}
|
|
253
|
-
/>
|
|
254
|
-
)
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export const SelectionBarComponents = {
|
|
258
|
-
Root: SelectionBar,
|
|
259
|
-
Provider: SelectionBarProvider,
|
|
260
|
-
Container: SelectionBarContainer,
|
|
261
|
-
useSelectionBar
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
export { SelectionBar }
|
|
265
|
-
export { SelectionBarProvider }
|
|
266
|
-
export { SelectionBarContainer }
|
|
267
|
-
export { useSelectionBar }
|
|
268
|
-
export { selectionBarVariants }
|
|
269
|
-
export type {
|
|
270
|
-
SelectionBarProps,
|
|
271
|
-
SelectionBarProviderProps,
|
|
272
|
-
SelectionBarContainerProps
|
|
273
|
-
}
|
package/src/components/sheet.tsx
DELETED
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import * as SheetPrimitive from '@radix-ui/react-dialog'
|
|
3
|
-
import { cx } from '@xjur-ui/util'
|
|
4
|
-
import { Button } from './form/button'
|
|
5
|
-
import { Icon } from './icon'
|
|
6
|
-
|
|
7
|
-
export function SheetRoot({
|
|
8
|
-
...props
|
|
9
|
-
}: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
10
|
-
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export function SheetTrigger({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
16
|
-
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function SheetClose({
|
|
20
|
-
children = (
|
|
21
|
-
<Button appearance="ghost" size="icon_md" variant="tertiary">
|
|
22
|
-
<Icon className="text-icon-neutral-3" name="close" />
|
|
23
|
-
</Button>
|
|
24
|
-
),
|
|
25
|
-
...props
|
|
26
|
-
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
27
|
-
return (
|
|
28
|
-
<SheetPrimitive.Close data-slot="sheet-close" {...props}>
|
|
29
|
-
{children}
|
|
30
|
-
</SheetPrimitive.Close>
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function SheetPortal({
|
|
35
|
-
...props
|
|
36
|
-
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
37
|
-
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export function SheetOverlay({
|
|
41
|
-
className,
|
|
42
|
-
...props
|
|
43
|
-
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
44
|
-
return (
|
|
45
|
-
<SheetPrimitive.Overlay
|
|
46
|
-
className={cx(
|
|
47
|
-
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50',
|
|
48
|
-
className
|
|
49
|
-
)}
|
|
50
|
-
data-slot="sheet-overlay"
|
|
51
|
-
{...props}
|
|
52
|
-
/>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function SheetContent({
|
|
57
|
-
className,
|
|
58
|
-
children,
|
|
59
|
-
side = 'right',
|
|
60
|
-
overlay = false,
|
|
61
|
-
...props
|
|
62
|
-
}: React.ComponentProps<typeof SheetPrimitive.Content> & {
|
|
63
|
-
side?: 'top' | 'right' | 'bottom' | 'left'
|
|
64
|
-
overlay?: boolean
|
|
65
|
-
}) {
|
|
66
|
-
return (
|
|
67
|
-
<SheetPortal>
|
|
68
|
-
{overlay && <SheetOverlay />}
|
|
69
|
-
<SheetPrimitive.Content
|
|
70
|
-
className={cx(
|
|
71
|
-
'border-border-layer-2 bg-layer-2-idle data-[state=open]:animate-in data-[state=closed]:animate-out shadow-elevation-2 fixed z-50 flex flex-col gap-4 transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500',
|
|
72
|
-
side === 'right' &&
|
|
73
|
-
'data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm',
|
|
74
|
-
side === 'left' &&
|
|
75
|
-
'data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm',
|
|
76
|
-
side === 'top' &&
|
|
77
|
-
'data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b',
|
|
78
|
-
side === 'bottom' &&
|
|
79
|
-
'data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t',
|
|
80
|
-
className
|
|
81
|
-
)}
|
|
82
|
-
data-slot="sheet-content"
|
|
83
|
-
{...props}
|
|
84
|
-
>
|
|
85
|
-
{children}
|
|
86
|
-
</SheetPrimitive.Content>
|
|
87
|
-
</SheetPortal>
|
|
88
|
-
)
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export function SheetBody({
|
|
92
|
-
className,
|
|
93
|
-
...props
|
|
94
|
-
}: React.ComponentProps<'div'>) {
|
|
95
|
-
return <div className={cx('px-large-2x', className)} {...props} />
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
export function SheetHeader({
|
|
99
|
-
className,
|
|
100
|
-
...props
|
|
101
|
-
}: React.ComponentProps<'div'>) {
|
|
102
|
-
return (
|
|
103
|
-
<div
|
|
104
|
-
className={cx(
|
|
105
|
-
'py-large px-large-2x border-b-border-layer-2 border-b',
|
|
106
|
-
className
|
|
107
|
-
)}
|
|
108
|
-
data-slot="sheet-header"
|
|
109
|
-
{...props}
|
|
110
|
-
/>
|
|
111
|
-
)
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
export function SheetFooter({
|
|
115
|
-
className,
|
|
116
|
-
...props
|
|
117
|
-
}: React.ComponentProps<'div'>) {
|
|
118
|
-
return (
|
|
119
|
-
<div
|
|
120
|
-
className={cx(
|
|
121
|
-
'py-large px-large-2x border-t-border-layer-2 mt-auto border-t',
|
|
122
|
-
className
|
|
123
|
-
)}
|
|
124
|
-
data-slot="sheet-footer"
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
)
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
export function SheetTitle({
|
|
131
|
-
className,
|
|
132
|
-
...props
|
|
133
|
-
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
134
|
-
return (
|
|
135
|
-
<SheetPrimitive.Title
|
|
136
|
-
className={cx('text-size-title-lg font-medium', className)}
|
|
137
|
-
data-slot="sheet-title"
|
|
138
|
-
{...props}
|
|
139
|
-
/>
|
|
140
|
-
)
|
|
141
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react'
|
|
2
|
-
import { cx } from '@xjur-ui/util'
|
|
3
|
-
|
|
4
|
-
export function Skeleton({ className, ...props }: ComponentProps<'div'>) {
|
|
5
|
-
return (
|
|
6
|
-
<div
|
|
7
|
-
className={cx('bg-layer-skeleton animate-pulse', className)}
|
|
8
|
-
data-slot="skeleton"
|
|
9
|
-
{...props}
|
|
10
|
-
/>
|
|
11
|
-
)
|
|
12
|
-
}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import type { ComponentProps } from 'react'
|
|
2
|
-
import { cva, cx, type ClassVariantProps } from '@xjur-ui/util'
|
|
3
|
-
import { Typography } from './typography'
|
|
4
|
-
|
|
5
|
-
export const statusVariants = cva(
|
|
6
|
-
[
|
|
7
|
-
'inline-flex items-center justify-center px-small py-small-1x rounded-small-1x text-label-sm font-medium text-neutral-label h-large-2x'
|
|
8
|
-
],
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
success: 'bg-success-idle',
|
|
13
|
-
warning: 'bg-warning-idle',
|
|
14
|
-
danger: 'bg-danger-idle',
|
|
15
|
-
neutral: 'bg-alt-3'
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: {
|
|
19
|
-
variant: 'neutral'
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
export interface StatusProps
|
|
25
|
-
extends ComponentProps<'div'>,
|
|
26
|
-
ClassVariantProps<typeof statusVariants> {
|
|
27
|
-
text?: string
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function Status({
|
|
31
|
-
text = 'Status',
|
|
32
|
-
variant = 'neutral',
|
|
33
|
-
className,
|
|
34
|
-
...props
|
|
35
|
-
}: StatusProps) {
|
|
36
|
-
return (
|
|
37
|
-
<div className={cx(statusVariants({ variant }), className)} {...props}>
|
|
38
|
-
<Typography size="sm" variant="label" weight="medium">
|
|
39
|
-
{text}
|
|
40
|
-
</Typography>
|
|
41
|
-
</div>
|
|
42
|
-
)
|
|
43
|
-
}
|
package/src/components/table.tsx
DELETED
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import { cx } from '@xjur-ui/util'
|
|
2
|
-
import { Icon } from './icon'
|
|
3
|
-
|
|
4
|
-
export function Table({ className, ...props }: React.ComponentProps<'table'>) {
|
|
5
|
-
return (
|
|
6
|
-
<div
|
|
7
|
-
className="text-size-body-md scrollbar-thin relative w-full overflow-hidden transition-all hover:overflow-x-auto"
|
|
8
|
-
data-slot="table-container"
|
|
9
|
-
>
|
|
10
|
-
<table
|
|
11
|
-
className={cx('w-full caption-bottom', className)}
|
|
12
|
-
data-slot="table"
|
|
13
|
-
{...props}
|
|
14
|
-
/>
|
|
15
|
-
</div>
|
|
16
|
-
)
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export function TableHeader({
|
|
20
|
-
className,
|
|
21
|
-
...props
|
|
22
|
-
}: React.ComponentProps<'thead'>) {
|
|
23
|
-
return (
|
|
24
|
-
<thead
|
|
25
|
-
className={cx(
|
|
26
|
-
'group/table-header [&_tr]:border-border-layer-2 hover:bg-layer-2-hover [&_tr]:border-b',
|
|
27
|
-
className
|
|
28
|
-
)}
|
|
29
|
-
data-slot="table-header"
|
|
30
|
-
{...props}
|
|
31
|
-
/>
|
|
32
|
-
)
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function TableBody({
|
|
36
|
-
className,
|
|
37
|
-
...props
|
|
38
|
-
}: React.ComponentProps<'tbody'>) {
|
|
39
|
-
return (
|
|
40
|
-
<tbody
|
|
41
|
-
className={cx(
|
|
42
|
-
'[&_tr]:border-border-layer-2 [&_tr]:border-b [&_tr:last-child]:border-0',
|
|
43
|
-
className
|
|
44
|
-
)}
|
|
45
|
-
data-slot="table-body"
|
|
46
|
-
{...props}
|
|
47
|
-
/>
|
|
48
|
-
)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function TableFooter({
|
|
52
|
-
className,
|
|
53
|
-
...props
|
|
54
|
-
}: React.ComponentProps<'tfoot'>) {
|
|
55
|
-
return (
|
|
56
|
-
<tfoot
|
|
57
|
-
className={cx(
|
|
58
|
-
'border-border-layer-2 border-t font-medium [&>tr]:last:border-b-0',
|
|
59
|
-
className
|
|
60
|
-
)}
|
|
61
|
-
data-slot="table-footer"
|
|
62
|
-
{...props}
|
|
63
|
-
/>
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function TableRow({
|
|
68
|
-
className,
|
|
69
|
-
isSelected = false,
|
|
70
|
-
...props
|
|
71
|
-
}: React.ComponentProps<'tr'> & { isSelected?: boolean }) {
|
|
72
|
-
return (
|
|
73
|
-
<tr
|
|
74
|
-
className={cx(
|
|
75
|
-
'bg-layer-2-idle hover:bg-layer-2-hover ease border-b transition-colors duration-100',
|
|
76
|
-
'active:bg-layer-2-pressed',
|
|
77
|
-
'data-[selected=true]:bg-primary-alt-active',
|
|
78
|
-
className
|
|
79
|
-
)}
|
|
80
|
-
data-selected={isSelected}
|
|
81
|
-
data-slot="table-row"
|
|
82
|
-
{...props}
|
|
83
|
-
/>
|
|
84
|
-
)
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
export function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
|
|
88
|
-
return (
|
|
89
|
-
<th
|
|
90
|
-
className={cx(
|
|
91
|
-
'group/th text-neutral-placeholder text-size-label-sm h-large-4x py-small-1x px-small text-left align-middle font-medium whitespace-nowrap',
|
|
92
|
-
'pr-large-2x relative',
|
|
93
|
-
'animate-in fade-in duration-200 ease-in',
|
|
94
|
-
className
|
|
95
|
-
)}
|
|
96
|
-
data-slot="table-head"
|
|
97
|
-
{...props}
|
|
98
|
-
/>
|
|
99
|
-
)
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
export function TableHeadContent({
|
|
103
|
-
className,
|
|
104
|
-
...props
|
|
105
|
-
}: React.ComponentProps<'div'>) {
|
|
106
|
-
return (
|
|
107
|
-
<div
|
|
108
|
-
className={cx(
|
|
109
|
-
'gap-small pr-large-3x relative flex w-fit items-center',
|
|
110
|
-
className
|
|
111
|
-
)}
|
|
112
|
-
{...props}
|
|
113
|
-
/>
|
|
114
|
-
)
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
export function TableSort({
|
|
118
|
-
className,
|
|
119
|
-
sortedDirection,
|
|
120
|
-
...props
|
|
121
|
-
}: React.ComponentProps<'button'> & { sortedDirection?: 'asc' | 'desc' }) {
|
|
122
|
-
return (
|
|
123
|
-
<button
|
|
124
|
-
className={cx(
|
|
125
|
-
'size-large-1x rounded-small-1x',
|
|
126
|
-
'flex cursor-pointer items-center justify-center',
|
|
127
|
-
'hidden group-hover/th:flex',
|
|
128
|
-
'data-[sorted=true]:flex',
|
|
129
|
-
'transition-all duration-200 ease-out',
|
|
130
|
-
'data-[sorted=true]:bg-primary-alt-active data-[sorted=true]:text-primary-label-active',
|
|
131
|
-
'absolute top-1/2 right-0 -translate-y-1/2',
|
|
132
|
-
className
|
|
133
|
-
)}
|
|
134
|
-
data-sorted={sortedDirection !== undefined}
|
|
135
|
-
type="button"
|
|
136
|
-
{...props}
|
|
137
|
-
>
|
|
138
|
-
{sortedDirection !== undefined ? (
|
|
139
|
-
<Icon
|
|
140
|
-
name={sortedDirection === 'asc' ? 'arrow_downward' : 'arrow_upward'}
|
|
141
|
-
/>
|
|
142
|
-
) : (
|
|
143
|
-
<Icon name="swap_vert" />
|
|
144
|
-
)}
|
|
145
|
-
</button>
|
|
146
|
-
)
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
|
|
150
|
-
return (
|
|
151
|
-
<td
|
|
152
|
-
className={cx(
|
|
153
|
-
'px-small py-none h-large-8x text-left align-middle whitespace-nowrap',
|
|
154
|
-
className
|
|
155
|
-
)}
|
|
156
|
-
data-slot="table-cell"
|
|
157
|
-
{...props}
|
|
158
|
-
/>
|
|
159
|
-
)
|
|
160
|
-
}
|
package/src/components/tabs.tsx
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import * as React from 'react'
|
|
2
|
-
import * as TabsPrimitive from '@radix-ui/react-tabs'
|
|
3
|
-
import { tv } from '@xjur-ui/util'
|
|
4
|
-
|
|
5
|
-
const tabsStyles = tv({
|
|
6
|
-
slots: {
|
|
7
|
-
list: 'flex items-center gap-0',
|
|
8
|
-
trigger:
|
|
9
|
-
'inline-flex items-center justify-center gap-small px-small py-small_1x-alt h-large-4x ' +
|
|
10
|
-
'font-medium cursor-pointer transition-colors !text-size-label-md ' +
|
|
11
|
-
'disabled:opacity-38 disabled:pointer-events-none',
|
|
12
|
-
content: ''
|
|
13
|
-
},
|
|
14
|
-
variants: {
|
|
15
|
-
variant: {
|
|
16
|
-
line: {
|
|
17
|
-
trigger:
|
|
18
|
-
'rounded-small-1x text-neutral-dark border-b-[3px] border-b-transparent ' +
|
|
19
|
-
'hover:bg-layer-2-hover ' +
|
|
20
|
-
'data-[state=active]:text-primary-active ' +
|
|
21
|
-
'data-[state=active]:border-b-primary-active ' +
|
|
22
|
-
'data-[state=active]:rounded-none data-[state=active]:bg-transparent'
|
|
23
|
-
},
|
|
24
|
-
button: {
|
|
25
|
-
trigger:
|
|
26
|
-
'rounded-tl-small-1x rounded-tr-small-1x rounded-bl-none rounded-br-none px-large ' +
|
|
27
|
-
'bg-primary-idle text-neutral-label ' +
|
|
28
|
-
'hover:bg-primary-hover ' +
|
|
29
|
-
'data-[state=active]:bg-layer-2-idle data-[state=active]:text-primary-active'
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
defaultVariants: {
|
|
34
|
-
variant: 'button'
|
|
35
|
-
}
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
export function TabsRoot(
|
|
39
|
-
props: React.ComponentProps<typeof TabsPrimitive.Tabs>
|
|
40
|
-
) {
|
|
41
|
-
return <TabsPrimitive.Tabs {...props} />
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
export type TabsListProps = React.ComponentProps<typeof TabsPrimitive.TabsList>
|
|
45
|
-
|
|
46
|
-
export function TabsList({ className, ...props }: TabsListProps) {
|
|
47
|
-
const { list } = tabsStyles({})
|
|
48
|
-
return <TabsPrimitive.TabsList className={list({ className })} {...props} />
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface TabsTriggerProps
|
|
52
|
-
extends React.ComponentProps<typeof TabsPrimitive.TabsTrigger> {
|
|
53
|
-
variant?: 'line' | 'button'
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function TabsTrigger({
|
|
57
|
-
variant,
|
|
58
|
-
className,
|
|
59
|
-
...props
|
|
60
|
-
}: TabsTriggerProps) {
|
|
61
|
-
const { trigger } = tabsStyles({ variant })
|
|
62
|
-
return (
|
|
63
|
-
<TabsPrimitive.TabsTrigger className={trigger({ className })} {...props} />
|
|
64
|
-
)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
export function TabsContent(
|
|
68
|
-
props: React.ComponentProps<typeof TabsPrimitive.TabsContent>
|
|
69
|
-
) {
|
|
70
|
-
const { content } = tabsStyles()
|
|
71
|
-
return <TabsPrimitive.TabsContent className={content()} {...props} />
|
|
72
|
-
}
|