@wello-dev/core 1.0.8 → 1.0.10
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/README.md +708 -425
- package/dist/{chunk-UAEHGDZX.js → chunk-24BSU7IV.js} +3 -3
- package/dist/{chunk-QFN4MBT2.js → chunk-2ALTUYW6.js} +4 -4
- package/dist/{chunk-QHJMXGDE.js → chunk-2UNEYJJF.js} +4 -4
- package/dist/{chunk-FR7TZXY3.js → chunk-2VG5ZNGU.js} +2 -2
- package/dist/{chunk-DJR6BSCZ.js → chunk-37TFLJKE.js} +4 -4
- package/dist/{chunk-7KIXQ2XG.js → chunk-3E6CPDFP.js} +10 -12
- package/dist/chunk-3E6CPDFP.js.map +1 -0
- package/dist/chunk-5I45O67K.js +72 -0
- package/dist/chunk-5I45O67K.js.map +1 -0
- package/dist/{chunk-N54W2U6W.js → chunk-5K7AQRVG.js} +12 -14
- package/dist/chunk-5K7AQRVG.js.map +1 -0
- package/dist/{chunk-QIS6W7Q6.js → chunk-73SHWSOJ.js} +4 -4
- package/dist/{chunk-2TFJ4SMR.js → chunk-7SSHX2FH.js} +2 -2
- package/dist/chunk-7SSHX2FH.js.map +1 -0
- package/dist/{chunk-L2V4OD4Q.js → chunk-7TZIUXO2.js} +21 -8
- package/dist/chunk-7TZIUXO2.js.map +1 -0
- package/dist/{chunk-IK562BNJ.js → chunk-7XVECKHA.js} +86 -2
- package/dist/chunk-7XVECKHA.js.map +1 -0
- package/dist/{chunk-L5MO7VKZ.js → chunk-AHGQGQR7.js} +4 -4
- package/dist/{chunk-UYKK6PVB.js → chunk-ALBB3Y4A.js} +7 -9
- package/dist/{chunk-UYKK6PVB.js.map → chunk-ALBB3Y4A.js.map} +1 -1
- package/dist/{chunk-SIZ7G2KD.js → chunk-ALXA6LV4.js} +3 -3
- package/dist/{chunk-JJXJXOZ7.js → chunk-AP7JH6SR.js} +7 -9
- package/dist/chunk-AP7JH6SR.js.map +1 -0
- package/dist/{chunk-57ZKN6G3.js → chunk-AXHYEBK3.js} +5 -7
- package/dist/{chunk-57ZKN6G3.js.map → chunk-AXHYEBK3.js.map} +1 -1
- package/dist/{chunk-TIZEUZHC.js → chunk-BJP7LO5W.js} +4 -4
- package/dist/{chunk-3NXEX2BT.js → chunk-BU75W7Q4.js} +4 -4
- package/dist/{chunk-BVUV3Y3X.js → chunk-C3KE4QQD.js} +1 -1
- package/dist/chunk-C3KE4QQD.js.map +1 -0
- package/dist/{chunk-5N3F6CKC.js → chunk-CAPV377R.js} +4 -4
- package/dist/{chunk-ESMDK5GY.js → chunk-CCWXF6JK.js} +12 -14
- package/dist/{chunk-ESMDK5GY.js.map → chunk-CCWXF6JK.js.map} +1 -1
- package/dist/{chunk-DCC7EE67.js → chunk-CJQ25MRL.js} +2 -2
- package/dist/{chunk-4L4RMGVI.js → chunk-D6CFOMD6.js} +7 -9
- package/dist/{chunk-4L4RMGVI.js.map → chunk-D6CFOMD6.js.map} +1 -1
- package/dist/{chunk-EYNM2DF5.js → chunk-DBHYNZDH.js} +9 -11
- package/dist/{chunk-EYNM2DF5.js.map → chunk-DBHYNZDH.js.map} +1 -1
- package/dist/{chunk-HESG7OWV.js → chunk-DBKYMWUP.js} +4 -4
- package/dist/{chunk-GGRLDV5L.js → chunk-EIEOYMGK.js} +4 -4
- package/dist/{chunk-ZVXCVBC4.js → chunk-F2WIHXVW.js} +2 -2
- package/dist/{chunk-E2765LHX.js → chunk-GB6OBQEK.js} +6 -8
- package/dist/chunk-GB6OBQEK.js.map +1 -0
- package/dist/chunk-GIOK4AS5.js +171 -0
- package/dist/chunk-GIOK4AS5.js.map +1 -0
- package/dist/{chunk-NGXT7GNE.js → chunk-GU4YZKAD.js} +8 -10
- package/dist/{chunk-NGXT7GNE.js.map → chunk-GU4YZKAD.js.map} +1 -1
- package/dist/{chunk-62UUESHU.js → chunk-GW3ZAIEV.js} +4 -4
- package/dist/{chunk-TVOR2RGE.js → chunk-GWAJJMJL.js} +4 -4
- package/dist/chunk-GZ736JGH.js +201 -0
- package/dist/chunk-GZ736JGH.js.map +1 -0
- package/dist/{chunk-TWM6DSH4.js → chunk-H3HCCEJ7.js} +4 -6
- package/dist/{chunk-TWM6DSH4.js.map → chunk-H3HCCEJ7.js.map} +1 -1
- package/dist/{chunk-7PTDAI65.js → chunk-HFIOFIWQ.js} +6 -8
- package/dist/{chunk-7PTDAI65.js.map → chunk-HFIOFIWQ.js.map} +1 -1
- package/dist/{chunk-2GM6477D.js → chunk-HTEAWFVV.js} +4 -4
- package/dist/{chunk-OHP4OBN2.js → chunk-HUBTQ4S3.js} +107 -14
- package/dist/chunk-HUBTQ4S3.js.map +1 -0
- package/dist/{chunk-APTAGITO.js → chunk-HXPKJWSJ.js} +4 -4
- package/dist/{chunk-YFBYWNYF.js → chunk-I4G6MKPE.js} +7 -9
- package/dist/{chunk-YFBYWNYF.js.map → chunk-I4G6MKPE.js.map} +1 -1
- package/dist/{chunk-NVAE2R5E.js → chunk-IHFRJXPA.js} +55 -44
- package/dist/chunk-IHFRJXPA.js.map +1 -0
- package/dist/{chunk-R3H3IYNM.js → chunk-JAWGIIWB.js} +3 -3
- package/dist/{chunk-BZ222ZYD.js → chunk-JW2KGQCX.js} +4 -4
- package/dist/{chunk-E74HEMFS.js → chunk-JXXAEOG2.js} +4 -4
- package/dist/{chunk-ZJHKJGKJ.js → chunk-KUPY6OSY.js} +4 -4
- package/dist/chunk-L3C4THCP.js +272 -0
- package/dist/chunk-L3C4THCP.js.map +1 -0
- package/dist/{chunk-VNM5TVQZ.js → chunk-MOD47227.js} +6 -6
- package/dist/{chunk-XAHR3DK7.js → chunk-MS3CJJPY.js} +6 -8
- package/dist/{chunk-XAHR3DK7.js.map → chunk-MS3CJJPY.js.map} +1 -1
- package/dist/{chunk-2WIGWLPL.js → chunk-MYCNM4EU.js} +4 -4
- package/dist/{chunk-MWYGXAJQ.js → chunk-NFP7KZR7.js} +5 -7
- package/dist/{chunk-MWYGXAJQ.js.map → chunk-NFP7KZR7.js.map} +1 -1
- package/dist/{chunk-H4D7LXZL.js → chunk-O2B5VWJ6.js} +2 -2
- package/dist/{chunk-7EINGVGG.js → chunk-PC7CWLM6.js} +3 -3
- package/dist/{chunk-BMKZFNPD.js → chunk-PGWZVRP7.js} +4 -4
- package/dist/chunk-PGWZVRP7.js.map +1 -0
- package/dist/chunk-PPCXKPJ5.js +267 -0
- package/dist/chunk-PPCXKPJ5.js.map +1 -0
- package/dist/{chunk-ZJZUNSCO.js → chunk-PVJ57BID.js} +4 -4
- package/dist/{chunk-RJK6AQEW.js → chunk-PXVHUZ5Q.js} +4 -4
- package/dist/chunk-QALNO7TY.js +118 -0
- package/dist/chunk-QALNO7TY.js.map +1 -0
- package/dist/{chunk-RW2ATREO.js → chunk-QWTS5DHG.js} +7 -9
- package/dist/{chunk-RW2ATREO.js.map → chunk-QWTS5DHG.js.map} +1 -1
- package/dist/{chunk-YTH2T5E4.js → chunk-R34Z5PI6.js} +10 -12
- package/dist/{chunk-YTH2T5E4.js.map → chunk-R34Z5PI6.js.map} +1 -1
- package/dist/{chunk-NZQI4WL5.js → chunk-RFM3OHDV.js} +8 -8
- package/dist/{chunk-YTI5AZL4.js → chunk-RJT2AM3I.js} +6 -8
- package/dist/{chunk-YTI5AZL4.js.map → chunk-RJT2AM3I.js.map} +1 -1
- package/dist/{chunk-K3B2RENY.js → chunk-RKE7LVU5.js} +15 -15
- package/dist/chunk-RKE7LVU5.js.map +1 -0
- package/dist/{chunk-CVIHRO4Q.js → chunk-RR4NJMJV.js} +5 -7
- package/dist/{chunk-CVIHRO4Q.js.map → chunk-RR4NJMJV.js.map} +1 -1
- package/dist/{chunk-5SQC5LKY.js → chunk-S46Q6UWM.js} +3 -3
- package/dist/{chunk-KPWAEDRU.js → chunk-SOL7LLRA.js} +9 -9
- package/dist/{chunk-KPWAEDRU.js.map → chunk-SOL7LLRA.js.map} +1 -1
- package/dist/{chunk-2A6MTZBO.js → chunk-SSMOQDZN.js} +4 -4
- package/dist/{chunk-4QBFXTYH.js → chunk-T324OFTR.js} +4 -6
- package/dist/{chunk-4QBFXTYH.js.map → chunk-T324OFTR.js.map} +1 -1
- package/dist/{chunk-XPSIP4MN.js → chunk-U6Y4OQOV.js} +12 -12
- package/dist/chunk-U6Y4OQOV.js.map +1 -0
- package/dist/{chunk-ZMR3K4MX.js → chunk-UCB5LY5G.js} +4 -4
- package/dist/{chunk-NOYSHU5U.js → chunk-UF2OB25K.js} +6 -8
- package/dist/chunk-UF2OB25K.js.map +1 -0
- package/dist/{chunk-VIO22OUP.js → chunk-UFHP3FHF.js} +5 -5
- package/dist/{chunk-CGR72YL6.js → chunk-UYSN5ABM.js} +7 -9
- package/dist/chunk-UYSN5ABM.js.map +1 -0
- package/dist/{chunk-7JGIQGZP.js → chunk-V2BJI7DA.js} +5 -7
- package/dist/{chunk-7JGIQGZP.js.map → chunk-V2BJI7DA.js.map} +1 -1
- package/dist/{chunk-EJ7ZXISQ.js → chunk-VSUI3XK6.js} +4 -6
- package/dist/{chunk-EJ7ZXISQ.js.map → chunk-VSUI3XK6.js.map} +1 -1
- package/dist/{chunk-3Z5OAUG3.js → chunk-W4RZKCSN.js} +6 -6
- package/dist/{chunk-JZJ5R7XW.js → chunk-WESDWEMX.js} +6 -8
- package/dist/{chunk-JZJ5R7XW.js.map → chunk-WESDWEMX.js.map} +1 -1
- package/dist/{chunk-GSLJSEUI.js → chunk-WMI5K6FE.js} +8 -10
- package/dist/chunk-WMI5K6FE.js.map +1 -0
- package/dist/{chunk-GKBBDYNB.js → chunk-WQAJTF24.js} +4 -4
- package/dist/{chunk-HSJ27BGL.js → chunk-WVJ5TCCL.js} +4 -4
- package/dist/{chunk-B3LVDQJU.js → chunk-XHD3U7DZ.js} +4 -4
- package/dist/chunk-XP4BYVID.js +161 -0
- package/dist/chunk-XP4BYVID.js.map +1 -0
- package/dist/{chunk-DHAMBKCR.js → chunk-YZLPRSJQ.js} +4 -4
- package/dist/{chunk-7S7RIVCI.js → chunk-Z4GFLFTW.js} +7 -9
- package/dist/{chunk-7S7RIVCI.js.map → chunk-Z4GFLFTW.js.map} +1 -1
- package/dist/{chunk-3E3X5RLN.js → chunk-Z5ZC7BIC.js} +4 -4
- package/dist/{chunk-O6A7IBIW.js → chunk-ZECMUHW2.js} +3 -3
- package/dist/{chunk-MYHAWRIV.js → chunk-ZEP2ULSL.js} +2 -2
- package/dist/{chunk-HIYHBWWU.js → chunk-ZFDCQN3H.js} +10 -12
- package/dist/{chunk-HIYHBWWU.js.map → chunk-ZFDCQN3H.js.map} +1 -1
- package/dist/{chunk-TIVOXLDX.js → chunk-ZGHHUVPX.js} +2 -2
- package/dist/chunk-ZGHHUVPX.js.map +1 -0
- package/dist/{chunk-ECFQDEFL.js → chunk-ZNJS7NVN.js} +8 -10
- package/dist/chunk-ZNJS7NVN.js.map +1 -0
- package/dist/components/Accordion/Accordion.js +8 -7
- package/dist/components/ActionIcon/ActionIcon.js +6 -7
- package/dist/components/Alert/Alert.js +8 -9
- package/dist/components/AlertDialog/AlertDialog.js +47 -0
- package/dist/components/Anchor/Anchor.js +5 -6
- package/dist/components/Avatar/Avatar.js +4 -5
- package/dist/components/Badge/Badge.js +5 -6
- package/dist/components/Blockquote/Blockquote.js +4 -5
- package/dist/components/Breadcrumbs/Breadcrumbs.js +5 -6
- package/dist/components/Burger/Burger.js +5 -6
- package/dist/components/Button/Button.js +7 -8
- package/dist/components/Card/Card.js +20 -7
- package/dist/components/Carousel/Carousel.js +4 -5
- package/dist/components/Center/Center.js +4 -5
- package/dist/components/Checkbox/Checkbox.js +9 -10
- package/dist/components/Chip/Chip.js +4 -5
- package/dist/components/CloseButton/CloseButton.js +7 -8
- package/dist/components/Code/Code.js +4 -5
- package/dist/components/Collapse/Collapse.js +12 -7
- package/dist/components/ColorPicker/ColorInput.js +17 -16
- package/dist/components/ColorPicker/ColorPicker.js +5 -6
- package/dist/components/Combobox/Combobox.js +14 -13
- package/dist/components/Combobox/Pill.js +9 -10
- package/dist/components/Combobox/Select.js +18 -17
- package/dist/components/Combobox/TagsInput.js +18 -17
- package/dist/components/Command/Command.js +42 -0
- package/dist/components/Container/Container.js +4 -5
- package/dist/components/CopyButton/CopyButton.js +3 -4
- package/dist/components/CornerDialog/CornerDialog.js +19 -0
- package/dist/components/Dialog/Dialog.js +36 -13
- package/dist/components/Divider/Divider.js +4 -5
- package/dist/components/DropdownMenu/DropdownMenu.js +50 -0
- package/dist/components/Dropzone/Dropzone.js +15 -16
- package/dist/components/EmptyState/EmptyState.js +4 -5
- package/dist/components/Field/Field.js +9 -10
- package/dist/components/FileButton/FileButton.js +3 -4
- package/dist/components/Flex/Flex.js +4 -5
- package/dist/components/Grid/Grid.js +4 -5
- package/dist/components/Group/Group.js +4 -5
- package/dist/components/Image/Image.js +4 -5
- package/dist/components/Indicator/Indicator.js +4 -5
- package/dist/components/Input/Input.js +8 -9
- package/dist/components/List/List.js +4 -5
- package/dist/components/Loader/Loader.js +4 -5
- package/dist/components/Menu/Menu.js +11 -10
- package/dist/components/Modal/Drawer.js +12 -13
- package/dist/components/Modal/Modal.js +12 -13
- package/dist/components/Modal/ModalBase.js +11 -12
- package/dist/components/NavLink/NavLink.js +8 -7
- package/dist/components/Notification/Notification.js +8 -9
- package/dist/components/NumberFormatter/NumberFormatter.js +3 -4
- package/dist/components/Overlay/Overlay.js +6 -7
- package/dist/components/Pagination/Pagination.js +5 -6
- package/dist/components/Paper/Paper.js +4 -5
- package/dist/components/PhoneInput/PhoneInput.js +20 -19
- package/dist/components/PinInput/PinInput.js +4 -5
- package/dist/components/Popover/Popover.js +21 -8
- package/dist/components/Portal/Portal.js +3 -4
- package/dist/components/Progress/Progress.js +4 -5
- package/dist/components/RingProgress/RingProgress.js +4 -5
- package/dist/components/ScrollArea/ScrollArea.js +4 -5
- package/dist/components/Sheet/Sheet.js +41 -0
- package/dist/components/SimpleGrid/SimpleGrid.js +4 -5
- package/dist/components/Skeleton/Skeleton.js +4 -5
- package/dist/components/Slider/Slider.js +4 -5
- package/dist/components/Spoiler/Spoiler.js +6 -7
- package/dist/components/Stack/Stack.js +4 -5
- package/dist/components/Stepper/Stepper.js +6 -7
- package/dist/components/Table/Table.js +18 -19
- package/dist/components/Tabs/Tabs.js +5 -6
- package/dist/components/Text/Text.js +4 -5
- package/dist/components/TextInput/TextInput.js +10 -11
- package/dist/components/ThemeIcon/ThemeIcon.js +4 -5
- package/dist/components/ThemeToggle/ThemeToggle.js +8 -9
- package/dist/components/Timeline/Timeline.js +4 -5
- package/dist/components/Title/Title.js +4 -5
- package/dist/components/Toggle/Toggle.js +5 -6
- package/dist/components/Tooltip/Tooltip.js +18 -10
- package/dist/components/Transition/Transition.js +3 -4
- package/dist/components/Typography/Typography.js +4 -5
- package/dist/components/UnstyledButton/UnstyledButton.js +4 -5
- package/dist/components/VisuallyHidden/VisuallyHidden.js +3 -4
- package/dist/core/index.js +13 -15
- package/dist/index.cjs +2427 -2061
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1512 -1494
- package/dist/index.d.ts +1512 -1494
- package/dist/index.js +268 -282
- package/dist/styles.css +3846 -3806
- package/package.json +78 -78
- package/dist/chunk-2TFJ4SMR.js.map +0 -1
- package/dist/chunk-5BD5JJVJ.js +0 -71
- package/dist/chunk-5BD5JJVJ.js.map +0 -1
- package/dist/chunk-652ZEQV7.js +0 -268
- package/dist/chunk-652ZEQV7.js.map +0 -1
- package/dist/chunk-7KIXQ2XG.js.map +0 -1
- package/dist/chunk-BMKZFNPD.js.map +0 -1
- package/dist/chunk-BVUV3Y3X.js.map +0 -1
- package/dist/chunk-CGR72YL6.js.map +0 -1
- package/dist/chunk-E2765LHX.js.map +0 -1
- package/dist/chunk-ECFQDEFL.js.map +0 -1
- package/dist/chunk-GSLJSEUI.js.map +0 -1
- package/dist/chunk-HBBXBVK6.js +0 -61
- package/dist/chunk-HBBXBVK6.js.map +0 -1
- package/dist/chunk-IK562BNJ.js.map +0 -1
- package/dist/chunk-JHBUYAOW.js +0 -203
- package/dist/chunk-JHBUYAOW.js.map +0 -1
- package/dist/chunk-JJXJXOZ7.js.map +0 -1
- package/dist/chunk-K3B2RENY.js.map +0 -1
- package/dist/chunk-L2V4OD4Q.js.map +0 -1
- package/dist/chunk-MO6GW5AX.js +0 -85
- package/dist/chunk-MO6GW5AX.js.map +0 -1
- package/dist/chunk-MWWNTAPV.js +0 -276
- package/dist/chunk-MWWNTAPV.js.map +0 -1
- package/dist/chunk-N54W2U6W.js.map +0 -1
- package/dist/chunk-NOYSHU5U.js.map +0 -1
- package/dist/chunk-NVAE2R5E.js.map +0 -1
- package/dist/chunk-OHP4OBN2.js.map +0 -1
- package/dist/chunk-ORHFHJKL.js +0 -89
- package/dist/chunk-ORHFHJKL.js.map +0 -1
- package/dist/chunk-TIVOXLDX.js.map +0 -1
- package/dist/chunk-XPSIP4MN.js.map +0 -1
- package/dist/shadcn/Command.js +0 -45
- package/dist/shadcn/Dialog.js +0 -80
- package/dist/shadcn/Floating.js +0 -74
- package/dist/shadcn/Parts.js +0 -53
- package/dist/shadcn/shared.js +0 -20
- /package/dist/{chunk-UAEHGDZX.js.map → chunk-24BSU7IV.js.map} +0 -0
- /package/dist/{chunk-QFN4MBT2.js.map → chunk-2ALTUYW6.js.map} +0 -0
- /package/dist/{chunk-QHJMXGDE.js.map → chunk-2UNEYJJF.js.map} +0 -0
- /package/dist/{chunk-FR7TZXY3.js.map → chunk-2VG5ZNGU.js.map} +0 -0
- /package/dist/{chunk-DJR6BSCZ.js.map → chunk-37TFLJKE.js.map} +0 -0
- /package/dist/{chunk-QIS6W7Q6.js.map → chunk-73SHWSOJ.js.map} +0 -0
- /package/dist/{chunk-L5MO7VKZ.js.map → chunk-AHGQGQR7.js.map} +0 -0
- /package/dist/{chunk-SIZ7G2KD.js.map → chunk-ALXA6LV4.js.map} +0 -0
- /package/dist/{chunk-TIZEUZHC.js.map → chunk-BJP7LO5W.js.map} +0 -0
- /package/dist/{chunk-3NXEX2BT.js.map → chunk-BU75W7Q4.js.map} +0 -0
- /package/dist/{chunk-5N3F6CKC.js.map → chunk-CAPV377R.js.map} +0 -0
- /package/dist/{chunk-DCC7EE67.js.map → chunk-CJQ25MRL.js.map} +0 -0
- /package/dist/{chunk-HESG7OWV.js.map → chunk-DBKYMWUP.js.map} +0 -0
- /package/dist/{chunk-GGRLDV5L.js.map → chunk-EIEOYMGK.js.map} +0 -0
- /package/dist/{chunk-ZVXCVBC4.js.map → chunk-F2WIHXVW.js.map} +0 -0
- /package/dist/{chunk-62UUESHU.js.map → chunk-GW3ZAIEV.js.map} +0 -0
- /package/dist/{chunk-TVOR2RGE.js.map → chunk-GWAJJMJL.js.map} +0 -0
- /package/dist/{chunk-2GM6477D.js.map → chunk-HTEAWFVV.js.map} +0 -0
- /package/dist/{chunk-APTAGITO.js.map → chunk-HXPKJWSJ.js.map} +0 -0
- /package/dist/{chunk-R3H3IYNM.js.map → chunk-JAWGIIWB.js.map} +0 -0
- /package/dist/{chunk-BZ222ZYD.js.map → chunk-JW2KGQCX.js.map} +0 -0
- /package/dist/{chunk-E74HEMFS.js.map → chunk-JXXAEOG2.js.map} +0 -0
- /package/dist/{chunk-ZJHKJGKJ.js.map → chunk-KUPY6OSY.js.map} +0 -0
- /package/dist/{chunk-VNM5TVQZ.js.map → chunk-MOD47227.js.map} +0 -0
- /package/dist/{chunk-2WIGWLPL.js.map → chunk-MYCNM4EU.js.map} +0 -0
- /package/dist/{chunk-H4D7LXZL.js.map → chunk-O2B5VWJ6.js.map} +0 -0
- /package/dist/{chunk-7EINGVGG.js.map → chunk-PC7CWLM6.js.map} +0 -0
- /package/dist/{chunk-ZJZUNSCO.js.map → chunk-PVJ57BID.js.map} +0 -0
- /package/dist/{chunk-RJK6AQEW.js.map → chunk-PXVHUZ5Q.js.map} +0 -0
- /package/dist/{chunk-NZQI4WL5.js.map → chunk-RFM3OHDV.js.map} +0 -0
- /package/dist/{chunk-5SQC5LKY.js.map → chunk-S46Q6UWM.js.map} +0 -0
- /package/dist/{chunk-2A6MTZBO.js.map → chunk-SSMOQDZN.js.map} +0 -0
- /package/dist/{chunk-ZMR3K4MX.js.map → chunk-UCB5LY5G.js.map} +0 -0
- /package/dist/{chunk-VIO22OUP.js.map → chunk-UFHP3FHF.js.map} +0 -0
- /package/dist/{chunk-3Z5OAUG3.js.map → chunk-W4RZKCSN.js.map} +0 -0
- /package/dist/{chunk-GKBBDYNB.js.map → chunk-WQAJTF24.js.map} +0 -0
- /package/dist/{chunk-HSJ27BGL.js.map → chunk-WVJ5TCCL.js.map} +0 -0
- /package/dist/{chunk-B3LVDQJU.js.map → chunk-XHD3U7DZ.js.map} +0 -0
- /package/dist/{chunk-DHAMBKCR.js.map → chunk-YZLPRSJQ.js.map} +0 -0
- /package/dist/{chunk-3E3X5RLN.js.map → chunk-Z5ZC7BIC.js.map} +0 -0
- /package/dist/{chunk-O6A7IBIW.js.map → chunk-ZECMUHW2.js.map} +0 -0
- /package/dist/{chunk-MYHAWRIV.js.map → chunk-ZEP2ULSL.js.map} +0 -0
- /package/dist/{shadcn/Command.js.map → components/AlertDialog/AlertDialog.js.map} +0 -0
- /package/dist/{shadcn/Dialog.js.map → components/Command/Command.js.map} +0 -0
- /package/dist/{shadcn/Floating.js.map → components/CornerDialog/CornerDialog.js.map} +0 -0
- /package/dist/{shadcn/Parts.js.map → components/DropdownMenu/DropdownMenu.js.map} +0 -0
- /package/dist/{shadcn/shared.js.map → components/Sheet/Sheet.js.map} +0 -0
package/README.md
CHANGED
|
@@ -1,425 +1,708 @@
|
|
|
1
|
-
# @wello-dev/core
|
|
2
|
-
|
|
3
|
-
React components with a theme, a Styles API, style props, dark mode and RTL built in. It is the base that the other `@wello-dev` packages (dates, charts, editor, map, notifications) build on.
|
|
4
|
-
|
|
5
|
-
- **110 components**: layout, buttons, inputs, navigation, feedback, overlays, data display and typography.
|
|
6
|
-
- **Themed**: one primary color, shades worked out for you, a color per color scheme.
|
|
7
|
-
- **Styles API**: restyle any part of any component with `classNames`, `styles` or CSS variables.
|
|
8
|
-
- **Style props**: `mt`, `w`, `c`, `bg`… on every component, responsive too.
|
|
9
|
-
- **Dark mode and RTL** need no extra setup. Every built-in text can be translated.
|
|
10
|
-
- **Accessible**: roles, labels, focus handling and keyboard support are part of the components.
|
|
11
|
-
- **Tree-shakable**: the JavaScript is split per component, so your bundler keeps only what you import.
|
|
12
|
-
- **
|
|
13
|
-
|
|
14
|
-
**On this page:** [Install](#install) · [Setup](#setup) · [Components](#components) · [Styling](#styling) · [Theme](#theme) · [Dark mode and RTL](#dark-mode-and-rtl) · [Theme toggle](#theme-toggle) · [Translating the texts](#translating-the-built-in-texts) · [Dropzone](#dropzone) · [Your API](#your-api) · [Build your own components](#build-your-own-components) · [Utilities](#utilities) · [Scrollbars](#scrollbars) · [Carousel arrows](#carousel-arrows)
|
|
15
|
-
|
|
16
|
-
## Install
|
|
17
|
-
|
|
18
|
-
```bash
|
|
19
|
-
pnpm add @wello-dev/core
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
Needs React 18 or newer.
|
|
23
|
-
|
|
24
|
-
## Setup
|
|
25
|
-
|
|
26
|
-
Both are required, once, at the root of your app. `WelloProvider` is needed even with no props: components throw without it.
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
import "@wello-dev/core/styles.css";
|
|
30
|
-
import { WelloProvider } from "@wello-dev/core";
|
|
31
|
-
|
|
32
|
-
<WelloProvider>
|
|
33
|
-
<App />
|
|
34
|
-
</WelloProvider>
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
Then use any component:
|
|
38
|
-
|
|
39
|
-
```tsx
|
|
40
|
-
import { Button, Group, TextInput } from "@wello-dev/core";
|
|
41
|
-
|
|
42
|
-
<Group>
|
|
43
|
-
<TextInput label="Email" placeholder="you@example.com" />
|
|
44
|
-
<Button variant="outline" color="teal">Save</Button>
|
|
45
|
-
</Group>
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
`WelloProvider` takes:
|
|
49
|
-
|
|
50
|
-
| Prop | What it does |
|
|
51
|
-
| --- | --- |
|
|
52
|
-
| `theme` | Your `createWelloConfig({ … })`, merged over the default theme |
|
|
53
|
-
| `defaultColorScheme` | `"light"` (default), `"dark"` or `"auto"` |
|
|
54
|
-
| `forceColorScheme` | Always `"light"` or `"dark"` |
|
|
55
|
-
| `colorSchemeManager` | Where the choice is saved. Default: `localStorage`; `null` to not save |
|
|
56
|
-
| `cssVariablesSelector` | Where the theme variables are written. Default: `:root` |
|
|
57
|
-
| `withCssVariables` | Write the theme variables. Default: `true` |
|
|
58
|
-
| `labels` | Translated built-in texts (see below) |
|
|
59
|
-
|
|
60
|
-
Where your API is (`api` in the theme) is under [Your API](#your-api).
|
|
61
|
-
|
|
62
|
-
## Components
|
|
63
|
-
|
|
64
|
-
### Layout
|
|
65
|
-
|
|
66
|
-
| Component | What it is |
|
|
67
|
-
| --- | --- |
|
|
68
|
-
| `AspectRatio` | Keeps a box (image, video, map) at a width / height ratio |
|
|
69
|
-
| `Center` | Centers its children both ways |
|
|
70
|
-
| `Container` | Centers content with a max width and side padding |
|
|
71
|
-
| `Flex` | Flexbox with every option responsive |
|
|
72
|
-
| `Grid` | Column grid |
|
|
73
|
-
| `Group` | Children in a row with even gaps |
|
|
74
|
-
| `Paper` | Surface with background, radius, optional border and shadow |
|
|
75
|
-
| `SimpleGrid` | Equal-width columns |
|
|
76
|
-
| `Space` | Empty space: `<Space h="md" />` or `<Space w="xl" />` |
|
|
77
|
-
| `Stack` | Children in a column with even gaps |
|
|
78
|
-
|
|
79
|
-
### Buttons
|
|
80
|
-
|
|
81
|
-
| Component | What it is |
|
|
82
|
-
| --- | --- |
|
|
83
|
-
| `Button` | Button with `variant`, `size`, `color`, `leftSection`, `loading`, `asChild` |
|
|
84
|
-
| `ActionIcon` | Icon button. Give it an `aria-label` |
|
|
85
|
-
| `Burger` | Menu button that turns into a × |
|
|
86
|
-
| `CloseButton` | The × button of dialogs, alerts and inputs |
|
|
87
|
-
| `CopyButton` | Copies text to the clipboard; you render the button |
|
|
88
|
-
| `ThemeToggle`, `ThemeToggleButton` | Light / dark switch with an animation: [`ThemeToggle`](#theme-toggle) changes the scheme itself, `ThemeToggleButton` only draws and animates |
|
|
89
|
-
| `UnstyledButton` | A button with no styles but the focus ring; the base of the clickable components |
|
|
90
|
-
|
|
91
|
-
### Inputs
|
|
92
|
-
|
|
93
|
-
| Component | What it is |
|
|
94
|
-
| --- | --- |
|
|
95
|
-
| `TextInput`, `Textarea` | Text fields with label, description and error. `Textarea` can `autosize` |
|
|
96
|
-
| `PasswordInput` | Password field with a show / hide button |
|
|
97
|
-
| `NumberInput` | Min / max / step, decimals, separators, prefix / suffix, ▲▼ controls |
|
|
98
|
-
| `PhoneInput` | Phone number with a dial code; digits only, limited per country. With no `countries`, `loadCountries` or `endpoint` it lists every country, starting on Egypt |
|
|
99
|
-
| `PinInput` | Code cells: auto-advance, backspace back, paste fills all |
|
|
100
|
-
| `Select`, `TagsInput` | One option from a list (any shape of option), and free-form tags |
|
|
101
|
-
| `Checkbox`, `Radio`, `Switch`, `Toggle` | Choices. `Checkbox` and `Switch` take `onChange` or `onCheckedChange` |
|
|
102
|
-
| `Chip`, `SegmentedControl` | Selectable pills, and tabs-like single choice with a sliding indicator |
|
|
103
|
-
| `Slider`, `RangeSlider`, `Rating` | Sliders with marks and keyboard support (RTL aware), and star rating |
|
|
104
|
-
| `ColorInput`, `ColorPicker`, `AlphaSlider`, `HueSlider` | Color fields and panels |
|
|
105
|
-
| `FileInput`, `FileButton`, [`Dropzone`](#dropzone) | Pick or drop files |
|
|
106
|
-
| `Field`, `Fieldset`, `Label`, `Input` | One form row, a group with a legend, a label, and the styled field that every input is built on |
|
|
107
|
-
| `Pill`, `PillsInput` | Small removable values, and an input that holds them |
|
|
108
|
-
|
|
109
|
-
### Navigation
|
|
110
|
-
|
|
111
|
-
| Component | What it is |
|
|
112
|
-
| --- | --- |
|
|
113
|
-
| `Accordion` | Expandable sections, single or multiple open |
|
|
114
|
-
| `Anchor` | Link styled as text. Use `component` for router links |
|
|
115
|
-
| `Breadcrumbs`, `Breadcrumb` | Path of links with separators |
|
|
116
|
-
| `NavLink` | Sidebar link, with nested links that expand |
|
|
117
|
-
| `Pagination` | Page buttons with dots and edges (RTL aware) |
|
|
118
|
-
| `Stepper` | Multi-step flow |
|
|
119
|
-
| `Tabs`, `TabCount` | Tabs, and a count bubble for a tab |
|
|
120
|
-
|
|
121
|
-
### Feedback
|
|
122
|
-
|
|
123
|
-
| Component | What it is |
|
|
124
|
-
| --- | --- |
|
|
125
|
-
| `Alert` | Message box with color, icon, title and close button |
|
|
126
|
-
| `EmptyState` | "Nothing here yet" for empty lists, searches and pages |
|
|
127
|
-
| `Loader` | Spinner: `oval`, `bars` or `dots` |
|
|
128
|
-
| `Notification` | Static notification card (for toasts see `@wello-dev/notifications`) |
|
|
129
|
-
| `Progress`, `RingProgress`, `SemiCircleProgress` | Bar, circle and half-circle progress |
|
|
130
|
-
| `Skeleton` | Loading placeholder that wraps the real content |
|
|
131
|
-
|
|
132
|
-
### Overlays
|
|
133
|
-
|
|
134
|
-
| Component | What it is |
|
|
135
|
-
| --- | --- |
|
|
136
|
-
| `Modal` | Dialog window: overlay, focus trap, scroll lock, Escape and outside click |
|
|
137
|
-
| `Drawer` | Panel sliding in from an edge |
|
|
138
|
-
| `Dialog`, `Sheet`, `AlertDialog` |
|
|
139
|
-
| `CornerDialog` | Small non-modal window fixed to a corner (cookie notice, quick feedback) |
|
|
140
|
-
| `Popover`, `Tooltip` |
|
|
141
|
-
| `Menu`, `DropdownMenu` | Dropdown menus with keyboard navigation |
|
|
142
|
-
| `Command` | Searchable list of actions, on top of cmdk |
|
|
143
|
-
| `Overlay`, `LoadingOverlay` | Dim layer, and one that covers its parent with a loader |
|
|
144
|
-
|
|
145
|
-
### Data display
|
|
146
|
-
|
|
147
|
-
| Component | What it is |
|
|
148
|
-
| --- | --- |
|
|
149
|
-
| `Avatar`, `Badge`, `ThemeIcon`, `Indicator`, `ColorSwatch` | Small visuals |
|
|
150
|
-
| `Card` | `Paper` with padding and edge-to-edge sections (`CardHeader`, `CardContent`, …) |
|
|
151
|
-
| `Table` | Built from parts (`TableRow`, `TableCell`, …) or from `data` |
|
|
152
|
-
| `Carousel` | Touch, arrows, dots, autoplay, effects and thumbnails, on top of Swiper |
|
|
153
|
-
| `Image`, `BackgroundImage` | Image with radius, fit and fallback, and a box with a cover image |
|
|
154
|
-
| `Timeline` | Vertical list of events |
|
|
155
|
-
| `Spoiler`, `
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
| `
|
|
163
|
-
| `
|
|
164
|
-
| `
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
| `
|
|
172
|
-
| `
|
|
173
|
-
| `
|
|
174
|
-
| `
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
|
180
|
-
|
|
|
181
|
-
| `
|
|
182
|
-
| `
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
- **`
|
|
201
|
-
- **`
|
|
202
|
-
-
|
|
203
|
-
- **
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
colors: {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
1
|
+
# @wello-dev/core
|
|
2
|
+
|
|
3
|
+
React components with a theme, a Styles API, style props, dark mode and RTL built in. It is the base that the other `@wello-dev` packages (dates, charts, editor, map, notifications) build on.
|
|
4
|
+
|
|
5
|
+
- **110 components**: layout, buttons, inputs, navigation, feedback, overlays, data display and typography.
|
|
6
|
+
- **Themed**: one primary color, shades worked out for you, a color per color scheme.
|
|
7
|
+
- **Styles API**: restyle any part of any component with `classNames`, `styles` or CSS variables.
|
|
8
|
+
- **Style props**: `mt`, `w`, `c`, `bg`… on every component, responsive too.
|
|
9
|
+
- **Dark mode and RTL** need no extra setup. Every built-in text can be translated.
|
|
10
|
+
- **Accessible**: roles, labels, focus handling and keyboard support are part of the components.
|
|
11
|
+
- **Tree-shakable**: the JavaScript is split per component, so your bundler keeps only what you import.
|
|
12
|
+
- **Composable parts too**: `Button`, `Dialog`, `Sheet`, `Popover`, `Tooltip`, `DropdownMenu`, `Command`, `Tabs`… also accept `variant` / `size` / `asChild` and composable parts (`DialogContent`, `PopoverTrigger`…) as well as the extended props.
|
|
13
|
+
|
|
14
|
+
**On this page:** [Install](#install) · [Setup](#setup) · [Components](#components) · [Styling](#styling) · [Theme](#theme) · [Dark mode and RTL](#dark-mode-and-rtl) · [Theme toggle](#theme-toggle) · [Translating the texts](#translating-the-built-in-texts) · [Dropzone](#dropzone) · [Your API](#your-api) · [Build your own components](#build-your-own-components) · [Utilities](#utilities) · [Scrollbars](#scrollbars) · [Carousel arrows](#carousel-arrows)
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
pnpm add @wello-dev/core
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Needs React 18 or newer.
|
|
23
|
+
|
|
24
|
+
## Setup
|
|
25
|
+
|
|
26
|
+
Both are required, once, at the root of your app. `WelloProvider` is needed even with no props: components throw without it.
|
|
27
|
+
|
|
28
|
+
```tsx
|
|
29
|
+
import "@wello-dev/core/styles.css";
|
|
30
|
+
import { WelloProvider } from "@wello-dev/core";
|
|
31
|
+
|
|
32
|
+
<WelloProvider>
|
|
33
|
+
<App />
|
|
34
|
+
</WelloProvider>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Then use any component:
|
|
38
|
+
|
|
39
|
+
```tsx
|
|
40
|
+
import { Button, Group, TextInput } from "@wello-dev/core";
|
|
41
|
+
|
|
42
|
+
<Group>
|
|
43
|
+
<TextInput label="Email" placeholder="you@example.com" />
|
|
44
|
+
<Button variant="outline" color="teal">Save</Button>
|
|
45
|
+
</Group>
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`WelloProvider` takes:
|
|
49
|
+
|
|
50
|
+
| Prop | What it does |
|
|
51
|
+
| --- | --- |
|
|
52
|
+
| `theme` | Your `createWelloConfig({ … })`, merged over the default theme |
|
|
53
|
+
| `defaultColorScheme` | `"light"` (default), `"dark"` or `"auto"` |
|
|
54
|
+
| `forceColorScheme` | Always `"light"` or `"dark"` |
|
|
55
|
+
| `colorSchemeManager` | Where the choice is saved. Default: `localStorage`; `null` to not save |
|
|
56
|
+
| `cssVariablesSelector` | Where the theme variables are written. Default: `:root` |
|
|
57
|
+
| `withCssVariables` | Write the theme variables. Default: `true` |
|
|
58
|
+
| `labels` | Translated built-in texts (see below) |
|
|
59
|
+
|
|
60
|
+
Where your API is (`api` in the theme) is under [Your API](#your-api).
|
|
61
|
+
|
|
62
|
+
## Components
|
|
63
|
+
|
|
64
|
+
### Layout
|
|
65
|
+
|
|
66
|
+
| Component | What it is |
|
|
67
|
+
| --- | --- |
|
|
68
|
+
| `AspectRatio` | Keeps a box (image, video, map) at a width / height ratio |
|
|
69
|
+
| `Center` | Centers its children both ways |
|
|
70
|
+
| `Container` | Centers content with a max width and side padding |
|
|
71
|
+
| `Flex` | Flexbox with every option responsive |
|
|
72
|
+
| `Grid` | Column grid |
|
|
73
|
+
| `Group` | Children in a row with even gaps |
|
|
74
|
+
| `Paper` | Surface with background, radius, optional border and shadow |
|
|
75
|
+
| `SimpleGrid` | Equal-width columns |
|
|
76
|
+
| `Space` | Empty space: `<Space h="md" />` or `<Space w="xl" />` |
|
|
77
|
+
| `Stack` | Children in a column with even gaps |
|
|
78
|
+
|
|
79
|
+
### Buttons
|
|
80
|
+
|
|
81
|
+
| Component | What it is |
|
|
82
|
+
| --- | --- |
|
|
83
|
+
| `Button` | Button with `variant`, `size`, `color`, `leftSection`, `loading`, `asChild` |
|
|
84
|
+
| `ActionIcon` | Icon button. Give it an `aria-label` |
|
|
85
|
+
| `Burger` | Menu button that turns into a × |
|
|
86
|
+
| `CloseButton` | The × button of dialogs, alerts and inputs |
|
|
87
|
+
| `CopyButton` | Copies text to the clipboard; you render the button |
|
|
88
|
+
| `ThemeToggle`, `ThemeToggleButton` | Light / dark switch with an animation: [`ThemeToggle`](#theme-toggle) changes the scheme itself, `ThemeToggleButton` only draws and animates |
|
|
89
|
+
| `UnstyledButton` | A button with no styles but the focus ring; the base of the clickable components |
|
|
90
|
+
|
|
91
|
+
### Inputs
|
|
92
|
+
|
|
93
|
+
| Component | What it is |
|
|
94
|
+
| --- | --- |
|
|
95
|
+
| `TextInput`, `Textarea` | Text fields with label, description and error. `Textarea` can `autosize` |
|
|
96
|
+
| `PasswordInput` | Password field with a show / hide button |
|
|
97
|
+
| `NumberInput` | Min / max / step, decimals, separators, prefix / suffix, ▲▼ controls |
|
|
98
|
+
| `PhoneInput` | Phone number with a dial code; digits only, limited per country. With no `countries`, `loadCountries` or `endpoint` it lists every country, starting on Egypt |
|
|
99
|
+
| `PinInput` | Code cells: auto-advance, backspace back, paste fills all |
|
|
100
|
+
| `Select`, `TagsInput` | One option from a list (any shape of option), and free-form tags |
|
|
101
|
+
| `Checkbox`, `Radio`, `Switch`, `Toggle` | Choices. `Checkbox` and `Switch` take `onChange` or `onCheckedChange` |
|
|
102
|
+
| `Chip`, `SegmentedControl` | Selectable pills, and tabs-like single choice with a sliding indicator |
|
|
103
|
+
| `Slider`, `RangeSlider`, `Rating` | Sliders with marks and keyboard support (RTL aware), and star rating |
|
|
104
|
+
| `ColorInput`, `ColorPicker`, `AlphaSlider`, `HueSlider` | Color fields and panels |
|
|
105
|
+
| `FileInput`, `FileButton`, [`Dropzone`](#dropzone) | Pick or drop files |
|
|
106
|
+
| `Field`, `Fieldset`, `Label`, `Input` | One form row, a group with a legend, a label, and the styled field that every input is built on |
|
|
107
|
+
| `Pill`, `PillsInput` | Small removable values, and an input that holds them |
|
|
108
|
+
|
|
109
|
+
### Navigation
|
|
110
|
+
|
|
111
|
+
| Component | What it is |
|
|
112
|
+
| --- | --- |
|
|
113
|
+
| `Accordion` | Expandable sections, single or multiple open |
|
|
114
|
+
| `Anchor` | Link styled as text. Use `component` for router links |
|
|
115
|
+
| `Breadcrumbs`, `Breadcrumb` | Path of links with separators |
|
|
116
|
+
| `NavLink` | Sidebar link, with nested links that expand |
|
|
117
|
+
| `Pagination` | Page buttons with dots and edges (RTL aware) |
|
|
118
|
+
| `Stepper` | Multi-step flow |
|
|
119
|
+
| `Tabs`, `TabCount` | Tabs, and a count bubble for a tab |
|
|
120
|
+
|
|
121
|
+
### Feedback
|
|
122
|
+
|
|
123
|
+
| Component | What it is |
|
|
124
|
+
| --- | --- |
|
|
125
|
+
| `Alert` | Message box with color, icon, title and close button |
|
|
126
|
+
| `EmptyState` | "Nothing here yet" for empty lists, searches and pages |
|
|
127
|
+
| `Loader` | Spinner: `oval`, `bars` or `dots` |
|
|
128
|
+
| `Notification` | Static notification card (for toasts see `@wello-dev/notifications`) |
|
|
129
|
+
| `Progress`, `RingProgress`, `SemiCircleProgress` | Bar, circle and half-circle progress |
|
|
130
|
+
| `Skeleton` | Loading placeholder that wraps the real content |
|
|
131
|
+
|
|
132
|
+
### Overlays
|
|
133
|
+
|
|
134
|
+
| Component | What it is |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| `Modal` | Dialog window: overlay, focus trap, scroll lock, Escape and outside click |
|
|
137
|
+
| `Drawer` | Panel sliding in from an edge |
|
|
138
|
+
| `Dialog`, `Sheet`, `AlertDialog` | Dialog, side sheet and confirmation dialog, with their parts (`DialogContent`, `SheetHeader`, …) |
|
|
139
|
+
| `CornerDialog` | Small non-modal window fixed to a corner (cookie notice, quick feedback) |
|
|
140
|
+
| `Popover`, `Tooltip` | Composable parts (`PopoverTrigger` / `PopoverContent`, `TooltipTrigger` / `TooltipContent`) or `Popover.Target` and a `label` prop |
|
|
141
|
+
| `Menu`, `DropdownMenu` | Dropdown menus with keyboard navigation |
|
|
142
|
+
| `Command` | Searchable list of actions, on top of cmdk |
|
|
143
|
+
| `Overlay`, `LoadingOverlay` | Dim layer, and one that covers its parent with a loader |
|
|
144
|
+
|
|
145
|
+
### Data display
|
|
146
|
+
|
|
147
|
+
| Component | What it is |
|
|
148
|
+
| --- | --- |
|
|
149
|
+
| `Avatar`, `Badge`, `ThemeIcon`, `Indicator`, `ColorSwatch` | Small visuals |
|
|
150
|
+
| `Card` | `Paper` with padding and edge-to-edge sections (`CardHeader`, `CardContent`, …) |
|
|
151
|
+
| `Table` | Built from parts (`TableRow`, `TableCell`, …) or from `data` |
|
|
152
|
+
| `Carousel` | Touch, arrows, dots, autoplay, effects and thumbnails, on top of Swiper |
|
|
153
|
+
| `Image`, `BackgroundImage` | Image with radius, fit and fallback, and a box with a cover image |
|
|
154
|
+
| `Timeline` | Vertical list of events |
|
|
155
|
+
| `Spoiler`, `Collapse` | Long content cut to a height, and animated show / hide: `<Collapse open={opened}>`, or `<Collapse>` with `CollapseTrigger` and `CollapseContent` (`in` still works as the older name of `open`) |
|
|
156
|
+
|
|
157
|
+
### Typography
|
|
158
|
+
|
|
159
|
+
| Component | What it is |
|
|
160
|
+
| --- | --- |
|
|
161
|
+
| `Text`, `Title` | Text with theme sizes, colors, clamping; `h1`–`h6` |
|
|
162
|
+
| `Blockquote`, `Code`, `Kbd`, `Mark`, `Highlight`, `List` | Quotes, code, keys, marked text, matches marked in a string, lists |
|
|
163
|
+
| `NumberFormatter` | Prints a formatted number |
|
|
164
|
+
| `Typography` | Styles raw HTML (CMS content, markdown output): headings, lists, tables, quotes, code, images |
|
|
165
|
+
|
|
166
|
+
### Miscellaneous
|
|
167
|
+
|
|
168
|
+
| Component | What it is |
|
|
169
|
+
| --- | --- |
|
|
170
|
+
| `Collapse`, `Transition` | Animated show / hide, and mount / unmount with an animation |
|
|
171
|
+
| `Divider` | Line between content, optionally with a label |
|
|
172
|
+
| `Portal`, `OptionalPortal` | Render children elsewhere in the DOM |
|
|
173
|
+
| `ScrollArea` | Scrollable box with custom scrollbars; scrolling stays native |
|
|
174
|
+
| `VisuallyHidden` | Hidden on screen, read by screen readers |
|
|
175
|
+
|
|
176
|
+
### Base
|
|
177
|
+
|
|
178
|
+
| Component | What it is |
|
|
179
|
+
| --- | --- |
|
|
180
|
+
| `WelloProvider`, `DirectionProvider` | Theme, color scheme, texts and text direction |
|
|
181
|
+
| `Box` | The base of every component: `component`, style props, `mod`, `renderRoot` |
|
|
182
|
+
| `Slot` | Renders its only child with props merged in (what `asChild` uses) |
|
|
183
|
+
|
|
184
|
+
## Styling
|
|
185
|
+
|
|
186
|
+
Every component takes style props (responsive too) and exposes its parts by name:
|
|
187
|
+
|
|
188
|
+
```tsx
|
|
189
|
+
<Button mt="md" w={{ base: "100%", sm: "auto" }}>Pay</Button>
|
|
190
|
+
|
|
191
|
+
<Modal
|
|
192
|
+
opened={opened}
|
|
193
|
+
onClose={close}
|
|
194
|
+
classNames={{ title: "my-title", body: "my-body" }}
|
|
195
|
+
styles={{ content: { borderRadius: 24 } }}
|
|
196
|
+
/>
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
- **`classNames`, `styles`**: one class or style per part. `unstyled` removes the component's own styles.
|
|
200
|
+
- **`vars`**: change the CSS variables a component sets, e.g. `vars={() => ({ root: { "--button-height": "3rem" } })}`.
|
|
201
|
+
- **`component`**: render another element or your router's link: `<Button component="a" href="/">`.
|
|
202
|
+
- **Variants**: `variant="outline"` and friends are `data-variant` attributes, so you can also style them from CSS.
|
|
203
|
+
- **Order of styles**: the package's CSS is in `@layer components`, so your own unlayered CSS and Tailwind utilities win without `!important`.
|
|
204
|
+
|
|
205
|
+
Every component's parts are documented on its page in the docs, under *Styles API*.
|
|
206
|
+
|
|
207
|
+
## Theme
|
|
208
|
+
|
|
209
|
+
Pass only the values you want to change. `WelloProvider` merges your override with `DEFAULT_THEME`, so you do not need to copy the full default object.
|
|
210
|
+
|
|
211
|
+
```tsx
|
|
212
|
+
import { createWelloConfig, WelloProvider } from "@wello-dev/core";
|
|
213
|
+
|
|
214
|
+
const theme = createWelloConfig({
|
|
215
|
+
primaryColor: "brand",
|
|
216
|
+
primaryShade: { light: 600, dark: 500 },
|
|
217
|
+
colors: { brand: "#7c3aed" },
|
|
218
|
+
defaultRadius: "lg",
|
|
219
|
+
});
|
|
220
|
+
|
|
221
|
+
<WelloProvider theme={theme}>
|
|
222
|
+
<App />
|
|
223
|
+
</WelloProvider>;
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
`createWelloConfig` returns a typed override; the provider performs the merge and validates the colors. Nested objects merge, omitted values keep their defaults, and arrays replace the corresponding arrays. For example, changing `spacing.md` keeps the other spacing tokens. Read the complete, merged theme inside the provider with `useWelloTheme()`.
|
|
227
|
+
|
|
228
|
+
**Theme reference:** [Colors and shades](#colors-and-shades) · [Contrast and neutral colors](#contrast-and-neutral-colors) · [Variants and gradients](#variants-and-gradients) · [Fonts and headings](#fonts-and-headings) · [Sizes, radius and spacing](#sizes-radius-and-spacing) · [Breakpoints](#breakpoints) · [Interaction and motion](#interaction-and-motion) · [Component defaults](#component-defaults) · [API and custom values](#api-and-custom-values) · [CSS variables](#reading-theme-values-in-css)
|
|
229
|
+
|
|
230
|
+
### Colors and shades
|
|
231
|
+
|
|
232
|
+
| Option | Default | What it controls |
|
|
233
|
+
| --- | --- | --- |
|
|
234
|
+
| `primaryColor` | `"blue"` | The palette used when a component needs the primary color. Use a built-in name, your own palette name, or a hex / `rgb()` / `rgba()` seed. |
|
|
235
|
+
| `primaryShade` | `{ light: 600, dark: 500 }` | The shade of every bare palette name, including `color="teal"`. Pass one number, such as `600`, to use the same shade in both schemes. |
|
|
236
|
+
| `colors` | Built-in palette and aliases | Add palettes, replace palettes, or override individual shades. You can import the built-in palettes as `PALETTE`. |
|
|
237
|
+
|
|
238
|
+
Each palette runs from light to dark: `50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950`. Higher numbers are darker.
|
|
239
|
+
|
|
240
|
+
- `color="blue"` uses `primaryShade`: blue-600 in light mode and blue-500 in dark mode by default.
|
|
241
|
+
- `color="blue-600"` or `color="blue.6"` selects shade 600 in both schemes.
|
|
242
|
+
- Index aliases are `0 → 50`, `1 → 100`, through `9 → 900`. Use `950` explicitly for the darkest shade; `10` is not its color-token alias.
|
|
243
|
+
|
|
244
|
+
```tsx
|
|
245
|
+
import { createWelloConfig, PALETTE } from "@wello-dev/core";
|
|
246
|
+
|
|
247
|
+
const theme = createWelloConfig({
|
|
248
|
+
primaryColor: "brand",
|
|
249
|
+
primaryShade: { light: 700, dark: 400 },
|
|
250
|
+
colors: {
|
|
251
|
+
brand: "#7c3aed", // Generate 11 shades; this seed becomes shade 600.
|
|
252
|
+
ocean: PALETTE.cyan, // Supply a complete palette.
|
|
253
|
+
"blue-50": "#e0f2ff", // Replace one shade; "blue.0" means the same shade.
|
|
254
|
+
},
|
|
255
|
+
});
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
For your own array, provide 11 colors in the order above. A 10-color array is also supported: its last color supplies both 900 and 950. A palette array replaces the previous array; single-shade overrides are applied afterward. For a CSS-variable or HSL seed, put it in `colors.brand` and use `primaryColor: "brand"`.
|
|
259
|
+
|
|
260
|
+
#### A color per color scheme
|
|
261
|
+
|
|
262
|
+
A virtual color points to one palette in light mode and another in dark mode. Both target palettes must exist.
|
|
263
|
+
|
|
264
|
+
```tsx
|
|
265
|
+
import { createWelloConfig, virtualColor } from "@wello-dev/core";
|
|
266
|
+
|
|
267
|
+
const theme = createWelloConfig({
|
|
268
|
+
primaryColor: "primary",
|
|
269
|
+
colors: {
|
|
270
|
+
primary: virtualColor({ name: "primary", light: "teal", dark: "pink" }),
|
|
271
|
+
},
|
|
272
|
+
});
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
#### Checking a color
|
|
276
|
+
|
|
277
|
+
An invalid component color warns once and falls back to the primary color. An invalid `primaryColor` configuration throws when the theme is merged. To check a value yourself:
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
const theme = useWelloTheme();
|
|
281
|
+
|
|
282
|
+
isValidColor("teal.6", theme); // true
|
|
283
|
+
isValidColor("blue-123", theme); // false
|
|
284
|
+
checkColor("blue-123", theme); // Reports that blue has no shade 123.
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
### Contrast and neutral colors
|
|
288
|
+
|
|
289
|
+
| Option | Default | What it controls |
|
|
290
|
+
| --- | --- | --- |
|
|
291
|
+
| `autoContrast` | `true` | Selects black or white foreground text for supported filled colors. Components such as `Button` can override it with their own `autoContrast` prop. |
|
|
292
|
+
| `luminanceThreshold` | `0.3` | A luminance cutoff from 0 to 1. A known color above the cutoff is treated as light and gets black contrast text; otherwise it gets white. |
|
|
293
|
+
| `white` | `"#ffffff"` | The theme's white reference value. See the CSS-token behavior below before changing it. |
|
|
294
|
+
| `black` | `"#000000"` | The theme's black reference value. See the CSS-token behavior below before changing it. |
|
|
295
|
+
| `tintNeutrals` | `true` | Derives subtle background, border and text tints from the primary color's hue in both schemes. Set `false` to keep the stock neutrals. |
|
|
296
|
+
|
|
297
|
+
A higher `luminanceThreshold` makes white text more likely when contrast is calculated. CSS variables and other colors whose luminance cannot be read are treated as dark.
|
|
298
|
+
|
|
299
|
+
Current contrast behavior has a few limits:
|
|
300
|
+
|
|
301
|
+
- `autoContrast: false` selects white text for explicit palette and CSS colors in the color helpers. Primary and keyword colors can still use their CSS contrast tokens, and the gradient variant always uses white text.
|
|
302
|
+
- Changing only `luminanceThreshold` does not regenerate the built-in palette's precomputed contrast tokens. Custom palettes and palettes recalculated after a `primaryShade` change use the new threshold.
|
|
303
|
+
- Changing `theme.white` or `theme.black` does not currently write the corresponding CSS variables. To change the visible white / black tokens, override them in your CSS as well:
|
|
304
|
+
|
|
305
|
+
```css
|
|
306
|
+
:root {
|
|
307
|
+
--wello-color-white: #fffaf0;
|
|
308
|
+
--wello-color-black: #111827;
|
|
309
|
+
}
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
Neutral tinting uses the light primary shade as its source for both schemes. It needs a readable color from a regular palette; virtual primary palettes and unreadable CSS values do not generate a new tint. Your app's own `--background`, `--card` and `--border` bridge tokens still take precedence.
|
|
313
|
+
|
|
314
|
+
### Variants and gradients
|
|
315
|
+
|
|
316
|
+
| Option | Default | What it controls |
|
|
317
|
+
| --- | --- | --- |
|
|
318
|
+
| `variantColorResolver` | `defaultVariantColorsResolver` | Maps a variant and color to its background, hover background, text and border for components that use variant colors. |
|
|
319
|
+
| `defaultGradient` | `{ from: "blue", to: "cyan", deg: 45 }` | The endpoints and angle for `variant="gradient"` when the component does not supply its own gradient. |
|
|
320
|
+
|
|
321
|
+
Changing `primaryColor` does not change the default gradient's endpoints. Configure them separately:
|
|
322
|
+
|
|
323
|
+
```tsx
|
|
324
|
+
const theme = createWelloConfig({
|
|
325
|
+
defaultGradient: { from: "violet", to: "pink", deg: 90 },
|
|
326
|
+
});
|
|
327
|
+
|
|
328
|
+
<>
|
|
329
|
+
<Button variant="gradient">Continue</Button>
|
|
330
|
+
<Button variant="gradient" gradient={{ from: "teal", to: "cyan", deg: 45 }}>
|
|
331
|
+
Custom gradient
|
|
332
|
+
</Button>
|
|
333
|
+
</>
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
A resolver receives `{ variant, color, gradient, autoContrast, theme }` and returns `{ background, hover, color, border, hoverColor? }`. Delegate to the default resolver to keep the existing behavior for variants you do not change:
|
|
337
|
+
|
|
338
|
+
```tsx
|
|
339
|
+
import { createWelloConfig, defaultVariantColorsResolver } from "@wello-dev/core";
|
|
340
|
+
|
|
341
|
+
const theme = createWelloConfig({
|
|
342
|
+
variantColorResolver: (input) => {
|
|
343
|
+
const resolved = defaultVariantColorsResolver(input);
|
|
344
|
+
return input.variant === "light"
|
|
345
|
+
? { ...resolved, border: "1px solid " + resolved.color }
|
|
346
|
+
: resolved;
|
|
347
|
+
},
|
|
348
|
+
});
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
### Fonts and headings
|
|
352
|
+
|
|
353
|
+
| Option | Default | What it controls |
|
|
354
|
+
| --- | --- | --- |
|
|
355
|
+
| `fontFamily` | System sans-serif stack below | The proportional font used by themed text. |
|
|
356
|
+
| `fontFamilyMonospace` | System monospace stack below | Code and other monospace text. |
|
|
357
|
+
| `headings.fontFamily` | Same sans-serif stack | The heading font. |
|
|
358
|
+
| `headings.fontWeight` | `"700"` | The default heading weight; an individual heading size can override it. |
|
|
359
|
+
| `headings.sizes` | h1–h6 table below | Each heading's `fontSize`, `lineHeight` and optional `fontWeight`. |
|
|
360
|
+
|
|
361
|
+
The default font stacks are:
|
|
362
|
+
|
|
363
|
+
```ts
|
|
364
|
+
const defaultFonts = {
|
|
365
|
+
fontFamily:
|
|
366
|
+
'ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Arabic", sans-serif',
|
|
367
|
+
fontFamilyMonospace:
|
|
368
|
+
'ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace',
|
|
369
|
+
};
|
|
370
|
+
```
|
|
371
|
+
|
|
372
|
+
A font-family setting chooses a font; it does not download font files. Load any custom fonts in your app.
|
|
373
|
+
|
|
374
|
+
| Heading | `fontSize` | `lineHeight` |
|
|
375
|
+
| --- | --- | --- |
|
|
376
|
+
| `h1` | `2.125rem` | `1.3` |
|
|
377
|
+
| `h2` | `1.625rem` | `1.35` |
|
|
378
|
+
| `h3` | `1.375rem` | `1.4` |
|
|
379
|
+
| `h4` | `1.125rem` | `1.45` |
|
|
380
|
+
| `h5` | `1rem` | `1.5` |
|
|
381
|
+
| `h6` | `0.875rem` | `1.5` |
|
|
382
|
+
|
|
383
|
+
```tsx
|
|
384
|
+
const theme = createWelloConfig({
|
|
385
|
+
fontFamily: "Inter, sans-serif",
|
|
386
|
+
fontFamilyMonospace: '"JetBrains Mono", monospace',
|
|
387
|
+
headings: {
|
|
388
|
+
fontFamily: "Inter, sans-serif",
|
|
389
|
+
fontWeight: "600",
|
|
390
|
+
sizes: {
|
|
391
|
+
h1: { fontSize: "2.5rem", lineHeight: "1.2", fontWeight: "700" },
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
});
|
|
395
|
+
|
|
396
|
+
<>
|
|
397
|
+
<Title order={2}>Uses the h2 tokens</Title>
|
|
398
|
+
<Title order={1} size="h3">An h1 with the h3 appearance</Title>
|
|
399
|
+
</>
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
### Sizes, radius and spacing
|
|
403
|
+
|
|
404
|
+
The named scales below are independent. For example, `spacing.md` changes `p="md"` and `mt="md"`; it does not change `radius="md"` or `fz="md"`.
|
|
405
|
+
|
|
406
|
+
| Token | `spacing` | `radius` | `fontSizes` | `lineHeights` |
|
|
407
|
+
| --- | --- | --- | --- | --- |
|
|
408
|
+
| `xs` | `0.625rem` | `0.125rem` | `0.75rem` | `1.4` |
|
|
409
|
+
| `sm` | `0.75rem` | `0.25rem` | `0.875rem` | `1.45` |
|
|
410
|
+
| `md` | `1rem` | `0.5rem` | `1rem` | `1.55` |
|
|
411
|
+
| `lg` | `1.25rem` | `1rem` | `1.125rem` | `1.6` |
|
|
412
|
+
| `xl` | `2rem` | `2rem` | `1.25rem` | `1.65` |
|
|
413
|
+
|
|
414
|
+
- `spacing` supplies margins, padding and layout gaps.
|
|
415
|
+
- `radius` supplies named corner radii. `defaultRadius: "md"` selects the fallback for components that use the theme radius. An explicit component radius takes precedence; some components have their own defaults.
|
|
416
|
+
- `fontSizes` supplies named text sizes such as `fz="sm"`. Component `size` props can also control dimensions such as height, so changing this scale does not resize every control.
|
|
417
|
+
- `lineHeights` supplies named, unitless line heights such as `lh="lg"`.
|
|
418
|
+
- `shadows` supplies the named `shadow` values below.
|
|
419
|
+
|
|
420
|
+
| `shadows` token | Default |
|
|
421
|
+
| --- | --- |
|
|
422
|
+
| `xs` | `0 1px 2px rgb(0 0 0 / 0.06)` |
|
|
423
|
+
| `sm` | `0 1px 3px rgb(0 0 0 / 0.08), 0 1px 2px rgb(0 0 0 / 0.04)` |
|
|
424
|
+
| `md` | `0 4px 12px -2px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.06)` |
|
|
425
|
+
| `lg` | `0 12px 28px -6px rgb(0 0 0 / 0.14), 0 4px 10px -4px rgb(0 0 0 / 0.08)` |
|
|
426
|
+
| `xl` | `0 24px 48px -12px rgb(0 0 0 / 0.22)` |
|
|
427
|
+
|
|
428
|
+
These are the values in `DEFAULT_THEME`; the stylesheet also supplies darker shadow defaults in dark mode.
|
|
429
|
+
|
|
430
|
+
```tsx
|
|
431
|
+
const theme = createWelloConfig({
|
|
432
|
+
defaultRadius: "lg",
|
|
433
|
+
spacing: { md: "1.125rem" },
|
|
434
|
+
radius: { lg: "0.75rem" },
|
|
435
|
+
fontSizes: { sm: "0.9375rem" },
|
|
436
|
+
lineHeights: { lg: "1.7" },
|
|
437
|
+
shadows: { md: "0 8px 24px rgb(0 0 0 / 0.12)" },
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
<Paper p="md" radius="lg" shadow="md">
|
|
441
|
+
<Text fz="sm" lh="lg">Uses the tokens above</Text>
|
|
442
|
+
</Paper>
|
|
443
|
+
```
|
|
444
|
+
|
|
445
|
+
Theme scale entries are CSS strings. Numeric lengths passed directly as component or style props are treated as pixels and converted to rem using 16 px per rem: `mt={16}` becomes `1rem`. Helpers such as `getRadius("lg")` and `getSpacing("md")` return the matching CSS-variable reference; `rem`, `px` and `em` handle unit conversion.
|
|
446
|
+
|
|
447
|
+
### Breakpoints
|
|
448
|
+
|
|
449
|
+
`breakpoints` defines the minimum widths for responsive style props. `base` applies at every width; a named breakpoint takes effect at that width and above.
|
|
450
|
+
|
|
451
|
+
| Token | Default |
|
|
452
|
+
| --- | --- |
|
|
453
|
+
| `xs` | `36em` |
|
|
454
|
+
| `sm` | `48em` |
|
|
455
|
+
| `md` | `62em` |
|
|
456
|
+
| `lg` | `75em` |
|
|
457
|
+
| `xl` | `88em` |
|
|
458
|
+
|
|
459
|
+
```tsx
|
|
460
|
+
const theme = createWelloConfig({
|
|
461
|
+
breakpoints: { sm: "50em" },
|
|
462
|
+
});
|
|
463
|
+
|
|
464
|
+
<Paper w={{ base: "100%", sm: 480 }} p={{ base: "sm", md: "lg" }}>
|
|
465
|
+
Responsive content
|
|
466
|
+
</Paper>
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
Changing this map affects generated responsive style props. It does not rewrite Tailwind breakpoints or the fixed media queries in the package stylesheet, including `hiddenFrom` / `visibleFrom` rules.
|
|
470
|
+
|
|
471
|
+
### Interaction and motion
|
|
472
|
+
|
|
473
|
+
| Option | Default | Current behavior |
|
|
474
|
+
| --- | --- | --- |
|
|
475
|
+
| `cursorType` | `"pointer"` | Sets the cursor token used by buttons and other controls. Use `"default"` for the normal arrow. |
|
|
476
|
+
| `focusRing` | `"auto"` | The type accepts `"auto"`, `"always"` and `"never"`, but this setting is not currently read at runtime. Focusable parts use the `wello-focus-auto` class and `:focus-visible`. |
|
|
477
|
+
| `respectReducedMotion` | `false` | This setting is not currently read at runtime. `Transition`, view transitions and several component styles handle `prefers-reduced-motion` independently. |
|
|
478
|
+
|
|
479
|
+
### Component defaults
|
|
480
|
+
|
|
481
|
+
`components: {}` means there are no application-wide component overrides. Add entries by component name to set `defaultProps`, `classNames`, `styles` or `vars` for every instance.
|
|
482
|
+
|
|
483
|
+
```tsx
|
|
484
|
+
const theme = createWelloConfig({
|
|
485
|
+
components: {
|
|
486
|
+
Button: {
|
|
487
|
+
defaultProps: { radius: "lg", variant: "outline" },
|
|
488
|
+
styles: { root: { fontWeight: 600 } },
|
|
489
|
+
},
|
|
490
|
+
},
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
<>
|
|
494
|
+
<Button>Uses the theme defaults</Button>
|
|
495
|
+
<Button radius="sm" variant="filled">Overrides those defaults</Button>
|
|
496
|
+
</>
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
Built-in defaults apply first, theme `defaultProps` next, and explicit props last. Passing `undefined` keeps the default. Theme classes, styles and variables can also be functions of the theme; `classNames`, `styles` and `vars` can use the component props too. Instance styles and variables override their theme equivalents.
|
|
500
|
+
|
|
501
|
+
### API and custom values
|
|
502
|
+
|
|
503
|
+
`api: {}` leaves the shared API configuration empty. Set `baseURL`, `generalBaseURL`, `getHeaders`, `timeout`, `withCredentials`, `onError` and `listParams` here for `useFetch`, `useApi` and endpoint-based inputs. `getHeaders` runs for each request and can be async. See [Your API](#your-api) for a complete example.
|
|
504
|
+
|
|
505
|
+
`other: {}` stores values for your own components. Built-in components do not apply these values automatically.
|
|
506
|
+
|
|
507
|
+
```tsx
|
|
508
|
+
const theme = createWelloConfig({
|
|
509
|
+
other: {
|
|
510
|
+
brandName: "Acme",
|
|
511
|
+
headerHeight: 64,
|
|
512
|
+
},
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
function BrandName() {
|
|
516
|
+
const { other } = useWelloTheme();
|
|
517
|
+
// Values in "other" are typed as unknown; narrow them before using them.
|
|
518
|
+
return <Text>{typeof other.brandName === "string" ? other.brandName : "My app"}</Text>;
|
|
519
|
+
}
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
### Reading theme values in CSS
|
|
523
|
+
|
|
524
|
+
With `withCssVariables` enabled on the provider (the default), supported theme tokens are written to `:root`. Change the target with `cssVariablesSelector`. Your styles can use the same tokens as the built-in components:
|
|
525
|
+
|
|
526
|
+
```css
|
|
527
|
+
.my-panel {
|
|
528
|
+
padding: var(--wello-spacing-md);
|
|
529
|
+
border-radius: var(--wello-radius-default);
|
|
530
|
+
color: var(--wello-color-text);
|
|
531
|
+
background: var(--wello-primary-color-light);
|
|
532
|
+
font-family: var(--wello-font-family);
|
|
533
|
+
}
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
## Theme toggle
|
|
537
|
+
|
|
538
|
+
`ThemeToggle` switches light and dark with the View Transitions API: the new scheme grows over the old one from a corner, a circle, a diamond…
|
|
539
|
+
|
|
540
|
+
```tsx
|
|
541
|
+
<ThemeToggle variant="circle-blur" start="top-right" duration={800} />
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
- `variant`: `circle`, `circle-blur`, `polygon`, `diamond`, `wipe`, `fade` or `blur`. `start`: `center` or a corner.
|
|
545
|
+
- It reads and sets the scheme of `WelloProvider`. If your app keeps its own theme state, use `ThemeToggleButton` and change it in `onClick`: `<ThemeToggleButton theme={theme} onClick={toggle} />`.
|
|
546
|
+
- For the same animation on anything else, `runViewTransition(() => update(), { variant, start })`, or `useViewTransition()`. The update must change the page synchronously.
|
|
547
|
+
- Browsers without the API, and people who ask for less motion, get the change with no animation.
|
|
548
|
+
|
|
549
|
+
## Dark mode and RTL
|
|
550
|
+
|
|
551
|
+
```tsx
|
|
552
|
+
const { colorScheme, setColorScheme, toggleColorScheme } = useWelloColorScheme();
|
|
553
|
+
const scheme = useComputedColorScheme(); // "light" or "dark": what is shown, with "auto" resolved
|
|
554
|
+
```
|
|
555
|
+
|
|
556
|
+
The choice is saved in `localStorage` (`colorSchemeManager={null}` to not save it, or pass your own with `localStorageColorSchemeManager` as a model).
|
|
557
|
+
|
|
558
|
+
For right-to-left languages set `dir="rtl"` on `<html>`. Components that need the direction in JavaScript, like sliders, pagination and carousels, follow it through `DirectionProvider`, and `useDirection()` gives you the same value.
|
|
559
|
+
|
|
560
|
+
## Translating the built-in texts
|
|
561
|
+
|
|
562
|
+
Pass `labels` to `WelloProvider`. Any text you leave out stays in English, and a prop on a component still wins:
|
|
563
|
+
|
|
564
|
+
```tsx
|
|
565
|
+
<WelloProvider
|
|
566
|
+
labels={{
|
|
567
|
+
close: t("close"),
|
|
568
|
+
search: t("search"),
|
|
569
|
+
noResults: t("noResults"),
|
|
570
|
+
previousPage: t("previous"),
|
|
571
|
+
nextPage: t("next"),
|
|
572
|
+
phoneDigits: (count) => t("digits", { count }),
|
|
573
|
+
}}
|
|
574
|
+
>
|
|
575
|
+
<App />
|
|
576
|
+
</WelloProvider>
|
|
577
|
+
```
|
|
578
|
+
|
|
579
|
+
All the keys, with their English texts, are in `DEFAULT_LABELS`. In your own components, `useWelloLabels()` reads them.
|
|
580
|
+
|
|
581
|
+
## Dropzone
|
|
582
|
+
|
|
583
|
+
A drop zone with attached-file cards: previews, upload progress, retry, remove (with a confirmation), and checks for type, size and count. It never talks to a server by itself: pass `upload` to send each file.
|
|
584
|
+
|
|
585
|
+
```tsx
|
|
586
|
+
import { Dropzone, type DropzoneFile } from "@wello-dev/core";
|
|
587
|
+
|
|
588
|
+
const [files, setFiles] = useState<DropzoneFile[]>([]);
|
|
589
|
+
|
|
590
|
+
<Dropzone
|
|
591
|
+
label="Photos"
|
|
592
|
+
fileType="image" // the icon
|
|
593
|
+
accept="image/*" // as for <input accept>: image/*,.pdf
|
|
594
|
+
maxFiles={3}
|
|
595
|
+
maxSize={5} // MB
|
|
596
|
+
value={files}
|
|
597
|
+
onChange={setFiles}
|
|
598
|
+
upload={(file, { onProgress, signal }) => send(file, onProgress, signal)} // resolve = done, reject = shows Retry
|
|
599
|
+
onRemove={(file) => deleteOnServer(file)} // return false to keep the file
|
|
600
|
+
onReject={(rejections) => toast(rejections[0].message)}
|
|
601
|
+
/>
|
|
602
|
+
```
|
|
603
|
+
|
|
604
|
+
- `fileType`, `accept`, `maxFiles` and `maxSize` are required: there is no default list of types or size, so every field says what it takes.
|
|
605
|
+
- Without `upload`, picked files stay in the list as completed, with the `File` in `file.file`, to submit with your form.
|
|
606
|
+
- With `maxFiles={1}` the file shows inside the drop zone and replaces the previous one.
|
|
607
|
+
- `confirmRemove={false}` removes without asking. `defaultValue` takes files you already have on the server, and `value` makes the list controlled.
|
|
608
|
+
- Its texts are the `labels` that start with `dropzone` (`dropzoneDrop`, `dropzoneSupported`, `dropzoneConfirmText`, …): translate them in `WelloProvider`.
|
|
609
|
+
|
|
610
|
+
## Your API
|
|
611
|
+
|
|
612
|
+
Say once where your API is, in the theme. After that, `Select` takes only an `endpoint`, and `useFetch` and `useApi` need nothing else:
|
|
613
|
+
|
|
614
|
+
```tsx
|
|
615
|
+
const theme = createWelloConfig({
|
|
616
|
+
api: {
|
|
617
|
+
baseURL: "/api",
|
|
618
|
+
generalBaseURL: "/api/general", // for requests that say `general`
|
|
619
|
+
getHeaders: () => ({ Authorization: `Bearer ${getAccessToken()}` }), // called at every request
|
|
620
|
+
onError: ({ status, message }) => { if (status === 401) goToLogin(); },
|
|
621
|
+
},
|
|
622
|
+
});
|
|
623
|
+
|
|
624
|
+
<WelloProvider theme={theme}>…</WelloProvider>
|
|
625
|
+
```
|
|
626
|
+
|
|
627
|
+
```tsx
|
|
628
|
+
<Select endpoint="cities" params={{ country_id: 5 }} /> {/* pages on scroll, search, the current value from cities/{id} */}
|
|
629
|
+
<Select endpoint="countries" general select={(res) => res.items} /> {/* another address; your own shape of answer */}
|
|
630
|
+
<PhoneInput endpoint="countries" params={{ paginate: false }} {...field} /> {/* the dial codes, flags and limits from your API */}
|
|
631
|
+
|
|
632
|
+
const { data, isLoading, refetch } = useFetch<{ data: User[] }>("users", { params: { page: 1 } });
|
|
633
|
+
const api = useApi();
|
|
634
|
+
await api.post("users", { name: "Sara" });
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
- `useFetch(endpoint, { params, enabled, general, select, staleTime, onSuccess, onError })` keeps the answer for `staleTime` (60 s) and shares it between components that ask the same thing. `clearFetchCache()` forgets it, for example after a save.
|
|
638
|
+
- `Select` reads `{ data: [...] }`, `{ data: { data: [...] } }`, `{ items: [...] }` or a plain array, and the total from `meta.total` or `pagination.total`. If yours differs, pass `select`. The query names default to `page`, `per_page` and `search`: change them with `api.listParams`.
|
|
639
|
+
- With `multiple`, the options of the current values are not fetched one by one. With `hasShow={false}`, or a `showEndpoint` that returns `null`, they are not fetched either.
|
|
640
|
+
- `params={{ paginate: false }}` means the server sends everything at once, so no page or `per_page` is sent and the list is not asked for more.
|
|
641
|
+
- `createApiClient(theme.api)` gives the axios instance if you need more than `useApi`.
|
|
642
|
+
|
|
643
|
+
## Build your own components
|
|
644
|
+
|
|
645
|
+
The pieces the components are made of are exported, so yours can behave the same:
|
|
646
|
+
|
|
647
|
+
```tsx
|
|
648
|
+
import { factory, useProps, useComponentStyles, Box, type BoxProps, type StylesApiProps } from "@wello-dev/core";
|
|
649
|
+
|
|
650
|
+
type CardStylesNames = "root" | "title";
|
|
651
|
+
interface MyCardProps extends BoxProps, StylesApiProps<CardStylesNames, MyCardProps> {
|
|
652
|
+
title: string;
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
export const MyCard = factory<{ props: MyCardProps; ref: HTMLDivElement; stylesNames: CardStylesNames }>((_props, ref) => {
|
|
656
|
+
const props = useProps("MyCard", {}, _props);
|
|
657
|
+
const [getStyles, { title, children, ...others }] = useComponentStyles("MyCard", props);
|
|
658
|
+
return (
|
|
659
|
+
<Box ref={ref} {...getStyles("root")} {...others}>
|
|
660
|
+
<h3 {...getStyles("title")}>{title}</h3>
|
|
661
|
+
{children}
|
|
662
|
+
</Box>
|
|
663
|
+
);
|
|
664
|
+
});
|
|
665
|
+
```
|
|
666
|
+
|
|
667
|
+
Yours then take `classNames`, `styles`, `unstyled`, style props and theme defaults (`createWelloConfig({ components: { MyCard: { … } } })`) like the built-in ones. `polymorphicFactory` does the same for components with `component`.
|
|
668
|
+
|
|
669
|
+
## Utilities
|
|
670
|
+
|
|
671
|
+
| Group | Exports |
|
|
672
|
+
| --- | --- |
|
|
673
|
+
| Theme | `createWelloConfig`, `mergeTheme`, `DEFAULT_THEME`, `PALETTE`, `SHADES` |
|
|
674
|
+
| Colors | `virtualColor`, `isValidColor`, `checkColor`, `isCssColor`, `generateColors`, `colorsTuple`, `alpha`, `lighten`, `darken`, `rgba`, `toRgba`, `luminance`, `isLightColor`, `getContrastColor`, `getThemeColor`, `parseThemeColor`, `getGradient` |
|
|
675
|
+
| Units | `rem`, `px`, `em`, `getSize`, `getSpacing`, `getRadius`, `getShadow`, `getFontSize`, `getLineHeight` |
|
|
676
|
+
| Hooks | `useWelloTheme`, `useWelloColorScheme`, `useComputedColorScheme`, `useDirection`, `useWelloLabels`, `useId`, `useFetch`, `useApi` |
|
|
677
|
+
| API | `createApiClient`, `clearFetchCache`, `readListResponse` |
|
|
678
|
+
| Helpers | `cx`, `clamp`, `mergeRefs`, `mergeStyles`, `callAll`, `mapResponsive`, `createSafeContext`, `createOptionalContext` |
|
|
679
|
+
| Building blocks | `factory`, `polymorphicFactory`, `useProps`, `useStyles`, `useComponentStyles`, `staticClasses`, `Box`, `Slot` |
|
|
680
|
+
|
|
681
|
+
Hooks for state, events and the browser (`useDisclosure`, `useDebouncedValue`, …) are in `@wello-dev/hooks`.
|
|
682
|
+
|
|
683
|
+
## Scrollbars
|
|
684
|
+
|
|
685
|
+
Scrollbars use the primary color: `ScrollArea`, and through `scrollbar-color` on `html`, the page and everything else that scrolls. To change them:
|
|
686
|
+
|
|
687
|
+
```css
|
|
688
|
+
:root { --wello-scrollbar-color: #94a3b8; } /* another color */
|
|
689
|
+
html { scrollbar-color: auto; } /* the browser's own, outside ScrollArea */
|
|
690
|
+
```
|
|
691
|
+
|
|
692
|
+
## Carousel arrows
|
|
693
|
+
|
|
694
|
+
Round glass buttons by default. For only the chevrons, use `controlsVariant="plain"`. To restyle them:
|
|
695
|
+
|
|
696
|
+
```css
|
|
697
|
+
.my-carousel {
|
|
698
|
+
--carousel-control-bg: #0f172a;
|
|
699
|
+
--carousel-control-color: #fff;
|
|
700
|
+
--carousel-control-border: transparent;
|
|
701
|
+
}
|
|
702
|
+
```
|
|
703
|
+
|
|
704
|
+
Your own unlayered CSS, like `.swiper-button-next { … }`, always wins.
|
|
705
|
+
|
|
706
|
+
## License
|
|
707
|
+
|
|
708
|
+
MIT
|