@dmsi/wedgekit-react 0.0.5 → 0.0.7
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/dist/{chunk-25Y2OMTD.js → chunk-6ZY524ID.js} +8 -4
- package/dist/{chunk-UGXT677T.js → chunk-BWRHL2AG.js} +4 -2
- package/dist/{chunk-VFWFORJJ.js → chunk-DKKYR6DS.js} +1 -0
- package/dist/{chunk-TBHTISFW.js → chunk-GTCSRHPF.js} +1 -1
- package/dist/chunk-I2UVVKQI.js +12 -0
- package/dist/{chunk-CABAANHQ.js → chunk-L4UM372R.js} +5 -1
- package/dist/chunk-Q3FKEKIN.js +23 -0
- package/dist/{chunk-YD462QK7.js → chunk-TAW5ZZ4Z.js} +4 -4
- package/dist/{chunk-UEN5BURK.js → chunk-TRUPPHBQ.js} +14 -11
- package/dist/{chunk-2B7WUAOV.js → chunk-TU55CHXU.js} +4 -2
- package/dist/{chunk-PMQOPIJZ.js → chunk-U42SKNR6.js} +45 -16
- package/dist/{chunk-SPQH4CSJ.js → chunk-XUIPGYP5.js} +11 -3
- package/dist/components/Checkbox.cjs +1 -0
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/DataGrid.cjs +145 -17
- package/dist/components/DataGrid.js +138 -19
- package/dist/components/DataGridCell.cjs +4 -2
- package/dist/components/DataGridCell.js +4 -4
- package/dist/components/DateInput.cjs +4 -2
- package/dist/components/DateInput.js +1 -1
- package/dist/components/DateRangeInput.cjs +4 -2
- package/dist/components/DateRangeInput.js +1 -1
- package/dist/components/FilterGroup.cjs +559 -31
- package/dist/components/FilterGroup.js +21 -3
- package/dist/components/Input.cjs +4 -2
- package/dist/components/Input.js +1 -1
- package/dist/components/MainBar.cjs +2 -1
- package/dist/components/MainBar.js +2 -1
- package/dist/components/Menu.js +1 -1
- package/dist/components/MobileDataGrid.cjs +658 -0
- package/dist/components/MobileDataGrid.js +125 -0
- package/dist/components/Modal.cjs +147 -52
- package/dist/components/Modal.js +80 -30
- package/dist/components/ModalButtons.cjs +7 -3
- package/dist/components/ModalButtons.js +1 -1
- package/dist/components/ModalContent.cjs +25 -2
- package/dist/components/ModalContent.js +1 -1
- package/dist/components/ModalHeader.cjs +11 -3
- package/dist/components/ModalHeader.js +1 -1
- package/dist/components/ModalScrim.cjs +5 -6
- package/dist/components/ModalScrim.js +1 -1
- package/dist/components/Notification.cjs +137 -26
- package/dist/components/Notification.js +29 -16
- package/dist/components/Password.cjs +4 -2
- package/dist/components/Password.js +1 -1
- package/dist/components/Search.cjs +4 -2
- package/dist/components/Search.js +2 -2
- package/dist/components/Select.cjs +15 -7
- package/dist/components/Select.js +2 -2
- package/dist/components/SideMenuGroup.cjs +45 -16
- package/dist/components/SideMenuGroup.js +1 -1
- package/dist/components/SideMenuItem.cjs +45 -16
- package/dist/components/SideMenuItem.js +1 -1
- package/dist/components/Stack.cjs +45 -16
- package/dist/components/Stack.js +1 -1
- package/dist/components/Stepper.cjs +4 -2
- package/dist/components/Stepper.js +1 -1
- package/dist/components/Surface.cjs +4 -4
- package/dist/components/Surface.js +36 -3
- package/dist/components/Swatch.cjs +971 -22
- package/dist/components/Swatch.js +928 -7
- package/dist/components/Theme.js +3 -9
- package/dist/components/Time.cjs +150 -91
- package/dist/components/Time.js +48 -60
- package/dist/components/Toast.cjs +1 -1
- package/dist/components/Toast.js +1 -1
- package/dist/fonts.css +2 -0
- package/dist/index.css +371 -19
- package/package.json +1 -1
- package/src/brand.css +16 -1
- package/src/components/Checkbox.tsx +1 -0
- package/src/components/DataGrid.tsx +132 -3
- package/src/components/FilterGroup.tsx +25 -2
- package/src/components/Input.tsx +4 -1
- package/src/components/MainBar.tsx +2 -1
- package/src/components/Menu.tsx +11 -4
- package/src/components/MobileDataGrid.tsx +135 -0
- package/src/components/Modal.tsx +73 -13
- package/src/components/ModalButtons.tsx +26 -17
- package/src/components/ModalContent.tsx +20 -2
- package/src/components/ModalHeader.tsx +24 -13
- package/src/components/ModalScrim.tsx +4 -3
- package/src/components/Notification.tsx +21 -14
- package/src/components/Select.tsx +7 -9
- package/src/components/Stack.tsx +85 -20
- package/src/components/Surface.tsx +4 -5
- package/src/components/Swatch.tsx +779 -6
- package/src/components/Time.tsx +51 -70
- package/src/components/Toast.tsx +1 -1
- package/src/darkmode.css +18 -3
- package/src/fonts.css +2 -0
- package/src/index.css +23 -3
- package/dist/acc.css +0 -3
- package/dist/agility.css +0 -7
- package/dist/chunk-22YZ6LFN.js +0 -322
- package/dist/chunk-27OSC5OM.js +0 -68
- package/dist/chunk-2EHJFFX4.js +0 -124
- package/dist/chunk-2GC2SPSS.js +0 -130
- package/dist/chunk-2KLCMD2M.js +0 -106
- package/dist/chunk-2TLQVCQQ.js +0 -130
- package/dist/chunk-2Y6GPKXR.js +0 -263
- package/dist/chunk-322ATVWD.js +0 -298
- package/dist/chunk-35DCQU2F.js +0 -127
- package/dist/chunk-3B7FAEF7.js +0 -38
- package/dist/chunk-3FLOLZYP.js +0 -21
- package/dist/chunk-3IZWY2C7.js +0 -221
- package/dist/chunk-3NGYDV56.js +0 -38
- package/dist/chunk-3NLKVKFR.js +0 -72
- package/dist/chunk-3R7YVBRL.js +0 -135
- package/dist/chunk-3RDFNEVD.js +0 -91
- package/dist/chunk-3TPGMRVY.js +0 -123
- package/dist/chunk-42X2EOOI.js +0 -129
- package/dist/chunk-47GJZWOH.js +0 -103
- package/dist/chunk-4BUU5MTT.js +0 -263
- package/dist/chunk-4IZG2UCW.js +0 -31
- package/dist/chunk-4M7CJVTZ.js +0 -136
- package/dist/chunk-4NZBVXM3.js +0 -53
- package/dist/chunk-4S4WZ3MQ.js +0 -103
- package/dist/chunk-4SV7MJMP.js +0 -340
- package/dist/chunk-4TH2SUHQ.js +0 -145
- package/dist/chunk-56ORPWGF.js +0 -148
- package/dist/chunk-5HIUW5CM.js +0 -128
- package/dist/chunk-5K3U4IUW.js +0 -34
- package/dist/chunk-5KOZKEEM.js +0 -91
- package/dist/chunk-5OIRPFRD.js +0 -114
- package/dist/chunk-5QW5SJNW.js +0 -31
- package/dist/chunk-5QZO37QK.js +0 -263
- package/dist/chunk-5ROMJJRK.js +0 -135
- package/dist/chunk-5VHYVTZI.js +0 -123
- package/dist/chunk-6277DY3K.js +0 -437
- package/dist/chunk-6C5NOV6D.js +0 -263
- package/dist/chunk-6CDVHKTS.js +0 -103
- package/dist/chunk-6E4OJA7E.js +0 -263
- package/dist/chunk-6GBZFWQ4.js +0 -105
- package/dist/chunk-6GGLA6DI.js +0 -263
- package/dist/chunk-6HKVN4QK.js +0 -340
- package/dist/chunk-6HLJFPGY.js +0 -284
- package/dist/chunk-6KUUK27D.js +0 -31
- package/dist/chunk-6Q5NNY5V.js +0 -135
- package/dist/chunk-6VAZR5GK.js +0 -122
- package/dist/chunk-6XDXJ3Z3.js +0 -131
- package/dist/chunk-6XIXUFSA.js +0 -114
- package/dist/chunk-7CG4GVU7.js +0 -21
- package/dist/chunk-7DNCGSXK.js +0 -284
- package/dist/chunk-7GFGBJCU.js +0 -287
- package/dist/chunk-7VA3AERB.js +0 -31
- package/dist/chunk-7YJLGGIR.js +0 -83
- package/dist/chunk-7ZCBQXHR.js +0 -272
- package/dist/chunk-A4BGWCF6.js +0 -221
- package/dist/chunk-A6RDEIAN.js +0 -254
- package/dist/chunk-AE7SZPWF.js +0 -121
- package/dist/chunk-AEQYZFXI.js +0 -50
- package/dist/chunk-AFEIB2Y7.js +0 -213
- package/dist/chunk-AGQML5BM.js +0 -340
- package/dist/chunk-AHBE63RV.js +0 -263
- package/dist/chunk-AHHXD4EH.js +0 -31
- package/dist/chunk-AILPQXDY.js +0 -47
- package/dist/chunk-AKTL6JU5.js +0 -25
- package/dist/chunk-AMZFEIAM.js +0 -114
- package/dist/chunk-ANI7PKSV.js +0 -38
- package/dist/chunk-AO6WGDPJ.js +0 -105
- package/dist/chunk-ASDN5OZ3.js +0 -318
- package/dist/chunk-ASSOOV4N.js +0 -53
- package/dist/chunk-AWSUZLRR.js +0 -79
- package/dist/chunk-B6A3BOGW.js +0 -31
- package/dist/chunk-B6NMINKX.js +0 -72
- package/dist/chunk-B7UOXS2S.js +0 -221
- package/dist/chunk-BDN7SDV5.js +0 -31
- package/dist/chunk-BDPJYJD2.js +0 -218
- package/dist/chunk-BDYWCYRG.js +0 -263
- package/dist/chunk-BENTHNAQ.js +0 -51
- package/dist/chunk-BGPBLXQ5.js +0 -131
- package/dist/chunk-BKC5DNOX.js +0 -162
- package/dist/chunk-BMGYSXYW.js +0 -50
- package/dist/chunk-BNOE4DGB.js +0 -79
- package/dist/chunk-BQMI4NKT.js +0 -103
- package/dist/chunk-BSBXTPTA.js +0 -84
- package/dist/chunk-BYNATA7V.js +0 -114
- package/dist/chunk-BZFVPEG3.js +0 -98
- package/dist/chunk-C2GYWE4S.js +0 -263
- package/dist/chunk-C5NNFQ4B.js +0 -114
- package/dist/chunk-C7ALJGJG.js +0 -322
- package/dist/chunk-C7S6DKZ6.js +0 -31
- package/dist/chunk-CA4BW655.js +0 -50
- package/dist/chunk-CELC37U6.js +0 -38
- package/dist/chunk-CIWOBFZ4.js +0 -340
- package/dist/chunk-CKB4S3O3.js +0 -284
- package/dist/chunk-CL6RYGIT.js +0 -263
- package/dist/chunk-CLB4OQS5.js +0 -84
- package/dist/chunk-CMBMFSP4.js +0 -340
- package/dist/chunk-CTHHLBRT.js +0 -90
- package/dist/chunk-DDQ4KWHW.js +0 -74
- package/dist/chunk-DHWXCPF2.js +0 -56
- package/dist/chunk-DV3IMUO6.js +0 -50
- package/dist/chunk-DZHPNWUL.js +0 -70
- package/dist/chunk-DZLUR2I7.js +0 -34
- package/dist/chunk-E7H6GJIB.js +0 -31
- package/dist/chunk-EAJ37R7R.js +0 -31
- package/dist/chunk-EDMIKY4Q.js +0 -50
- package/dist/chunk-EE4GUGFX.js +0 -31
- package/dist/chunk-EHCD3FVZ.js +0 -50
- package/dist/chunk-EHOMG5B4.js +0 -31
- package/dist/chunk-EM7ODK2O.js +0 -53
- package/dist/chunk-ER3HQRPL.js +0 -105
- package/dist/chunk-ER6TD3DA.js +0 -30
- package/dist/chunk-ESK7AT3B.js +0 -38
- package/dist/chunk-ETWMDEUU.js +0 -114
- package/dist/chunk-EWX2EDF5.js +0 -236
- package/dist/chunk-EXJKOP3Y.js +0 -236
- package/dist/chunk-F2YQE6G5.js +0 -145
- package/dist/chunk-F3U3RHIB.js +0 -131
- package/dist/chunk-F433MJII.js +0 -91
- package/dist/chunk-F4JE6AD2.js +0 -160
- package/dist/chunk-FCYGYC7R.js +0 -30
- package/dist/chunk-FEEMBYZR.js +0 -98
- package/dist/chunk-FKQ63FLW.js +0 -91
- package/dist/chunk-FNFDOS7L.js +0 -263
- package/dist/chunk-FNLYAP3I.js +0 -135
- package/dist/chunk-FQVCRL3Z.js +0 -145
- package/dist/chunk-FZ6I2KRT.js +0 -263
- package/dist/chunk-FZLYFJ53.js +0 -26
- package/dist/chunk-G3AYBQ2Y.js +0 -221
- package/dist/chunk-G4V7WZAV.js +0 -72
- package/dist/chunk-GDAY5XPY.js +0 -47
- package/dist/chunk-GELM4Z36.js +0 -263
- package/dist/chunk-GGR5UY3Q.js +0 -83
- package/dist/chunk-GK556OXV.js +0 -263
- package/dist/chunk-GOB3NB3Q.js +0 -130
- package/dist/chunk-GPIG2QUB.js +0 -437
- package/dist/chunk-GV63QYC5.js +0 -130
- package/dist/chunk-GWNDXZUZ.js +0 -263
- package/dist/chunk-H3INEB6H.js +0 -296
- package/dist/chunk-H3VQYL46.js +0 -50
- package/dist/chunk-H53EBFHV.js +0 -114
- package/dist/chunk-HBD6NLMB.js +0 -51
- package/dist/chunk-HBTQFVPW.js +0 -121
- package/dist/chunk-HCDYAZGJ.js +0 -91
- package/dist/chunk-HE3XKR3P.js +0 -130
- package/dist/chunk-HK3NQMPY.js +0 -51
- package/dist/chunk-HK54SJNM.js +0 -103
- package/dist/chunk-HL2IYNCS.js +0 -50
- package/dist/chunk-I5A3SU35.js +0 -282
- package/dist/chunk-I5HKQSF2.js +0 -59
- package/dist/chunk-I7LXSGQA.js +0 -10
- package/dist/chunk-IDAZ53A4.js +0 -261
- package/dist/chunk-II6HWGH6.js +0 -295
- package/dist/chunk-IIDPTJCI.js +0 -31
- package/dist/chunk-IJ6AAL4W.js +0 -59
- package/dist/chunk-IKZQIIV3.js +0 -123
- package/dist/chunk-ISKELMPI.js +0 -67
- package/dist/chunk-IWUZ6NSN.js +0 -218
- package/dist/chunk-IYDKL3OH.js +0 -130
- package/dist/chunk-IZ75D7KD.js +0 -30
- package/dist/chunk-JCLVMFRY.js +0 -122
- package/dist/chunk-JDHZQIFC.js +0 -135
- package/dist/chunk-JFMZU3WS.js +0 -123
- package/dist/chunk-JI54AM6E.js +0 -105
- package/dist/chunk-JM4DMO5V.js +0 -91
- package/dist/chunk-JNLDVEK3.js +0 -221
- package/dist/chunk-JU3RVFK5.js +0 -114
- package/dist/chunk-JU4PINK3.js +0 -282
- package/dist/chunk-K2YPB4SV.js +0 -38
- package/dist/chunk-K5EXR7F7.js +0 -253
- package/dist/chunk-K7CWFWAA.js +0 -263
- package/dist/chunk-KGCFZ3ZY.js +0 -263
- package/dist/chunk-KJEU2OLC.js +0 -263
- package/dist/chunk-KNZWZVWO.js +0 -50
- package/dist/chunk-KVQDUSDT.js +0 -33
- package/dist/chunk-KXFCVFX7.js +0 -50
- package/dist/chunk-KXWYWY7O.js +0 -135
- package/dist/chunk-KYJFCVGO.js +0 -53
- package/dist/chunk-L4SK5HYC.js +0 -114
- package/dist/chunk-L5OMTPWT.js +0 -130
- package/dist/chunk-LBL6VQ5F.js +0 -51
- package/dist/chunk-LCJKAY5H.js +0 -122
- package/dist/chunk-LEPHUIU3.js +0 -263
- package/dist/chunk-LFNCUQNK.js +0 -103
- package/dist/chunk-LIQIMUDD.js +0 -270
- package/dist/chunk-LJ2W2FEG.js +0 -134
- package/dist/chunk-LJGUNBDS.js +0 -238
- package/dist/chunk-LK6UNOMX.js +0 -24
- package/dist/chunk-LQLPGMGP.js +0 -238
- package/dist/chunk-LRNZOITG.js +0 -318
- package/dist/chunk-LSDPH4GX.js +0 -38
- package/dist/chunk-LXYDGV6K.js +0 -437
- package/dist/chunk-MFNBBTWX.js +0 -177
- package/dist/chunk-MGJ3GO6Z.js +0 -284
- package/dist/chunk-MIMYQH75.js +0 -91
- package/dist/chunk-MKIVQLZW.js +0 -122
- package/dist/chunk-MLQQU3ZN.js +0 -31
- package/dist/chunk-MLTOT73W.js +0 -38
- package/dist/chunk-MM2YBW7A.js +0 -31
- package/dist/chunk-MMHTKJ7Z.js +0 -50
- package/dist/chunk-MNZUBPVB.js +0 -263
- package/dist/chunk-MRXJRTKP.js +0 -62
- package/dist/chunk-MSM2B2VT.js +0 -106
- package/dist/chunk-MTJDLHR6.js +0 -218
- package/dist/chunk-MU4ZBPUT.js +0 -263
- package/dist/chunk-MUQHKNFV.js +0 -158
- package/dist/chunk-N2XNU5PP.js +0 -91
- package/dist/chunk-N4NGR36H.js +0 -263
- package/dist/chunk-NA4H2JQX.js +0 -145
- package/dist/chunk-NBV3Y6UB.js +0 -315
- package/dist/chunk-NEBYCDGE.js +0 -284
- package/dist/chunk-NS2KPONF.js +0 -263
- package/dist/chunk-O2KOOPL4.js +0 -148
- package/dist/chunk-OEIQDS7X.js +0 -50
- package/dist/chunk-OJ4PX3ZG.js +0 -59
- package/dist/chunk-OOIM4AHV.js +0 -106
- package/dist/chunk-OQ2SDHRA.js +0 -267
- package/dist/chunk-OQAOAEH5.js +0 -114
- package/dist/chunk-OQWOF5CI.js +0 -322
- package/dist/chunk-ORW5CX24.js +0 -316
- package/dist/chunk-OUHI4UBN.js +0 -38
- package/dist/chunk-OULD24TE.js +0 -98
- package/dist/chunk-P66A67NV.js +0 -30
- package/dist/chunk-PC5JSEHD.js +0 -269
- package/dist/chunk-PLCJ56FF.js +0 -72
- package/dist/chunk-PMNRGAPH.js +0 -191
- package/dist/chunk-PPU6PK34.js +0 -263
- package/dist/chunk-PQEWSSM5.js +0 -31
- package/dist/chunk-PY6MF2II.js +0 -51
- package/dist/chunk-QBXVAKCM.js +0 -59
- package/dist/chunk-QDAFX66E.js +0 -55
- package/dist/chunk-QEXYUSGH.js +0 -201
- package/dist/chunk-QFEYPU44.js +0 -91
- package/dist/chunk-QJWVR7FR.js +0 -387
- package/dist/chunk-QKKRKHFR.js +0 -38
- package/dist/chunk-QKQ4M6UK.js +0 -263
- package/dist/chunk-QTKPVQAY.js +0 -66
- package/dist/chunk-R3IEEDQ6.js +0 -284
- package/dist/chunk-R4UZI5WE.js +0 -171
- package/dist/chunk-RBXILAST.js +0 -437
- package/dist/chunk-RENGWIST.js +0 -263
- package/dist/chunk-REZ33AJK.js +0 -172
- package/dist/chunk-RGI3V47F.js +0 -216
- package/dist/chunk-RMIQDOJV.js +0 -287
- package/dist/chunk-ROYYCT4A.js +0 -31
- package/dist/chunk-RWVJ2YAO.js +0 -131
- package/dist/chunk-RZLSOKZB.js +0 -123
- package/dist/chunk-S3POCSOH.js +0 -31
- package/dist/chunk-S4IHG5J6.js +0 -54
- package/dist/chunk-SHQVFIVR.js +0 -122
- package/dist/chunk-SPV52UKB.js +0 -50
- package/dist/chunk-SSBZHFHQ.js +0 -123
- package/dist/chunk-STVC6SBJ.js +0 -91
- package/dist/chunk-T23U4LBM.js +0 -148
- package/dist/chunk-TC5ACZ3X.js +0 -263
- package/dist/chunk-TD5JMMNX.js +0 -72
- package/dist/chunk-TDEEN7O7.js +0 -50
- package/dist/chunk-TKRAU33B.js +0 -53
- package/dist/chunk-TMLPJ27P.js +0 -126
- package/dist/chunk-TTKSTVEF.js +0 -41
- package/dist/chunk-TVYKK7ZX.js +0 -123
- package/dist/chunk-TZCA2T5D.js +0 -282
- package/dist/chunk-U2CMWI75.js +0 -250
- package/dist/chunk-UA7N4NQJ.js +0 -30
- package/dist/chunk-ULCNZZBV.js +0 -38
- package/dist/chunk-UO4T3RQ7.js +0 -62
- package/dist/chunk-US3SPKKB.js +0 -266
- package/dist/chunk-UUNHTQDU.js +0 -79
- package/dist/chunk-UUZXVVJY.js +0 -161
- package/dist/chunk-UZJMB6V7.js +0 -26
- package/dist/chunk-V3HXUE6V.js +0 -221
- package/dist/chunk-V6UMVJGA.js +0 -53
- package/dist/chunk-V7C6DTJ6.js +0 -72
- package/dist/chunk-VHWB6H64.js +0 -75
- package/dist/chunk-VI62SXXU.js +0 -284
- package/dist/chunk-VK3FB67Z.js +0 -31
- package/dist/chunk-VKC7QT46.js +0 -83
- package/dist/chunk-VVTY2NT4.js +0 -105
- package/dist/chunk-VWEOVI4O.js +0 -123
- package/dist/chunk-WOCMJF6O.js +0 -221
- package/dist/chunk-WPDU5H5L.js +0 -114
- package/dist/chunk-WQMFGEAF.js +0 -235
- package/dist/chunk-WTAZ6P6T.js +0 -263
- package/dist/chunk-WUJFEG3H.js +0 -118
- package/dist/chunk-WUTFZGXS.js +0 -50
- package/dist/chunk-X65IBJJM.js +0 -436
- package/dist/chunk-XATMLZOP.js +0 -263
- package/dist/chunk-XFCRKJRI.js +0 -261
- package/dist/chunk-XGKHSZ6E.js +0 -38
- package/dist/chunk-XJAQVF2E.js +0 -83
- package/dist/chunk-XQX7HSL5.js +0 -38
- package/dist/chunk-XTP3ODBD.js +0 -56
- package/dist/chunk-XWF3ZJCZ.js +0 -97
- package/dist/chunk-XX3GHFG5.js +0 -121
- package/dist/chunk-XZ6AMNDQ.js +0 -290
- package/dist/chunk-Y2LOHSZL.js +0 -72
- package/dist/chunk-Y66VCVZZ.js +0 -122
- package/dist/chunk-YELD6VJI.js +0 -68
- package/dist/chunk-YHPZ5T3W.js +0 -91
- package/dist/chunk-YJV7JCIC.js +0 -38
- package/dist/chunk-YMZUZ5HX.js +0 -263
- package/dist/chunk-YN7MUHAZ.js +0 -218
- package/dist/chunk-YOCKCBUA.js +0 -72
- package/dist/chunk-YPFUW2PT.js +0 -306
- package/dist/chunk-YRLRIQNP.js +0 -284
- package/dist/chunk-YRTR6KJN.js +0 -210
- package/dist/chunk-YSSJHCRC.js +0 -221
- package/dist/chunk-YWLJJNJY.js +0 -259
- package/dist/chunk-YYRH2SGW.js +0 -114
- package/dist/chunk-YZRIJ4AP.js +0 -263
- package/dist/chunk-Z64CLA4J.js +0 -53
- package/dist/chunk-ZCFOYW2U.js +0 -296
- package/dist/chunk-ZEYZVUG5.js +0 -53
- package/dist/chunk-ZHRZMJA3.js +0 -31
- package/dist/chunk-ZJQAMKIP.js +0 -113
- package/dist/chunk-ZRQZOT6X.js +0 -141
- package/dist/chunk-ZUTAZW53.js +0 -306
- package/dist/chunk-ZVJ2T3DC.js +0 -79
- package/dist/chunk-ZWJZHUKU.js +0 -50
- package/dist/chunk-ZXQKFHBO.js +0 -221
- package/dist/components/Calendar.cjs +0 -219
- package/dist/components/Calendar.js +0 -10
- package/dist/components/CalendarRange.stories.cjs +0 -1
- package/dist/components/CalendarRange.stories.js +0 -0
- package/dist/components/Display1.cjs +0 -223
- package/dist/components/Display1.js +0 -8
- package/dist/components/Display2.cjs +0 -220
- package/dist/components/Display2.js +0 -46
- package/dist/components/Heading1.cjs +0 -223
- package/dist/components/Heading1.js +0 -49
- package/dist/components/Heading2.cjs +0 -223
- package/dist/components/Heading2.js +0 -8
- package/dist/components/Heading3.cjs +0 -223
- package/dist/components/Heading3.js +0 -8
- package/dist/icons-light-QXLRBPC4.woff2 +0 -0
- package/dist/icons-normal-MJATZ73K.woff2 +0 -0
- package/dist/millwork.css +0 -4
package/dist/chunk-HL2IYNCS.js
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
typography
|
|
3
|
-
} from "./chunk-KX3O6GJ6.js";
|
|
4
|
-
import {
|
|
5
|
-
__objRest,
|
|
6
|
-
__spreadProps,
|
|
7
|
-
__spreadValues
|
|
8
|
-
} from "./chunk-ORMEWXMH.js";
|
|
9
|
-
|
|
10
|
-
// src/components/Display1.tsx
|
|
11
|
-
import clsx from "clsx";
|
|
12
|
-
import { jsx } from "react/jsx-runtime";
|
|
13
|
-
var Display1 = (_a) => {
|
|
14
|
-
var _b = _a, {
|
|
15
|
-
className,
|
|
16
|
-
children,
|
|
17
|
-
as = "h1",
|
|
18
|
-
color,
|
|
19
|
-
align
|
|
20
|
-
} = _b, props = __objRest(_b, [
|
|
21
|
-
"className",
|
|
22
|
-
"children",
|
|
23
|
-
"as",
|
|
24
|
-
"color",
|
|
25
|
-
"align"
|
|
26
|
-
]);
|
|
27
|
-
const Element = as;
|
|
28
|
-
return /* @__PURE__ */ jsx(
|
|
29
|
-
Element,
|
|
30
|
-
__spreadProps(__spreadValues({
|
|
31
|
-
className: clsx(
|
|
32
|
-
typography.display1,
|
|
33
|
-
className,
|
|
34
|
-
align === "left" && "text-left",
|
|
35
|
-
align === "center" && "text-center",
|
|
36
|
-
align === "right" && "text-right"
|
|
37
|
-
),
|
|
38
|
-
style: __spreadProps(__spreadValues({}, props.style), {
|
|
39
|
-
color: color ? `var(--color-${color})` : void 0
|
|
40
|
-
})
|
|
41
|
-
}, props), {
|
|
42
|
-
children
|
|
43
|
-
})
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
Display1.displayName = "Display1";
|
|
47
|
-
|
|
48
|
-
export {
|
|
49
|
-
Display1
|
|
50
|
-
};
|
package/dist/chunk-I5A3SU35.js
DELETED
|
@@ -1,282 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Icon
|
|
3
|
-
} from "./chunk-DZLUR2I7.js";
|
|
4
|
-
import {
|
|
5
|
-
componentGap,
|
|
6
|
-
componentPadding,
|
|
7
|
-
componentPaddingXUsingComponentGap,
|
|
8
|
-
componentPaddingYUsingComponentGap,
|
|
9
|
-
paddingUsingComponentGap,
|
|
10
|
-
typography
|
|
11
|
-
} from "./chunk-6XDXJ3Z3.js";
|
|
12
|
-
|
|
13
|
-
// src/components/CalendarRange.tsx
|
|
14
|
-
import clsx from "clsx";
|
|
15
|
-
import { useState } from "react";
|
|
16
|
-
import { Temporal } from "@js-temporal/polyfill";
|
|
17
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
18
|
-
function isWeekend(date) {
|
|
19
|
-
console.log("wut", date.dayOfWeek, date.day, date.month, date.year);
|
|
20
|
-
return date.dayOfWeek === 6 || date.dayOfWeek === 7;
|
|
21
|
-
}
|
|
22
|
-
function DateCell({
|
|
23
|
-
date,
|
|
24
|
-
isInMonth,
|
|
25
|
-
isToday,
|
|
26
|
-
isSelected,
|
|
27
|
-
inRange,
|
|
28
|
-
isDisabled,
|
|
29
|
-
isRangeStart,
|
|
30
|
-
isRangeEnd,
|
|
31
|
-
onClick,
|
|
32
|
-
onMouseEnter,
|
|
33
|
-
onMouseLeave,
|
|
34
|
-
cellPadding = ""
|
|
35
|
-
}) {
|
|
36
|
-
return /* @__PURE__ */ jsx(
|
|
37
|
-
"span",
|
|
38
|
-
{
|
|
39
|
-
className: clsx(
|
|
40
|
-
"flex items-center justify-center aspect-square select-none transition-colors border duration-100 font-medium",
|
|
41
|
-
typography.caption,
|
|
42
|
-
cellPadding,
|
|
43
|
-
!isToday && !isSelected && !inRange && !isDisabled && !isRangeStart && !isRangeEnd && "border-transparent",
|
|
44
|
-
!isInMonth && "border-transparent",
|
|
45
|
-
// Today: subtle border ring
|
|
46
|
-
isToday && !isSelected && !inRange && "rounded-full border-border-primary-normal ",
|
|
47
|
-
// Selected: Figma blue, white text, strong shadow
|
|
48
|
-
isSelected && "bg-action-400 text-white border-action-400 z-10",
|
|
49
|
-
// In range: Figma light blue background
|
|
50
|
-
inRange && !isSelected && "bg-action-100 text-text-primary-normal border-y-action-400 border-x-0 ",
|
|
51
|
-
// Disabled: Figma gray, no pointer, no hover
|
|
52
|
-
isDisabled && !inRange ? "text-text-primary-disabled bg-transparent pointer-events-none opacity-40 border-transparent" : [
|
|
53
|
-
"text-text-primary-normal cursor-pointer",
|
|
54
|
-
// Figma hover: blue bg, blue text
|
|
55
|
-
"hover:bg-action-100 hover:text-action-400",
|
|
56
|
-
// Figma active: darker blue bg, white text
|
|
57
|
-
"active:bg-action-300 active:text-white",
|
|
58
|
-
// Figma focus: ring
|
|
59
|
-
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-400"
|
|
60
|
-
],
|
|
61
|
-
isRangeStart && "rounded-l",
|
|
62
|
-
isRangeEnd && "rounded-r"
|
|
63
|
-
),
|
|
64
|
-
tabIndex: isDisabled ? -1 : 0,
|
|
65
|
-
"aria-disabled": isDisabled,
|
|
66
|
-
onClick: () => !isDisabled && isInMonth && onClick(),
|
|
67
|
-
onMouseEnter: () => isInMonth && onMouseEnter(),
|
|
68
|
-
onMouseLeave: () => isInMonth && onMouseLeave(),
|
|
69
|
-
children: isInMonth ? date.day : ""
|
|
70
|
-
}
|
|
71
|
-
);
|
|
72
|
-
}
|
|
73
|
-
function CalendarRange({
|
|
74
|
-
from,
|
|
75
|
-
to,
|
|
76
|
-
onChange,
|
|
77
|
-
isDateAvailable,
|
|
78
|
-
mode = "double"
|
|
79
|
-
}) {
|
|
80
|
-
const weekDays = ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"];
|
|
81
|
-
const parseDate = (d) => {
|
|
82
|
-
if (!d) return void 0;
|
|
83
|
-
if (typeof d === "number")
|
|
84
|
-
return Temporal.PlainDate.from(new Date(d).toISOString().slice(0, 10));
|
|
85
|
-
if (typeof d === "string") return Temporal.PlainDate.from(d);
|
|
86
|
-
return void 0;
|
|
87
|
-
};
|
|
88
|
-
const fromDate = parseDate(from);
|
|
89
|
-
const toDate = parseDate(to);
|
|
90
|
-
const today = Temporal.Now.plainDateISO();
|
|
91
|
-
const [baseMonth, setBaseMonth] = useState(
|
|
92
|
-
fromDate != null ? fromDate : today.with({ day: 1 })
|
|
93
|
-
);
|
|
94
|
-
const [selecting, setSelecting] = useState("from");
|
|
95
|
-
const [pendingFrom, setPendingFrom] = useState(void 0);
|
|
96
|
-
const [hoveredDate, setHoveredDate] = useState(void 0);
|
|
97
|
-
function getMonthData(monthOffset) {
|
|
98
|
-
const monthDate = baseMonth.add({ months: monthOffset }).with({ day: 1 });
|
|
99
|
-
const days = monthDate.daysInMonth;
|
|
100
|
-
const firstDayOffset = monthDate.dayOfWeek % 7;
|
|
101
|
-
return {
|
|
102
|
-
name: monthDate.toLocaleString("en-US", { month: "long" }),
|
|
103
|
-
year: monthDate.year,
|
|
104
|
-
days,
|
|
105
|
-
firstDayOffset,
|
|
106
|
-
date: monthDate
|
|
107
|
-
};
|
|
108
|
-
}
|
|
109
|
-
function handleDayClick(date) {
|
|
110
|
-
if (isDateAvailable && !isDateAvailable(date)) return;
|
|
111
|
-
if (selecting === "from") {
|
|
112
|
-
setPendingFrom(date);
|
|
113
|
-
setSelecting("to");
|
|
114
|
-
setHoveredDate(void 0);
|
|
115
|
-
} else if (pendingFrom) {
|
|
116
|
-
if (onChange) {
|
|
117
|
-
const [start, end] = Temporal.PlainDate.compare(date, pendingFrom) < 0 ? [date, pendingFrom] : [pendingFrom, date];
|
|
118
|
-
onChange(start.toString(), end.toString());
|
|
119
|
-
}
|
|
120
|
-
setPendingFrom(void 0);
|
|
121
|
-
setSelecting("from");
|
|
122
|
-
setHoveredDate(void 0);
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
function isInRange(date) {
|
|
126
|
-
if (pendingFrom && selecting === "to" && hoveredDate) {
|
|
127
|
-
const [start, end] = Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0 ? [hoveredDate, pendingFrom] : [pendingFrom, hoveredDate];
|
|
128
|
-
return Temporal.PlainDate.compare(date, start) >= 0 && Temporal.PlainDate.compare(date, end) <= 0;
|
|
129
|
-
}
|
|
130
|
-
if (!pendingFrom && fromDate && toDate) {
|
|
131
|
-
return Temporal.PlainDate.compare(date, fromDate) >= 0 && Temporal.PlainDate.compare(date, toDate) <= 0;
|
|
132
|
-
}
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
return /* @__PURE__ */ jsx(
|
|
136
|
-
"div",
|
|
137
|
-
{
|
|
138
|
-
className: clsx(
|
|
139
|
-
"relative bg-background-grouped-primary-normal rounded-base w-fit",
|
|
140
|
-
componentPadding,
|
|
141
|
-
componentGap
|
|
142
|
-
),
|
|
143
|
-
children: /* @__PURE__ */ jsx(
|
|
144
|
-
"div",
|
|
145
|
-
{
|
|
146
|
-
className: clsx(
|
|
147
|
-
"flex flex-row items-start justify-start bg-background-primary-normal overflow-clip",
|
|
148
|
-
componentGap,
|
|
149
|
-
paddingUsingComponentGap
|
|
150
|
-
),
|
|
151
|
-
children: (mode === "double" ? [0, 1] : [0]).map((offset, idx) => {
|
|
152
|
-
const month = getMonthData(offset);
|
|
153
|
-
const totalCells = 42;
|
|
154
|
-
const emptyCells = month.firstDayOffset;
|
|
155
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
|
-
/* @__PURE__ */ jsxs(
|
|
157
|
-
"div",
|
|
158
|
-
{
|
|
159
|
-
className: clsx(
|
|
160
|
-
"flex flex-col",
|
|
161
|
-
componentGap,
|
|
162
|
-
componentPadding
|
|
163
|
-
),
|
|
164
|
-
children: [
|
|
165
|
-
/* @__PURE__ */ jsxs(
|
|
166
|
-
"div",
|
|
167
|
-
{
|
|
168
|
-
className: clsx(
|
|
169
|
-
"flex flex-row items-center justify-between",
|
|
170
|
-
componentGap,
|
|
171
|
-
componentPaddingXUsingComponentGap,
|
|
172
|
-
componentPaddingYUsingComponentGap,
|
|
173
|
-
"mb-3",
|
|
174
|
-
typography.label,
|
|
175
|
-
"text-text-action-primary-normal"
|
|
176
|
-
),
|
|
177
|
-
children: [
|
|
178
|
-
idx === 0 ? /* @__PURE__ */ jsx(
|
|
179
|
-
"button",
|
|
180
|
-
{
|
|
181
|
-
type: "button",
|
|
182
|
-
className: clsx(
|
|
183
|
-
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-primary-normal",
|
|
184
|
-
componentPadding,
|
|
185
|
-
"mr-1"
|
|
186
|
-
),
|
|
187
|
-
"aria-label": "Previous month",
|
|
188
|
-
onClick: () => setBaseMonth(baseMonth.subtract({ months: 1 })),
|
|
189
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "chevron_left", size: 24 })
|
|
190
|
-
}
|
|
191
|
-
) : /* @__PURE__ */ jsx("span", { className: clsx(componentPadding, "mr-1") }),
|
|
192
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold text-text-action-primary-normal text-[14px] leading-[1] truncate", children: month.name }),
|
|
193
|
-
/* @__PURE__ */ jsx("span", { className: "font-semibold text-text-action-primary-normal text-[14px] leading-[1] px-1 truncate", children: month.year }),
|
|
194
|
-
(mode === "double" ? idx === 1 : true) ? /* @__PURE__ */ jsx(
|
|
195
|
-
"button",
|
|
196
|
-
{
|
|
197
|
-
type: "button",
|
|
198
|
-
className: clsx(
|
|
199
|
-
"flex items-center justify-center rounded-base hover:bg-action-100 active:bg-action-300 text-icon-primary-normal",
|
|
200
|
-
componentPadding,
|
|
201
|
-
"ml-1"
|
|
202
|
-
),
|
|
203
|
-
"aria-label": "Next month",
|
|
204
|
-
onClick: () => setBaseMonth(baseMonth.add({ months: 1 })),
|
|
205
|
-
children: /* @__PURE__ */ jsx(Icon, { name: "chevron_right", size: 24 })
|
|
206
|
-
}
|
|
207
|
-
) : /* @__PURE__ */ jsx("span", { className: clsx(componentPadding, "ml-1") })
|
|
208
|
-
]
|
|
209
|
-
}
|
|
210
|
-
),
|
|
211
|
-
/* @__PURE__ */ jsx("div", { className: clsx("grid grid-cols-7 mb-1", componentGap), children: weekDays.map((d) => /* @__PURE__ */ jsx(
|
|
212
|
-
"span",
|
|
213
|
-
{
|
|
214
|
-
className: clsx(
|
|
215
|
-
typography.caption,
|
|
216
|
-
"text-text-secondary-normal text-center"
|
|
217
|
-
),
|
|
218
|
-
children: d
|
|
219
|
-
},
|
|
220
|
-
d
|
|
221
|
-
)) }),
|
|
222
|
-
/* @__PURE__ */ jsx("div", { className: clsx("grid grid-cols-7"), children: Array.from({ length: totalCells }).map((_, i) => {
|
|
223
|
-
const day = i - emptyCells + 1;
|
|
224
|
-
const date = month.date.with({ day: 1 }).add({
|
|
225
|
-
days: i - emptyCells
|
|
226
|
-
});
|
|
227
|
-
const isInMonth = day > 0 && day <= month.days;
|
|
228
|
-
const isToday = isInMonth && date.equals(today);
|
|
229
|
-
const isSelected = isInMonth && (!pendingFrom && fromDate && date.equals(fromDate) || !pendingFrom && toDate && date.equals(toDate) || pendingFrom && date.equals(pendingFrom));
|
|
230
|
-
const inRange = isInMonth && isInRange(date);
|
|
231
|
-
const isDisabled = !isInMonth || (isDateAvailable ? !isDateAvailable(date) : false);
|
|
232
|
-
const hoverDateIsBeforePendingFrom = hoveredDate && pendingFrom && Temporal.PlainDate.compare(hoveredDate, pendingFrom) < 0;
|
|
233
|
-
const hoverDateIsAfterPendingFrom = hoveredDate && pendingFrom && Temporal.PlainDate.compare(hoveredDate, pendingFrom) >= 0;
|
|
234
|
-
const isRangeStart = !pendingFrom && isInMonth && fromDate && date.equals(fromDate) || hoverDateIsAfterPendingFrom && date.equals(pendingFrom);
|
|
235
|
-
const isRangeEnd = !pendingFrom && isInMonth && toDate && date.equals(toDate) || hoverDateIsBeforePendingFrom && date.equals(pendingFrom);
|
|
236
|
-
return /* @__PURE__ */ jsx(
|
|
237
|
-
DateCell,
|
|
238
|
-
{
|
|
239
|
-
date,
|
|
240
|
-
isInMonth: !!isInMonth,
|
|
241
|
-
isToday: !!isToday,
|
|
242
|
-
isSelected: !!isSelected,
|
|
243
|
-
inRange: !!inRange,
|
|
244
|
-
isDisabled: !!isDisabled,
|
|
245
|
-
onClick: () => handleDayClick(date),
|
|
246
|
-
onMouseEnter: () => setHoveredDate(date),
|
|
247
|
-
onMouseLeave: () => setHoveredDate(void 0),
|
|
248
|
-
isRangeStart: !!isRangeStart,
|
|
249
|
-
isRangeEnd: !!isRangeEnd,
|
|
250
|
-
cellPadding: "p-1.5 md:p-2 lg:p-2.5"
|
|
251
|
-
},
|
|
252
|
-
i
|
|
253
|
-
);
|
|
254
|
-
}) })
|
|
255
|
-
]
|
|
256
|
-
},
|
|
257
|
-
month.name + month.year
|
|
258
|
-
),
|
|
259
|
-
mode === "double" && idx === 0 && /* @__PURE__ */ jsx(
|
|
260
|
-
"div",
|
|
261
|
-
{
|
|
262
|
-
className: clsx(
|
|
263
|
-
"self-stretch bg-border-primary-normal rounded-base mx-mobile-component-padding desktop:mx-desktop-component-padding compact:mx-desktop-compact-component-padding",
|
|
264
|
-
// 1px width, full height, matches Figma divider
|
|
265
|
-
"w-px"
|
|
266
|
-
)
|
|
267
|
-
}
|
|
268
|
-
)
|
|
269
|
-
] });
|
|
270
|
-
})
|
|
271
|
-
}
|
|
272
|
-
)
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
var CalendarRange_default = CalendarRange;
|
|
277
|
-
|
|
278
|
-
export {
|
|
279
|
-
isWeekend,
|
|
280
|
-
CalendarRange,
|
|
281
|
-
CalendarRange_default
|
|
282
|
-
};
|
package/dist/chunk-I5HKQSF2.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
componentPaddingXUsingComponentGap,
|
|
3
|
-
typography
|
|
4
|
-
} from "./chunk-JDHZQIFC.js";
|
|
5
|
-
import {
|
|
6
|
-
__objRest,
|
|
7
|
-
__spreadProps,
|
|
8
|
-
__spreadValues
|
|
9
|
-
} from "./chunk-ORMEWXMH.js";
|
|
10
|
-
|
|
11
|
-
// src/components/Paragraph.tsx
|
|
12
|
-
import clsx from "clsx";
|
|
13
|
-
import { jsx } from "react/jsx-runtime";
|
|
14
|
-
var Paragraph = (_a) => {
|
|
15
|
-
var _b = _a, {
|
|
16
|
-
className,
|
|
17
|
-
color,
|
|
18
|
-
padded,
|
|
19
|
-
align = "left",
|
|
20
|
-
tall,
|
|
21
|
-
addOverflow,
|
|
22
|
-
children,
|
|
23
|
-
as = "p"
|
|
24
|
-
} = _b, props = __objRest(_b, [
|
|
25
|
-
"className",
|
|
26
|
-
"color",
|
|
27
|
-
"padded",
|
|
28
|
-
"align",
|
|
29
|
-
"tall",
|
|
30
|
-
"addOverflow",
|
|
31
|
-
"children",
|
|
32
|
-
"as"
|
|
33
|
-
]);
|
|
34
|
-
const Element = as;
|
|
35
|
-
return /* @__PURE__ */ jsx(
|
|
36
|
-
Element,
|
|
37
|
-
__spreadProps(__spreadValues({}, props), {
|
|
38
|
-
className: clsx(
|
|
39
|
-
typography.paragraph,
|
|
40
|
-
className,
|
|
41
|
-
padded && componentPaddingXUsingComponentGap,
|
|
42
|
-
align === "left" && "text-left",
|
|
43
|
-
align === "center" && "text-center",
|
|
44
|
-
align === "right" && "text-right",
|
|
45
|
-
tall && "!leading-6",
|
|
46
|
-
addOverflow && "whitespace-nowrap text-ellipsis overflow-hidden"
|
|
47
|
-
),
|
|
48
|
-
style: __spreadProps(__spreadValues({}, props.style), {
|
|
49
|
-
color: color ? `var(--color-${color})` : void 0
|
|
50
|
-
}),
|
|
51
|
-
children
|
|
52
|
-
})
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
Paragraph.displayName = "Paragraph";
|
|
56
|
-
|
|
57
|
-
export {
|
|
58
|
-
Paragraph
|
|
59
|
-
};
|
package/dist/chunk-I7LXSGQA.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// src/components/ModalContent.tsx
|
|
2
|
-
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
function ModalContent({ children }) {
|
|
4
|
-
return /* @__PURE__ */ jsx("div", { className: "p-4", children });
|
|
5
|
-
}
|
|
6
|
-
ModalContent.displayName = "ModalContent";
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
ModalContent
|
|
10
|
-
};
|
package/dist/chunk-IDAZ53A4.js
DELETED
|
@@ -1,261 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__spreadValues
|
|
3
|
-
} from "./chunk-ORMEWXMH.js";
|
|
4
|
-
|
|
5
|
-
// src/components/useMenuSystem.tsx
|
|
6
|
-
import { useState, useRef, useEffect, useCallback } from "react";
|
|
7
|
-
function useSubMenuSystem() {
|
|
8
|
-
const [activeMenus, setActiveMenus] = useState(
|
|
9
|
-
{}
|
|
10
|
-
);
|
|
11
|
-
const menuRootRef = useRef(null);
|
|
12
|
-
const subMenuRefs = useRef({});
|
|
13
|
-
const hoverTimeoutRef = useRef(null);
|
|
14
|
-
const closeTimeoutRef = useRef(null);
|
|
15
|
-
const toggleMenu = (menuId, level) => {
|
|
16
|
-
if (closeTimeoutRef.current) {
|
|
17
|
-
clearTimeout(closeTimeoutRef.current);
|
|
18
|
-
closeTimeoutRef.current = null;
|
|
19
|
-
}
|
|
20
|
-
setActiveMenus((prev) => {
|
|
21
|
-
const newActiveMenus = __spreadValues({}, prev);
|
|
22
|
-
if (newActiveMenus[level] === menuId) {
|
|
23
|
-
delete newActiveMenus[level];
|
|
24
|
-
} else {
|
|
25
|
-
newActiveMenus[level] = menuId;
|
|
26
|
-
}
|
|
27
|
-
Object.keys(newActiveMenus).forEach((key) => {
|
|
28
|
-
if (Number(key) > level) {
|
|
29
|
-
delete newActiveMenus[Number(key)];
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
return newActiveMenus;
|
|
33
|
-
});
|
|
34
|
-
};
|
|
35
|
-
const openMenu = (menuId, level) => {
|
|
36
|
-
if (closeTimeoutRef.current) {
|
|
37
|
-
clearTimeout(closeTimeoutRef.current);
|
|
38
|
-
closeTimeoutRef.current = null;
|
|
39
|
-
}
|
|
40
|
-
setActiveMenus((prev) => {
|
|
41
|
-
const newActiveMenus = __spreadValues({}, prev);
|
|
42
|
-
newActiveMenus[level] = menuId;
|
|
43
|
-
Object.keys(newActiveMenus).forEach((key) => {
|
|
44
|
-
if (Number(key) > level) {
|
|
45
|
-
delete newActiveMenus[Number(key)];
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
return newActiveMenus;
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
const openMenuWithDelay = (menuId, level, delay = 150) => {
|
|
52
|
-
if (hoverTimeoutRef.current) {
|
|
53
|
-
clearTimeout(hoverTimeoutRef.current);
|
|
54
|
-
}
|
|
55
|
-
hoverTimeoutRef.current = setTimeout(() => {
|
|
56
|
-
openMenu(menuId, level);
|
|
57
|
-
}, delay);
|
|
58
|
-
};
|
|
59
|
-
const closeMenuWithDelay = (level, delay = 300) => {
|
|
60
|
-
if (hoverTimeoutRef.current) {
|
|
61
|
-
clearTimeout(hoverTimeoutRef.current);
|
|
62
|
-
hoverTimeoutRef.current = null;
|
|
63
|
-
}
|
|
64
|
-
closeTimeoutRef.current = setTimeout(() => {
|
|
65
|
-
closeSubMenuLevel(level);
|
|
66
|
-
}, delay);
|
|
67
|
-
};
|
|
68
|
-
const cancelCloseTimeout = () => {
|
|
69
|
-
if (closeTimeoutRef.current) {
|
|
70
|
-
clearTimeout(closeTimeoutRef.current);
|
|
71
|
-
closeTimeoutRef.current = null;
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
const closeSubMenuLevel = (level) => {
|
|
75
|
-
setActiveMenus((prev) => {
|
|
76
|
-
const newActiveMenus = __spreadValues({}, prev);
|
|
77
|
-
delete newActiveMenus[level];
|
|
78
|
-
Object.keys(newActiveMenus).forEach((key) => {
|
|
79
|
-
if (Number(key) >= level) {
|
|
80
|
-
delete newActiveMenus[Number(key)];
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
return newActiveMenus;
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
|
-
const registerSubMenu = (id, element) => {
|
|
87
|
-
subMenuRefs.current[id] = element;
|
|
88
|
-
};
|
|
89
|
-
const isMenuActive = (menuId, level) => {
|
|
90
|
-
return activeMenus[level] === menuId;
|
|
91
|
-
};
|
|
92
|
-
useEffect(() => {
|
|
93
|
-
const handleClickOutside = (event) => {
|
|
94
|
-
var _a;
|
|
95
|
-
if (Object.keys(activeMenus).length === 0) return;
|
|
96
|
-
const target = event.target;
|
|
97
|
-
if ((_a = menuRootRef.current) == null ? void 0 : _a.contains(target)) return;
|
|
98
|
-
const isInsideActiveSubmenu = Object.values(activeMenus).some((id) => {
|
|
99
|
-
const submenuEl = subMenuRefs.current[id];
|
|
100
|
-
return submenuEl == null ? void 0 : submenuEl.contains(target);
|
|
101
|
-
});
|
|
102
|
-
if (!isInsideActiveSubmenu) {
|
|
103
|
-
setActiveMenus({});
|
|
104
|
-
}
|
|
105
|
-
};
|
|
106
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
107
|
-
return () => {
|
|
108
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
109
|
-
};
|
|
110
|
-
}, [activeMenus]);
|
|
111
|
-
useEffect(() => {
|
|
112
|
-
return () => {
|
|
113
|
-
if (hoverTimeoutRef.current) {
|
|
114
|
-
clearTimeout(hoverTimeoutRef.current);
|
|
115
|
-
}
|
|
116
|
-
if (closeTimeoutRef.current) {
|
|
117
|
-
clearTimeout(closeTimeoutRef.current);
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
}, []);
|
|
121
|
-
const getAllFocusableMenuElements = () => {
|
|
122
|
-
const elements = [];
|
|
123
|
-
if (menuRootRef.current) {
|
|
124
|
-
elements.push(...Array.from(menuRootRef.current.children));
|
|
125
|
-
}
|
|
126
|
-
Object.values(activeMenus).forEach((menuId) => {
|
|
127
|
-
const submenuEl = subMenuRefs.current[menuId];
|
|
128
|
-
if (submenuEl) {
|
|
129
|
-
elements.push(...Array.from(submenuEl.children));
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
return elements;
|
|
133
|
-
};
|
|
134
|
-
const findCurrentMenuLevel = (element) => {
|
|
135
|
-
let current = element.parentElement;
|
|
136
|
-
while (current) {
|
|
137
|
-
const level = current.getAttribute("data-menu-level");
|
|
138
|
-
if (level !== null) {
|
|
139
|
-
return parseInt(level, 10);
|
|
140
|
-
}
|
|
141
|
-
current = current.parentElement;
|
|
142
|
-
}
|
|
143
|
-
return 0;
|
|
144
|
-
};
|
|
145
|
-
const getMenuElementsAtLevel = (level) => {
|
|
146
|
-
var _a;
|
|
147
|
-
if (level === 0 && menuRootRef.current) {
|
|
148
|
-
return Array.from(menuRootRef.current.children);
|
|
149
|
-
}
|
|
150
|
-
const menuId = (_a = Object.entries(activeMenus).find(([, id]) => {
|
|
151
|
-
const submenuEl = subMenuRefs.current[id];
|
|
152
|
-
return submenuEl && submenuEl.getAttribute("data-menu-level") === level.toString();
|
|
153
|
-
})) == null ? void 0 : _a[1];
|
|
154
|
-
if (menuId) {
|
|
155
|
-
const submenuEl = subMenuRefs.current[menuId];
|
|
156
|
-
if (submenuEl) {
|
|
157
|
-
return Array.from(submenuEl.children);
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return [];
|
|
161
|
-
};
|
|
162
|
-
return {
|
|
163
|
-
menuRootRef,
|
|
164
|
-
activeMenus,
|
|
165
|
-
toggleMenu,
|
|
166
|
-
openMenu,
|
|
167
|
-
openMenuWithDelay,
|
|
168
|
-
closeMenuWithDelay,
|
|
169
|
-
cancelCloseTimeout,
|
|
170
|
-
isMenuActive,
|
|
171
|
-
registerSubMenu,
|
|
172
|
-
closeSubMenuLevel,
|
|
173
|
-
getAllFocusableMenuElements,
|
|
174
|
-
findCurrentMenuLevel,
|
|
175
|
-
getMenuElementsAtLevel
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
function useMenuPosition(elementRef, position = "bottom", options) {
|
|
179
|
-
const [menuPosition, setMenuPosition] = useState({
|
|
180
|
-
top: 0,
|
|
181
|
-
left: 0,
|
|
182
|
-
minWidth: 0
|
|
183
|
-
});
|
|
184
|
-
const updatePosition = useCallback(() => {
|
|
185
|
-
var _a, _b, _c;
|
|
186
|
-
if (!(elementRef == null ? void 0 : elementRef.current)) return;
|
|
187
|
-
const triggerRect = elementRef.current.getBoundingClientRect();
|
|
188
|
-
const menuRect = (_b = (_a = options == null ? void 0 : options.menuRef) == null ? void 0 : _a.current) == null ? void 0 : _b.getBoundingClientRect();
|
|
189
|
-
const viewportWidth = window.innerWidth;
|
|
190
|
-
const menuWidth = (menuRect == null ? void 0 : menuRect.width) || triggerRect.width;
|
|
191
|
-
const topOffset = (_c = options == null ? void 0 : options.topOffset) != null ? _c : 4;
|
|
192
|
-
let top = 0;
|
|
193
|
-
let left = 0;
|
|
194
|
-
if (position === "bottom" || position === "bottom-right") {
|
|
195
|
-
top = triggerRect.top + window.scrollY + triggerRect.height + topOffset;
|
|
196
|
-
} else {
|
|
197
|
-
top = triggerRect.top + window.scrollY;
|
|
198
|
-
}
|
|
199
|
-
if (position === "bottom") {
|
|
200
|
-
left = triggerRect.left + window.scrollX;
|
|
201
|
-
} else if (position === "bottom-right") {
|
|
202
|
-
left = triggerRect.right + window.scrollX - menuWidth;
|
|
203
|
-
} else if (position === "right") {
|
|
204
|
-
left = triggerRect.right + window.scrollX;
|
|
205
|
-
}
|
|
206
|
-
if (left + menuWidth > viewportWidth) {
|
|
207
|
-
left = Math.max(viewportWidth - menuWidth, 0);
|
|
208
|
-
}
|
|
209
|
-
setMenuPosition({
|
|
210
|
-
top,
|
|
211
|
-
left,
|
|
212
|
-
minWidth: triggerRect.width
|
|
213
|
-
});
|
|
214
|
-
}, [elementRef, position, options == null ? void 0 : options.menuRef, options == null ? void 0 : options.topOffset]);
|
|
215
|
-
useEffect(() => {
|
|
216
|
-
if (!(options == null ? void 0 : options.isOpen) || !(options == null ? void 0 : options.setIsOpen)) return;
|
|
217
|
-
const handleClickOutside = (event) => {
|
|
218
|
-
var _a, _b, _c, _d, _e;
|
|
219
|
-
const target = event.target;
|
|
220
|
-
if ((_a = elementRef.current) == null ? void 0 : _a.contains(target)) return;
|
|
221
|
-
if ((_c = (_b = options.menuRef) == null ? void 0 : _b.current) == null ? void 0 : _c.contains(target)) return;
|
|
222
|
-
if ((_d = options.additionalRefs) == null ? void 0 : _d.some((ref) => {
|
|
223
|
-
var _a2;
|
|
224
|
-
return (_a2 = ref.current) == null ? void 0 : _a2.contains(target);
|
|
225
|
-
}))
|
|
226
|
-
return;
|
|
227
|
-
(_e = options.setIsOpen) == null ? void 0 : _e.call(options, false);
|
|
228
|
-
};
|
|
229
|
-
document.addEventListener("mousedown", handleClickOutside);
|
|
230
|
-
return () => {
|
|
231
|
-
document.removeEventListener("mousedown", handleClickOutside);
|
|
232
|
-
};
|
|
233
|
-
}, [
|
|
234
|
-
options,
|
|
235
|
-
elementRef,
|
|
236
|
-
options == null ? void 0 : options.isOpen,
|
|
237
|
-
options == null ? void 0 : options.setIsOpen,
|
|
238
|
-
options == null ? void 0 : options.menuRef,
|
|
239
|
-
options == null ? void 0 : options.additionalRefs
|
|
240
|
-
]);
|
|
241
|
-
useEffect(() => {
|
|
242
|
-
updatePosition();
|
|
243
|
-
const resizeObserver = new ResizeObserver(updatePosition);
|
|
244
|
-
if (elementRef == null ? void 0 : elementRef.current) {
|
|
245
|
-
resizeObserver.observe(elementRef.current);
|
|
246
|
-
}
|
|
247
|
-
window.addEventListener("scroll", updatePosition);
|
|
248
|
-
window.addEventListener("resize", updatePosition);
|
|
249
|
-
return () => {
|
|
250
|
-
resizeObserver.disconnect();
|
|
251
|
-
window.removeEventListener("scroll", updatePosition);
|
|
252
|
-
window.removeEventListener("resize", updatePosition);
|
|
253
|
-
};
|
|
254
|
-
}, [elementRef, updatePosition]);
|
|
255
|
-
return { menuPosition, updatePosition };
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
export {
|
|
259
|
-
useSubMenuSystem,
|
|
260
|
-
useMenuPosition
|
|
261
|
-
};
|