@vincentgraul/react-components 1.0.40 → 1.0.41
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/package.json +2 -1
- package/.circleci/config.yml +0 -52
- package/.prettierrc.json +0 -4
- package/.storybook/main.ts +0 -17
- package/.storybook/preview.ts +0 -15
- package/doc/.nojekyll +0 -1
- package/doc/assets/highlight.css +0 -22
- package/doc/assets/main.js +0 -54
- package/doc/assets/search.js +0 -1
- package/doc/assets/style.css +0 -1224
- package/doc/assets/widgets.png +0 -0
- package/doc/assets/widgets@2x.png +0 -0
- package/doc/enums/numbered_pagination_NumberedPagination.ArrowPosition.html +0 -78
- package/doc/functions/match_device_useMatchDevice.default.html +0 -70
- package/doc/functions/match_resolution_useMatchResolution.default.html +0 -82
- package/doc/functions/mount_react_hook_mountReactHook.default.html +0 -74
- package/doc/functions/numbered_pagination_NumberedPagination.default.html +0 -75
- package/doc/functions/pagination_usePagination.default.html +0 -85
- package/doc/functions/scroll_to_useScrollTo.default.html +0 -73
- package/doc/functions/table_Table.Td.html +0 -85
- package/doc/functions/table_Table.Th.html +0 -85
- package/doc/functions/table_Table.Tr.html +0 -85
- package/doc/functions/table_Table.default.html +0 -84
- package/doc/functions/visible_useVisible.default.html +0 -69
- package/doc/index.html +0 -98
- package/doc/interfaces/match_device_useMatchDevice.Device.html +0 -96
- package/doc/interfaces/match_resolution_useMatchResolution.Breakpoints.html +0 -159
- package/doc/interfaces/match_resolution_useMatchResolution.MatchResolution.html +0 -102
- package/doc/interfaces/match_resolution_useMatchResolution.Resolution.html +0 -159
- package/doc/interfaces/mount_react_hook_mountReactHook.MountedHook.html +0 -97
- package/doc/interfaces/numbered_pagination_NumberedPagination.Props.html +0 -234
- package/doc/interfaces/pagination_usePagination.Pagination.html +0 -178
- package/doc/interfaces/pagination_usePagination.Props.html +0 -103
- package/doc/interfaces/scroll_to_useScrollTo.ScrollEvents.html +0 -83
- package/doc/interfaces/table_Table.Column.html +0 -85
- package/doc/interfaces/table_Table.Props.html +0 -245
- package/doc/modules/match_device_useMatchDevice.html +0 -66
- package/doc/modules/match_resolution_useMatchResolution.html +0 -75
- package/doc/modules/mount_react_hook_mountReactHook.html +0 -66
- package/doc/modules/numbered_pagination_NumberedPagination.html +0 -71
- package/doc/modules/pagination_usePagination.html +0 -68
- package/doc/modules/scroll_to_useScrollTo.html +0 -66
- package/doc/modules/table_Table.html +0 -74
- package/doc/modules/visible_useVisible.html +0 -61
- package/doc/modules.html +0 -58
- package/doc/variables/match_resolution_useMatchResolution.defaultBreakpoints.html +0 -58
- package/eslint.config.js +0 -36
- package/jest.config.js +0 -5
- package/renovate.json +0 -14
- package/src/breadcrumb/breadcrumb.module.css +0 -17
- package/src/breadcrumb/breadcrumb.tsx +0 -30
- package/src/breadcrumb/icons/arrow.tsx +0 -24
- package/src/breadcrumb/icons/index.ts +0 -1
- package/src/breadcrumb/index.ts +0 -3
- package/src/country-selector/country-selector.module.css +0 -5
- package/src/country-selector/country-selector.tsx +0 -42
- package/src/country-selector/country-selector.types.ts +0 -6
- package/src/country-selector/icons/Ad.tsx +0 -86
- package/src/country-selector/icons/Ae.tsx +0 -22
- package/src/country-selector/icons/Af.tsx +0 -28
- package/src/country-selector/icons/Ag.tsx +0 -23
- package/src/country-selector/icons/Ai.tsx +0 -38
- package/src/country-selector/icons/Al.tsx +0 -17
- package/src/country-selector/icons/Am.tsx +0 -18
- package/src/country-selector/icons/Ao.tsx +0 -21
- package/src/country-selector/icons/Ar.tsx +0 -19
- package/src/country-selector/icons/As.tsx +0 -43
- package/src/country-selector/icons/At.tsx +0 -14
- package/src/country-selector/icons/Au.tsx +0 -25
- package/src/country-selector/icons/Aw.tsx +0 -22
- package/src/country-selector/icons/Az.tsx +0 -22
- package/src/country-selector/icons/Ba.tsx +0 -18
- package/src/country-selector/icons/Bb.tsx +0 -22
- package/src/country-selector/icons/Bd.tsx +0 -14
- package/src/country-selector/icons/Be.tsx +0 -18
- package/src/country-selector/icons/Bf.tsx +0 -21
- package/src/country-selector/icons/Bg.tsx +0 -18
- package/src/country-selector/icons/Bh.tsx +0 -17
- package/src/country-selector/icons/Bi.tsx +0 -45
- package/src/country-selector/icons/Bj.tsx +0 -21
- package/src/country-selector/icons/Bm.tsx +0 -103
- package/src/country-selector/icons/Bo.tsx +0 -177
- package/src/country-selector/icons/Br.tsx +0 -22
- package/src/country-selector/icons/Bs.tsx +0 -18
- package/src/country-selector/icons/Bt.tsx +0 -49
- package/src/country-selector/icons/Bw.tsx +0 -15
- package/src/country-selector/icons/By.tsx +0 -25
- package/src/country-selector/icons/Bz.tsx +0 -193
- package/src/country-selector/icons/Ca.tsx +0 -17
- package/src/country-selector/icons/Cd.tsx +0 -25
- package/src/country-selector/icons/Cf.tsx +0 -24
- package/src/country-selector/icons/Cg.tsx +0 -21
- package/src/country-selector/icons/Ch.tsx +0 -17
- package/src/country-selector/icons/Ci.tsx +0 -18
- package/src/country-selector/icons/Ck.tsx +0 -29
- package/src/country-selector/icons/Cl.tsx +0 -25
- package/src/country-selector/icons/Cm.tsx +0 -18
- package/src/country-selector/icons/Cn.tsx +0 -17
- package/src/country-selector/icons/Co.tsx +0 -18
- package/src/country-selector/icons/Cr.tsx +0 -79
- package/src/country-selector/icons/Cu.tsx +0 -24
- package/src/country-selector/icons/Cv.tsx +0 -19
- package/src/country-selector/icons/Cw.tsx +0 -18
- package/src/country-selector/icons/Cy.tsx +0 -22
- package/src/country-selector/icons/Cz.tsx +0 -21
- package/src/country-selector/icons/De.tsx +0 -18
- package/src/country-selector/icons/Dj.tsx +0 -25
- package/src/country-selector/icons/Dk.tsx +0 -17
- package/src/country-selector/icons/Dm.tsx +0 -60
- package/src/country-selector/icons/Do.tsx +0 -127
- package/src/country-selector/icons/Dz.tsx +0 -21
- package/src/country-selector/icons/Ec.tsx +0 -123
- package/src/country-selector/icons/Ee.tsx +0 -18
- package/src/country-selector/icons/Eg.tsx +0 -22
- package/src/country-selector/icons/Er.tsx +0 -25
- package/src/country-selector/icons/Es.tsx +0 -80
- package/src/country-selector/icons/Et.tsx +0 -26
- package/src/country-selector/icons/Fi.tsx +0 -17
- package/src/country-selector/icons/Fj.tsx +0 -112
- package/src/country-selector/icons/Fk.tsx +0 -96
- package/src/country-selector/icons/Fm.tsx +0 -17
- package/src/country-selector/icons/Fo.tsx +0 -21
- package/src/country-selector/icons/Fr.tsx +0 -18
- package/src/country-selector/icons/Ga.tsx +0 -18
- package/src/country-selector/icons/Gb.tsx +0 -21
- package/src/country-selector/icons/Gd.tsx +0 -24
- package/src/country-selector/icons/Ge.tsx +0 -17
- package/src/country-selector/icons/Gg.tsx +0 -21
- package/src/country-selector/icons/Gh.tsx +0 -22
- package/src/country-selector/icons/Gi.tsx +0 -25
- package/src/country-selector/icons/Gl.tsx +0 -21
- package/src/country-selector/icons/Gm.tsx +0 -19
- package/src/country-selector/icons/Gn.tsx +0 -18
- package/src/country-selector/icons/Gq.tsx +0 -42
- package/src/country-selector/icons/Gr.tsx +0 -23
- package/src/country-selector/icons/Gt.tsx +0 -102
- package/src/country-selector/icons/Gu.tsx +0 -42
- package/src/country-selector/icons/Gw.tsx +0 -25
- package/src/country-selector/icons/Hk.tsx +0 -18
- package/src/country-selector/icons/Hn.tsx +0 -18
- package/src/country-selector/icons/Hr.tsx +0 -78
- package/src/country-selector/icons/Ht.tsx +0 -17
- package/src/country-selector/icons/Hu.tsx +0 -18
- package/src/country-selector/icons/Id.tsx +0 -17
- package/src/country-selector/icons/Ie.tsx +0 -18
- package/src/country-selector/icons/Il.tsx +0 -18
- package/src/country-selector/icons/Im.tsx +0 -76
- package/src/country-selector/icons/In.tsx +0 -34
- package/src/country-selector/icons/Io.tsx +0 -37
- package/src/country-selector/icons/Iq.tsx +0 -22
- package/src/country-selector/icons/Ir.tsx +0 -25
- package/src/country-selector/icons/Is.tsx +0 -21
- package/src/country-selector/icons/It.tsx +0 -18
- package/src/country-selector/icons/Je.tsx +0 -74
- package/src/country-selector/icons/Jm.tsx +0 -18
- package/src/country-selector/icons/Jo.tsx +0 -26
- package/src/country-selector/icons/Jp.tsx +0 -14
- package/src/country-selector/icons/Ke.tsx +0 -35
- package/src/country-selector/icons/Kg.tsx +0 -17
- package/src/country-selector/icons/Kh.tsx +0 -18
- package/src/country-selector/icons/Ki.tsx +0 -38
- package/src/country-selector/icons/Km.tsx +0 -27
- package/src/country-selector/icons/Kn.tsx +0 -29
- package/src/country-selector/icons/Kp.tsx +0 -20
- package/src/country-selector/icons/Kr.tsx +0 -25
- package/src/country-selector/icons/Kw.tsx +0 -22
- package/src/country-selector/icons/Ky.tsx +0 -134
- package/src/country-selector/icons/Kz.tsx +0 -19
- package/src/country-selector/icons/La.tsx +0 -15
- package/src/country-selector/icons/Lb.tsx +0 -18
- package/src/country-selector/icons/Li.tsx +0 -25
- package/src/country-selector/icons/Lk.tsx +0 -67
- package/src/country-selector/icons/Lr.tsx +0 -34
- package/src/country-selector/icons/Ls.tsx +0 -22
- package/src/country-selector/icons/Lt.tsx +0 -18
- package/src/country-selector/icons/Lu.tsx +0 -18
- package/src/country-selector/icons/Lv.tsx +0 -14
- package/src/country-selector/icons/Ly.tsx +0 -22
- package/src/country-selector/icons/Ma.tsx +0 -17
- package/src/country-selector/icons/Mc.tsx +0 -17
- package/src/country-selector/icons/Md.tsx +0 -100
- package/src/country-selector/icons/Me.tsx +0 -33
- package/src/country-selector/icons/Mg.tsx +0 -18
- package/src/country-selector/icons/Mh.tsx +0 -25
- package/src/country-selector/icons/Mk.tsx +0 -17
- package/src/country-selector/icons/Ml.tsx +0 -18
- package/src/country-selector/icons/Mm.tsx +0 -22
- package/src/country-selector/icons/Mn.tsx +0 -24
- package/src/country-selector/icons/Mo.tsx +0 -21
- package/src/country-selector/icons/Mp.tsx +0 -53
- package/src/country-selector/icons/Mq.tsx +0 -17
- package/src/country-selector/icons/Mr.tsx +0 -17
- package/src/country-selector/icons/Ms.tsx +0 -62
- package/src/country-selector/icons/Mt.tsx +0 -51
- package/src/country-selector/icons/Mu.tsx +0 -19
- package/src/country-selector/icons/Mv.tsx +0 -18
- package/src/country-selector/icons/Mw.tsx +0 -21
- package/src/country-selector/icons/Mx.tsx +0 -65
- package/src/country-selector/icons/My.tsx +0 -37
- package/src/country-selector/icons/Mz.tsx +0 -36
- package/src/country-selector/icons/Na.tsx +0 -26
- package/src/country-selector/icons/Nato.tsx +0 -17
- package/src/country-selector/icons/Ne.tsx +0 -19
- package/src/country-selector/icons/Nf.tsx +0 -18
- package/src/country-selector/icons/Ng.tsx +0 -18
- package/src/country-selector/icons/Ni.tsx +0 -73
- package/src/country-selector/icons/Nl.tsx +0 -18
- package/src/country-selector/icons/No.tsx +0 -21
- package/src/country-selector/icons/Np.tsx +0 -25
- package/src/country-selector/icons/Nr.tsx +0 -18
- package/src/country-selector/icons/Nu.tsx +0 -30
- package/src/country-selector/icons/Nz.tsx +0 -49
- package/src/country-selector/icons/Om.tsx +0 -29
- package/src/country-selector/icons/Pa.tsx +0 -25
- package/src/country-selector/icons/Pe.tsx +0 -18
- package/src/country-selector/icons/Pf.tsx +0 -30
- package/src/country-selector/icons/Pg.tsx +0 -25
- package/src/country-selector/icons/Ph.tsx +0 -25
- package/src/country-selector/icons/Pk.tsx +0 -17
- package/src/country-selector/icons/Pl.tsx +0 -17
- package/src/country-selector/icons/Pn.tsx +0 -153
- package/src/country-selector/icons/Pr.tsx +0 -27
- package/src/country-selector/icons/Ps.tsx +0 -22
- package/src/country-selector/icons/Pt.tsx +0 -39
- package/src/country-selector/icons/Pw.tsx +0 -14
- package/src/country-selector/icons/Py.tsx +0 -31
- package/src/country-selector/icons/Qa.tsx +0 -17
- package/src/country-selector/icons/Ro.tsx +0 -18
- package/src/country-selector/icons/Rs.tsx +0 -89
- package/src/country-selector/icons/Ru.tsx +0 -18
- package/src/country-selector/icons/Rw.tsx +0 -22
- package/src/country-selector/icons/Sa.tsx +0 -23
- package/src/country-selector/icons/Sb.tsx +0 -25
- package/src/country-selector/icons/Sc.tsx +0 -29
- package/src/country-selector/icons/Sd.tsx +0 -22
- package/src/country-selector/icons/Se.tsx +0 -17
- package/src/country-selector/icons/Sg.tsx +0 -17
- package/src/country-selector/icons/Si.tsx +0 -33
- package/src/country-selector/icons/Sk.tsx +0 -34
- package/src/country-selector/icons/Sl.tsx +0 -18
- package/src/country-selector/icons/Sm.tsx +0 -102
- package/src/country-selector/icons/Sn.tsx +0 -22
- package/src/country-selector/icons/So.tsx +0 -17
- package/src/country-selector/icons/Sq.tsx +0 -41
- package/src/country-selector/icons/Sr.tsx +0 -19
- package/src/country-selector/icons/Ss.tsx +0 -30
- package/src/country-selector/icons/St.tsx +0 -22
- package/src/country-selector/icons/Sv.tsx +0 -141
- package/src/country-selector/icons/Sx.tsx +0 -71
- package/src/country-selector/icons/Sy.tsx +0 -22
- package/src/country-selector/icons/Sz.tsx +0 -60
- package/src/country-selector/icons/Tc.tsx +0 -53
- package/src/country-selector/icons/Td.tsx +0 -18
- package/src/country-selector/icons/Tg.tsx +0 -27
- package/src/country-selector/icons/Th.tsx +0 -14
- package/src/country-selector/icons/Tibet.tsx +0 -260
- package/src/country-selector/icons/Tj.tsx +0 -22
- package/src/country-selector/icons/Tk.tsx +0 -21
- package/src/country-selector/icons/Tm.tsx +0 -59
- package/src/country-selector/icons/Tn.tsx +0 -21
- package/src/country-selector/icons/To.tsx +0 -21
- package/src/country-selector/icons/Tr.tsx +0 -17
- package/src/country-selector/icons/Tt.tsx +0 -18
- package/src/country-selector/icons/Tv.tsx +0 -29
- package/src/country-selector/icons/Tw.tsx +0 -21
- package/src/country-selector/icons/Tz.tsx +0 -22
- package/src/country-selector/icons/Ua.tsx +0 -17
- package/src/country-selector/icons/Ug.tsx +0 -51
- package/src/country-selector/icons/Us.tsx +0 -25
- package/src/country-selector/icons/Uy.tsx +0 -53
- package/src/country-selector/icons/Uz.tsx +0 -27
- package/src/country-selector/icons/Ve.tsx +0 -22
- package/src/country-selector/icons/Vi.tsx +0 -42
- package/src/country-selector/icons/Vn.tsx +0 -17
- package/src/country-selector/icons/Vu.tsx +0 -29
- package/src/country-selector/icons/Ws.tsx +0 -21
- package/src/country-selector/icons/Ye.tsx +0 -18
- package/src/country-selector/icons/Za.tsx +0 -25
- package/src/country-selector/icons/Zm.tsx +0 -23
- package/src/country-selector/icons/Zw.tsx +0 -41
- package/src/country-selector/icons/index.ts +0 -223
- package/src/country-selector/index.ts +0 -2
- package/src/index.ts +0 -17
- package/src/input/index.ts +0 -2
- package/src/input/input.module.css +0 -71
- package/src/input/input.tsx +0 -38
- package/src/input/input.types.ts +0 -10
- package/src/loader/index.ts +0 -1
- package/src/loader/loader.module.css +0 -40
- package/src/loader/loader.tsx +0 -30
- package/src/modal/index.ts +0 -1
- package/src/modal/modal.module.css +0 -22
- package/src/modal/modal.tsx +0 -27
- package/src/mount-react-hook/index.ts +0 -2
- package/src/mount-react-hook/mount-react-hook.tsx +0 -28
- package/src/mount-react-hook/mount-react-hook.types.ts +0 -5
- package/src/pagination/index.ts +0 -2
- package/src/pagination/pagination.module.css +0 -31
- package/src/pagination/pagination.tsx +0 -90
- package/src/pagination/pagination.types.ts +0 -4
- package/src/select/icons/ArrowBottom.tsx +0 -12
- package/src/select/icons/index.ts +0 -1
- package/src/select/index.ts +0 -2
- package/src/select/select.module.css +0 -54
- package/src/select/select.tsx +0 -85
- package/src/select/select.types.ts +0 -9
- package/src/table/index.ts +0 -2
- package/src/table/table.module.css +0 -33
- package/src/table/table.tsx +0 -83
- package/src/table/table.types.ts +0 -5
- package/src/use-breadcrumb/index.ts +0 -2
- package/src/use-breadcrumb/use-breadcrumb.tsx +0 -35
- package/src/use-breadcrumb/use-breadcrumb.types.ts +0 -12
- package/src/use-match-device/index.ts +0 -2
- package/src/use-match-device/use-match-device.ts +0 -41
- package/src/use-match-device/use-match-device.types.ts +0 -6
- package/src/use-match-resolution/index.ts +0 -2
- package/src/use-match-resolution/use-match-resolution.ts +0 -72
- package/src/use-match-resolution/use-match-resolution.types.ts +0 -37
- package/src/use-outside-alerter/index.ts +0 -2
- package/src/use-outside-alerter/use-outside-alerter.tsx +0 -29
- package/src/use-outside-alerter/use-outside-alerter.types.ts +0 -4
- package/src/use-pagination/index.ts +0 -2
- package/src/use-pagination/use-pagination.ts +0 -86
- package/src/use-pagination/use-pagination.types.ts +0 -11
- package/src/use-scroll-to/index.ts +0 -2
- package/src/use-scroll-to/use-scroll-to.tsx +0 -25
- package/src/use-scroll-to/use-scroll-to.types.ts +0 -3
- package/src/use-visible/index.ts +0 -1
- package/src/use-visible/use-visible.ts +0 -31
- package/src/wizard/index.ts +0 -2
- package/src/wizard/wizard.tsx +0 -44
- package/src/wizard/wizard.types.ts +0 -7
- package/stories/breadcrumb/breadcrumb.stories.tsx +0 -21
- package/stories/country-selector/country-selector.stories.tsx +0 -14
- package/stories/input/input.stories.tsx +0 -42
- package/stories/loader/assets/white-loader.svg +0 -20
- package/stories/loader/loader.stories.tsx +0 -12
- package/stories/modal/modal.stories.tsx +0 -21
- package/stories/pagination/assets/double-left-arrow.svg +0 -13
- package/stories/pagination/assets/double-right-arrow.svg +0 -13
- package/stories/pagination/assets/single-left-arrow.svg +0 -10
- package/stories/pagination/assets/single-right-arrow.svg +0 -10
- package/stories/pagination/pagination.stories.tsx +0 -89
- package/stories/select/select.stories.tsx +0 -33
- package/stories/table/assets/double-left-arrow.svg +0 -13
- package/stories/table/assets/double-right-arrow.svg +0 -13
- package/stories/table/assets/single-left-arrow.svg +0 -10
- package/stories/table/assets/single-right-arrow.svg +0 -10
- package/stories/table/table.stories.tsx +0 -219
- package/stories/use-match-device/use-match-device.stories.tsx +0 -22
- package/stories/use-match-resolution/use-match-resolution.stories.tsx +0 -31
- package/stories/use-outside-alerter/use-outside-alerter.stories.tsx +0 -19
- package/stories/use-scroll-to/use-scroll-to.stories.tsx +0 -74
- package/stories/use-visible/use-visible.stories.tsx +0 -71
- package/stories/wizard/wizard.stories.tsx +0 -35
- package/tests/pagination/use-pagination.test.ts +0 -23
- package/tests/setup.js +0 -23
- package/tests/use-match-resolution/use-match-resolution.test.ts +0 -32
- package/tests/use-visible/use-visible.test.tsx +0 -53
- package/tsconfig.json +0 -16
- package/typedoc.json +0 -7
- package/types.d.ts +0 -5
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export type Breakpoints = {
|
|
2
|
-
desktop: string;
|
|
3
|
-
laptop: string;
|
|
4
|
-
laptopOrUpper: string;
|
|
5
|
-
laptopOrLower: string;
|
|
6
|
-
tablet: string;
|
|
7
|
-
tabletOrUpper: string;
|
|
8
|
-
tabletOrLower: string;
|
|
9
|
-
largeMobile: string;
|
|
10
|
-
largeMobileOrUpper: string;
|
|
11
|
-
largeMobileOrLower: string;
|
|
12
|
-
mobile: string;
|
|
13
|
-
portrait: string;
|
|
14
|
-
landscape: string;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export type Resolution = {
|
|
18
|
-
isDesktop: boolean;
|
|
19
|
-
isLaptop: boolean;
|
|
20
|
-
isLaptopOrUpper: boolean;
|
|
21
|
-
isLaptopOrLower: boolean;
|
|
22
|
-
isTablet: boolean;
|
|
23
|
-
isTabletOrUpper: boolean;
|
|
24
|
-
isTabletOrLower: boolean;
|
|
25
|
-
isLargeMobile: boolean;
|
|
26
|
-
isLargeMobileOrUpper: boolean;
|
|
27
|
-
isLargeMobileOrLower: boolean;
|
|
28
|
-
isMobile: boolean;
|
|
29
|
-
isPortrait: boolean;
|
|
30
|
-
isLandscape: boolean;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export type MatchResolution = {
|
|
34
|
-
resolution: Resolution;
|
|
35
|
-
breakpoints: Breakpoints;
|
|
36
|
-
match: (query: string) => boolean;
|
|
37
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { useEffect, RefObject, useState } from "react";
|
|
2
|
-
import { OutsideAlerter } from "./use-outside-alerter.types";
|
|
3
|
-
|
|
4
|
-
export const useOutsideAlerter = (ref: RefObject<HTMLElement>): OutsideAlerter => {
|
|
5
|
-
const [hasClickedOutside, setClickedOutside] = useState<boolean>(false);
|
|
6
|
-
|
|
7
|
-
const handleOnReset = () => {
|
|
8
|
-
setClickedOutside(false);
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
const handleOnClickOutside = (event: MouseEvent) => {
|
|
13
|
-
if (event.target && ref.current) {
|
|
14
|
-
const value: boolean = !ref.current.contains(event.target as Node);
|
|
15
|
-
|
|
16
|
-
if (value !== hasClickedOutside) {
|
|
17
|
-
setClickedOutside(value);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
document.addEventListener("mousedown", handleOnClickOutside);
|
|
23
|
-
return () => {
|
|
24
|
-
document.removeEventListener("mousedown", handleOnClickOutside);
|
|
25
|
-
};
|
|
26
|
-
}, [ref, hasClickedOutside]);
|
|
27
|
-
|
|
28
|
-
return { hasClickedOutside, onReset: handleOnReset };
|
|
29
|
-
};
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState } from "react";
|
|
2
|
-
import { PaginationData } from "./use-pagination.types";
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
page: number;
|
|
6
|
-
totalRecords: number;
|
|
7
|
-
maxRecordsPerPage?: number;
|
|
8
|
-
itemNeighbours?: number;
|
|
9
|
-
minItems?: number;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* React hook to manage pagination.
|
|
14
|
-
* @public
|
|
15
|
-
* @param props - An object which multiple properties:
|
|
16
|
-
* - page: the current page
|
|
17
|
-
* - totalRecords: the total number of records
|
|
18
|
-
* - maxRecordsPerPage: the maximum number of records displayed per page
|
|
19
|
-
* - itemNeighbours: the maximum number of items (page indicator) beside the current item
|
|
20
|
-
* - minItems: the minimum of items (page indicator)
|
|
21
|
-
* @returns An object with multiples properties:
|
|
22
|
-
* - page: the current page
|
|
23
|
-
* - total: the total number of pages
|
|
24
|
-
* - items: an array of numbers (represents the page indicators)
|
|
25
|
-
* - maxRecordsPerPage: the maximum number of records displayed per page
|
|
26
|
-
* - some functions to change the page (goToPage, goToFirst...)
|
|
27
|
-
*/
|
|
28
|
-
export const usePagination = (props: Props): PaginationData => {
|
|
29
|
-
const { totalRecords, itemNeighbours = 2, minItems = 5, maxRecordsPerPage = 10 } = props;
|
|
30
|
-
const [page, setPage] = useState<number>(props.page);
|
|
31
|
-
const [total, setTotal] = useState<number>(0);
|
|
32
|
-
const [items, setItems] = useState<number[]>([]);
|
|
33
|
-
|
|
34
|
-
const generateItems = () => {
|
|
35
|
-
const items: number[] = [];
|
|
36
|
-
const from: number = Math.max(1, Math.min(page - itemNeighbours, total + 1 - minItems));
|
|
37
|
-
const to: number = Math.min(total, Math.max(minItems, page + itemNeighbours));
|
|
38
|
-
|
|
39
|
-
for (let i = from; i <= to; i++) {
|
|
40
|
-
items.push(i);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return items;
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
useEffect(() => {
|
|
47
|
-
setTotal(Math.ceil(totalRecords / maxRecordsPerPage));
|
|
48
|
-
}, [totalRecords, maxRecordsPerPage]);
|
|
49
|
-
|
|
50
|
-
useEffect(() => {
|
|
51
|
-
setItems(generateItems());
|
|
52
|
-
}, [page, total, itemNeighbours, minItems]);
|
|
53
|
-
|
|
54
|
-
const goToPage = (page: number) => {
|
|
55
|
-
const currentPage: number = Math.max(1, Math.min(page, total));
|
|
56
|
-
setPage(currentPage);
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const goToFirst = () => {
|
|
60
|
-
goToPage(1);
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const goToLeft = () => {
|
|
64
|
-
goToPage(page - 1);
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const goToRight = () => {
|
|
68
|
-
goToPage(page + 1);
|
|
69
|
-
};
|
|
70
|
-
|
|
71
|
-
const goToLast = () => {
|
|
72
|
-
goToPage(total);
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
return {
|
|
76
|
-
page,
|
|
77
|
-
total,
|
|
78
|
-
items,
|
|
79
|
-
maxRecordsPerPage,
|
|
80
|
-
goToPage,
|
|
81
|
-
goToFirst,
|
|
82
|
-
goToLeft,
|
|
83
|
-
goToRight,
|
|
84
|
-
goToLast,
|
|
85
|
-
};
|
|
86
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { RefObject } from "react";
|
|
2
|
-
import { ScrollEvents } from "./use-scroll-to.types";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* React hook to scroll to an element.
|
|
6
|
-
* @public
|
|
7
|
-
* @param target - The target where we want to scroll.
|
|
8
|
-
* @returns An object which contains:
|
|
9
|
-
* - scrollToTop: function used to scroll to the top of the element
|
|
10
|
-
*/
|
|
11
|
-
export const useScrollTo = (target: RefObject<HTMLElement>): ScrollEvents => {
|
|
12
|
-
const isClientSide: boolean = typeof window !== "undefined";
|
|
13
|
-
|
|
14
|
-
if (!isClientSide) {
|
|
15
|
-
return { scrollToTop: () => null };
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
const scrollToTop = (): void => {
|
|
19
|
-
if (target.current) {
|
|
20
|
-
window.scrollTo(0, target.current.offsetTop);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
return { scrollToTop };
|
|
25
|
-
};
|
package/src/use-visible/index.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./use-visible";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { useEffect, useState, RefObject } from "react";
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* React hook to know if an element is visible.
|
|
5
|
-
* @public
|
|
6
|
-
* @param target - The target where you want to identify its visibility.
|
|
7
|
-
* @returns The visibility of the target.
|
|
8
|
-
*/
|
|
9
|
-
export const useVisible = (target: RefObject<HTMLElement>): boolean => {
|
|
10
|
-
const [isVisible, setVisibility] = useState<boolean>(false);
|
|
11
|
-
|
|
12
|
-
const handleObserver = (entry: IntersectionObserverEntry) => {
|
|
13
|
-
setVisibility(entry.isIntersecting);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
const observer = new IntersectionObserver(([entry]) => handleObserver(entry));
|
|
18
|
-
|
|
19
|
-
if (target && target.current) {
|
|
20
|
-
observer.observe(target.current);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
return () => {
|
|
24
|
-
if (target && target.current) {
|
|
25
|
-
observer.unobserve(target.current);
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
}, [target]);
|
|
29
|
-
|
|
30
|
-
return isVisible;
|
|
31
|
-
};
|
package/src/wizard/index.ts
DELETED
package/src/wizard/wizard.tsx
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import React, { ReactElement, useEffect, useState } from "react";
|
|
2
|
-
import { StepProps } from "./wizard.types";
|
|
3
|
-
|
|
4
|
-
type Props = {
|
|
5
|
-
children: ReactElement[];
|
|
6
|
-
step?: number;
|
|
7
|
-
renderHeader?: (props: StepProps) => ReactElement;
|
|
8
|
-
renderFooter?: (props: StepProps) => ReactElement;
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
export const Wizard = (props: Props) => {
|
|
12
|
-
const { children, renderHeader, renderFooter } = props;
|
|
13
|
-
const [step, setStep] = useState(1);
|
|
14
|
-
const totalSteps = React.Children.count(children);
|
|
15
|
-
const [isFirstPage, setFirstPage] = useState(false);
|
|
16
|
-
const [isLastPage, setLastPage] = useState(false);
|
|
17
|
-
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
if (props.step <= totalSteps) setStep(props.step);
|
|
20
|
-
}, [props.step]);
|
|
21
|
-
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
setFirstPage(step === 1);
|
|
24
|
-
setLastPage(step === totalSteps);
|
|
25
|
-
}, [step]);
|
|
26
|
-
|
|
27
|
-
const currentPage: ReactElement = React.Children.toArray(children)[step - 1] as ReactElement;
|
|
28
|
-
|
|
29
|
-
const nextStep = () => {
|
|
30
|
-
if (step < totalSteps) setStep(step + 1);
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const previousStep = () => {
|
|
34
|
-
if (step > 1) setStep(step - 1);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<div>
|
|
39
|
-
{renderHeader({ step, previousStep, nextStep, isFirstPage, isLastPage })}
|
|
40
|
-
{React.cloneElement(currentPage)}
|
|
41
|
-
{renderFooter({ step, previousStep, nextStep, isFirstPage, isLastPage })}
|
|
42
|
-
</div>
|
|
43
|
-
);
|
|
44
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useBreadcrumb, Breadcrumb } from "../../src";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "useBreadcrumb",
|
|
5
|
-
component: useBreadcrumb,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Basic = () => {
|
|
9
|
-
return (
|
|
10
|
-
<Breadcrumb
|
|
11
|
-
url={
|
|
12
|
-
new URL(
|
|
13
|
-
"https://stackoverflow.com/questions/39334400/how-to-split-url-to-get-url-path-in-javascript?value=3&name=5",
|
|
14
|
-
)
|
|
15
|
-
}
|
|
16
|
-
onClick={(element) => {
|
|
17
|
-
console.log(element);
|
|
18
|
-
}}
|
|
19
|
-
></Breadcrumb>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CountrySelector } from "../../src";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "CountrySelector",
|
|
5
|
-
component: CountrySelector,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Basic = () => {
|
|
9
|
-
return <CountrySelector languages={["fr", "ye", "vu", "uz"]} />;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const WithValue = () => {
|
|
13
|
-
return <CountrySelector value="vu" languages={["fr", "ye", "vu", "uz"]} />;
|
|
14
|
-
};
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Input } from "../../src";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Input",
|
|
5
|
-
component: Input,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Basic = () => {
|
|
9
|
-
return (
|
|
10
|
-
<Input
|
|
11
|
-
name="firstname"
|
|
12
|
-
type="text"
|
|
13
|
-
label="firstname"
|
|
14
|
-
autoComplete="off"
|
|
15
|
-
colors={{
|
|
16
|
-
error: "red",
|
|
17
|
-
focus: "blue",
|
|
18
|
-
success: "green",
|
|
19
|
-
warning: "orange",
|
|
20
|
-
}}
|
|
21
|
-
/>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
export const WithMessage = () => {
|
|
26
|
-
return (
|
|
27
|
-
<Input
|
|
28
|
-
name="firstname"
|
|
29
|
-
type="text"
|
|
30
|
-
label="firstname"
|
|
31
|
-
message="firstname error"
|
|
32
|
-
status="error"
|
|
33
|
-
autoComplete="off"
|
|
34
|
-
colors={{
|
|
35
|
-
error: "red",
|
|
36
|
-
focus: "blue",
|
|
37
|
-
success: "green",
|
|
38
|
-
warning: "orange",
|
|
39
|
-
}}
|
|
40
|
-
/>
|
|
41
|
-
);
|
|
42
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
-
<svg width="98px" height="102px" viewBox="0 0 98 102" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
-
<!-- Generator: Sketch 61.2 (89653) - https://sketch.com -->
|
|
4
|
-
<title>loader</title>
|
|
5
|
-
<desc>Created with Sketch.</desc>
|
|
6
|
-
<g id="Page-13" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
7
|
-
<g id="loader" transform="translate(-26.000000, -21.000000)" fill="#FFFFFF" fill-rule="nonzero">
|
|
8
|
-
<g id="spinner-of-dots" transform="translate(73.323621, 72.737597) rotate(-134.000000) translate(-73.323621, -72.737597) translate(23.323621, 20.237597)">
|
|
9
|
-
<path d="M22.9250569,73.8797267 C20.3230068,73.8797267 18.1118451,74.790205 16.2906606,76.6111617 C14.4701595,78.433713 13.5592255,80.6444191 13.5592255,83.2464692 C13.5592255,85.8487472 14.4694761,88.0594533 16.2906606,89.8820046 C18.1125285,91.7029613 20.3236902,92.6134396 22.9250569,92.6134396 C25.4833713,92.6134396 27.6833713,91.7029613 29.5264237,89.8820046 C31.3687927,88.0617312 32.2899772,85.8487472 32.2899772,83.2464692 C32.2899772,80.6444191 31.3690205,78.4353075 29.5264237,76.6111617 C27.6831435,74.7917995 25.4833713,73.8797267 22.9250569,73.8797267 Z" id="Path"></path>
|
|
10
|
-
<path d="M20.8439636,54.109795 C20.8439636,51.2482916 19.8255125,48.7993166 17.7874715,46.7596811 C15.7496583,44.7218679 13.2995444,43.7031891 10.438041,43.7031891 C7.57630979,43.7031891 5.12665148,44.7220957 3.08861048,46.7596811 C1.05102506,48.7977221 0.0323462415,51.2473804 0.0323462415,54.109795 C0.0323462415,56.9708428 1.05079727,59.4193622 3.08861048,61.4578588 C5.12665148,63.4963554 7.57630979,64.515262 10.438041,64.515262 C13.2995444,64.515262 15.7496583,63.4963554 17.7874715,61.4578588 C19.8255125,59.4207289 20.8439636,56.9708428 20.8439636,54.109795 Z" id="Path"></path>
|
|
11
|
-
<path d="M81.1968109,30.1776765 C82.6264237,30.1776765 83.853303,29.667426 84.8708428,28.6489749 C85.8897494,27.6296128 86.4002278,26.404328 86.4002278,24.9738041 C86.4002278,23.5425968 85.8897494,22.3182232 84.8708428,21.2995444 C83.8526196,20.2801822 82.6264237,19.7708428 81.1968109,19.7708428 C79.7656036,19.7708428 78.5400911,20.2810934 77.5211845,21.2995444 C76.5029613,22.318451 75.9933941,23.5425968 75.9933941,24.9738041 C75.9933941,26.4050114 76.5029613,27.6296128 77.5211845,28.6489749 C78.5400911,29.6683371 79.7656036,30.1776765 81.1968109,30.1776765 Z" id="Path"></path>
|
|
12
|
-
<path d="M22.9257403,13.5280182 C19.7601367,13.5280182 17.0612756,14.6446469 14.828246,16.877221 C12.5949886,19.109795 11.4790433,21.8088838 11.4790433,24.9738041 C11.4790433,28.1398633 12.5949886,30.8378132 14.828246,33.0712984 C17.061959,35.3045558 19.76082,36.4209567 22.9257403,36.4209567 C26.0906606,36.4209567 28.7897494,35.3038724 31.0223235,33.0712984 C33.2548975,30.8378132 34.3715262,28.13918 34.3715262,24.9738041 C34.3715262,21.8088838 33.2548975,19.109795 31.0223235,16.877221 C28.7897494,14.6446469 26.0906606,13.5280182 22.9257403,13.5280182 Z" id="Path"></path>
|
|
13
|
-
<path d="M98.1056948,49.6867882 C96.8920273,48.4726651 95.4179954,47.866287 93.6842825,47.866287 C91.9489749,47.866287 90.4749431,48.4726651 89.2612756,49.6867882 C88.0482916,50.9009112 87.4419134,52.3753986 87.4419134,54.1107062 C87.4419134,55.8441913 88.0482916,57.3207289 89.2612756,58.5321185 C90.4756264,59.746697 91.9489749,60.3530752 93.6842825,60.3530752 C95.4179954,60.3530752 96.8929385,59.746697 98.1056948,58.5321185 C99.3202733,57.3193622 99.9259681,55.8441913 99.9259681,54.1107062 C99.9259681,52.3763098 99.3211845,50.9015945 98.1056948,49.6867882 Z" id="Path"></path>
|
|
14
|
-
<path d="M81.1968109,75.961959 C79.201139,75.961959 77.4886105,76.6767654 76.0574032,78.1079727 C74.6277904,79.5375854 73.9120729,81.2510251 73.9120729,83.246697 C73.9120729,85.2407745 74.6277904,86.9542141 76.0574032,88.3856492 C77.4886105,89.8166287 79.2013667,90.5307517 81.1968109,90.5307517 C83.1908884,90.5307517 84.9034169,89.815262 86.3346241,88.3856492 C87.7658314,86.9544419 88.4808656,85.2416856 88.4808656,83.246697 C88.4808656,81.2510251 87.7658314,79.5394077 86.3346241,78.1079727 C84.9036446,76.6765376 83.1908884,75.961959 81.1968109,75.961959 Z" id="Path"></path>
|
|
15
|
-
<path d="M52.06082,87.4070615 C49.7628702,87.4070615 47.8006834,88.2216401 46.1738041,89.847836 C44.5485194,91.4740319 43.7353075,93.4350797 43.7353075,95.7332574 C43.7353075,98.0314351 44.5476082,99.9927107 46.1738041,101.618679 C47.8006834,103.244875 49.761959,104.05877 52.06082,104.05877 C54.3589977,104.05877 56.3202733,103.244875 57.9464692,101.618679 C59.5726651,99.9927107 60.3856492,98.0314351 60.3856492,95.7332574 C60.3856492,93.4350797 59.5726651,91.4740319 57.9464692,89.847836 C56.3202733,88.2216401 54.3589977,87.4070615 52.06082,87.4070615 Z" id="Path"></path>
|
|
16
|
-
<path d="M52.06082,0 C48.5927107,0 45.6430524,1.21343964 43.2148064,3.64145786 C40.7872437,6.06970387 39.5733485,9.01867882 39.5733485,12.4870159 C39.5733485,15.9555809 40.7867882,18.9031891 43.2148064,21.3316629 C45.6430524,23.7592255 48.5920273,24.9733485 52.06082,24.9733485 C55.5305239,24.9733485 58.4781321,23.7599089 60.905467,21.3316629 C63.3328018,18.904328 64.546697,15.9555809 64.546697,12.4870159 C64.546697,9.01890661 63.3328018,6.07061503 60.905467,3.64145786 C58.4781321,1.21412301 55.5305239,0 52.06082,0 Z" id="Path"></path>
|
|
17
|
-
</g>
|
|
18
|
-
</g>
|
|
19
|
-
</g>
|
|
20
|
-
</svg>
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { Loader } from "../../src";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Loader",
|
|
5
|
-
component: Loader,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Basic = () => <Loader>In progress...</Loader>;
|
|
9
|
-
|
|
10
|
-
export const WithImage = () => (
|
|
11
|
-
<Loader src="../../stories/assets/loader/white-loader.svg" text="In progress..." />
|
|
12
|
-
);
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { useState } from "react";
|
|
2
|
-
import { Modal } from "../../src";
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: "Modal",
|
|
6
|
-
component: Modal,
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const Basic = () => {
|
|
10
|
-
const [isOpen, setOpen] = useState<boolean>(false);
|
|
11
|
-
return (
|
|
12
|
-
<div>
|
|
13
|
-
<button onClick={() => setOpen(true)}>Click</button>
|
|
14
|
-
{isOpen && (
|
|
15
|
-
<Modal onClickedOutside={() => setOpen(false)}>
|
|
16
|
-
<h1>Bienvenue</h1>
|
|
17
|
-
</Modal>
|
|
18
|
-
)}
|
|
19
|
-
</div>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
|
2
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="44" height="44" viewBox="228 227 44 44" xml:space="preserve">
|
|
4
|
-
<desc>Created with Fabric.js 4.6.0</desc>
|
|
5
|
-
<defs>
|
|
6
|
-
</defs>
|
|
7
|
-
<g transform="matrix(-1 0 0 1 256.5 249.65)" id="owGTspzSba8jfBa7HBr0v" >
|
|
8
|
-
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
|
|
9
|
-
</g>
|
|
10
|
-
<g transform="matrix(-1 0 0 1 243.5 249.65)" id="vGdk0Ujh0hJIq-DT8PVot" >
|
|
11
|
-
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
|
|
12
|
-
</g>
|
|
13
|
-
</svg>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
|
2
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="44" height="44" viewBox="228 227 44 44" xml:space="preserve">
|
|
4
|
-
<desc>Created with Fabric.js 4.6.0</desc>
|
|
5
|
-
<defs>
|
|
6
|
-
</defs>
|
|
7
|
-
<g transform="matrix(1 0 0 1 243.5 249.65)" id="W9YXztRPzeX53cvyfGAaY" >
|
|
8
|
-
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
|
|
9
|
-
</g>
|
|
10
|
-
<g transform="matrix(1 0 0 1 256.5 249.65)" id="FLRMreggRPo2fwdIwByo4" >
|
|
11
|
-
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
|
|
12
|
-
</g>
|
|
13
|
-
</svg>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
|
2
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="30" height="43" viewBox="235 228 30 43" xml:space="preserve">
|
|
4
|
-
<desc>Created with Fabric.js 4.6.0</desc>
|
|
5
|
-
<defs>
|
|
6
|
-
</defs>
|
|
7
|
-
<g transform="matrix(-1 0 0 1 250 250)" id="pu0cgsJQk_zRNHFs5F4jS" >
|
|
8
|
-
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
|
|
9
|
-
</g>
|
|
10
|
-
</svg>
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
|
2
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="30" height="43" viewBox="235 228 30 43" xml:space="preserve">
|
|
4
|
-
<desc>Created with Fabric.js 4.6.0</desc>
|
|
5
|
-
<defs>
|
|
6
|
-
</defs>
|
|
7
|
-
<g transform="matrix(1 0 0 1 250 250)" id="5cVC0zuSDvMfcCq1Pt2kU" >
|
|
8
|
-
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
|
|
9
|
-
</g>
|
|
10
|
-
</svg>
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { usePagination, Pagination, ArrowPosition } from "../../src";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Pagination",
|
|
5
|
-
component: Pagination,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Basic = () => {
|
|
9
|
-
const pagination = usePagination({ page: 1, totalRecords: 15 });
|
|
10
|
-
return <Pagination {...pagination} />;
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const WithOnePage = () => {
|
|
14
|
-
const pagination = usePagination({ page: 1, totalRecords: 5 });
|
|
15
|
-
return <Pagination {...pagination} />;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export const WithMultiplePages = () => {
|
|
19
|
-
const pagination = usePagination({ page: 1, totalRecords: 150 });
|
|
20
|
-
return <Pagination {...pagination} />;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export const WithSingleArrow = () => {
|
|
24
|
-
const pagination = usePagination({ page: 1, totalRecords: 150 });
|
|
25
|
-
|
|
26
|
-
return (
|
|
27
|
-
<Pagination
|
|
28
|
-
{...pagination}
|
|
29
|
-
renderSingleArrow={(position: ArrowPosition) => (position === ArrowPosition.LEFT ? "<" : ">")}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export const WithMultipleArrow = () => {
|
|
35
|
-
const pagination = usePagination({ page: 1, totalRecords: 150 });
|
|
36
|
-
|
|
37
|
-
return (
|
|
38
|
-
<Pagination
|
|
39
|
-
{...pagination}
|
|
40
|
-
renderDoubleArrow={(position: ArrowPosition) =>
|
|
41
|
-
position === ArrowPosition.LEFT ? "<<" : ">>"
|
|
42
|
-
}
|
|
43
|
-
/>
|
|
44
|
-
);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export const WithSingleAndMultipleArrows = () => {
|
|
48
|
-
const pagination = usePagination({ page: 1, totalRecords: 150 });
|
|
49
|
-
|
|
50
|
-
return (
|
|
51
|
-
<Pagination
|
|
52
|
-
{...pagination}
|
|
53
|
-
renderSingleArrow={(position: ArrowPosition) => (position === ArrowPosition.LEFT ? "<" : ">")}
|
|
54
|
-
renderDoubleArrow={(position: ArrowPosition) =>
|
|
55
|
-
position === ArrowPosition.LEFT ? "<<" : ">>"
|
|
56
|
-
}
|
|
57
|
-
/>
|
|
58
|
-
);
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const WithSingleAndMultipleArrowsImage = () => {
|
|
62
|
-
const pagination = usePagination({ page: 1, totalRecords: 150 });
|
|
63
|
-
|
|
64
|
-
return (
|
|
65
|
-
<Pagination
|
|
66
|
-
{...pagination}
|
|
67
|
-
renderSingleArrow={(position: ArrowPosition) => (
|
|
68
|
-
<img
|
|
69
|
-
style={{ minWidth: 0, minHeight: 0, width: "0.5rem" }}
|
|
70
|
-
src={
|
|
71
|
-
position === ArrowPosition.LEFT
|
|
72
|
-
? "./assets/single-left-arrow.svg"
|
|
73
|
-
: "./assets/single-right-arrow.svg"
|
|
74
|
-
}
|
|
75
|
-
/>
|
|
76
|
-
)}
|
|
77
|
-
renderDoubleArrow={(position: ArrowPosition) => (
|
|
78
|
-
<img
|
|
79
|
-
style={{ minWidth: 0, minHeight: 0, width: "0.8rem" }}
|
|
80
|
-
src={
|
|
81
|
-
position === ArrowPosition.LEFT
|
|
82
|
-
? "./assets/double-left-arrow.svg"
|
|
83
|
-
: "./assets/double-right-arrow.svg"
|
|
84
|
-
}
|
|
85
|
-
/>
|
|
86
|
-
)}
|
|
87
|
-
/>
|
|
88
|
-
);
|
|
89
|
-
};
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Select } from "../../src";
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: "Select",
|
|
5
|
-
component: Select,
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const Basic = () => {
|
|
9
|
-
return (
|
|
10
|
-
<Select
|
|
11
|
-
options={[
|
|
12
|
-
{ label: "France", value: "fr" },
|
|
13
|
-
{ label: "England", value: "en" },
|
|
14
|
-
{ label: "Italy", value: "it" },
|
|
15
|
-
{ label: "Scotland", value: "sc" },
|
|
16
|
-
]}
|
|
17
|
-
/>
|
|
18
|
-
);
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const WithSelectedOption = () => {
|
|
22
|
-
return (
|
|
23
|
-
<Select
|
|
24
|
-
selectedValue="it"
|
|
25
|
-
options={[
|
|
26
|
-
{ label: "France", value: "fr" },
|
|
27
|
-
{ label: "England", value: "en" },
|
|
28
|
-
{ label: "Italy", value: "it" },
|
|
29
|
-
{ label: "Scotland", value: "sc" },
|
|
30
|
-
]}
|
|
31
|
-
/>
|
|
32
|
-
);
|
|
33
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
|
|
2
|
-
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="44" height="44" viewBox="228 227 44 44" xml:space="preserve">
|
|
4
|
-
<desc>Created with Fabric.js 4.6.0</desc>
|
|
5
|
-
<defs>
|
|
6
|
-
</defs>
|
|
7
|
-
<g transform="matrix(-1 0 0 1 256.5 249.65)" id="owGTspzSba8jfBa7HBr0v" >
|
|
8
|
-
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
|
|
9
|
-
</g>
|
|
10
|
-
<g transform="matrix(-1 0 0 1 243.5 249.65)" id="vGdk0Ujh0hJIq-DT8PVot" >
|
|
11
|
-
<path style="stroke: none; stroke-width: 1; stroke-dasharray: none; stroke-linecap: butt; stroke-dashoffset: 0; stroke-linejoin: miter; stroke-miterlimit: 4; fill: rgb(255,255,255); fill-rule: evenodd; opacity: 1;" vector-effect="non-scaling-stroke" transform=" translate(-9, -15.65)" d="M 17.3523845 17.2019001 L 3.77482194 30.6618545 C 2.91112496 31.5185123 1.51078835 31.5185123 0.647510672 30.6618545 C -0.215836891 29.8059588 -0.215836891 28.4177782 0.647510672 27.5619518 L 12.6615574 15.6519488 L 0.647860092 3.74236142 C -0.21548747 2.8861193 -0.21548747 1.49807731 0.647860092 0.642181593 C 1.51120765 -0.214060531 2.91147438 -0.214060531 3.77517136 0.642181593 L 17.3527339 14.1023438 C 17.7844077 14.5304995 18 15.0910509 18 15.6518795 C 18 16.2129851 17.7839884 16.7739522 17.3523845 17.2019001 Z" stroke-linecap="round" />
|
|
12
|
-
</g>
|
|
13
|
-
</svg>
|