@popsure/dirty-swan 0.26.8 → 0.26.11
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/index.css +1 -0
- package/dist/index.css.map +1 -1
- package/dist/lib/scss/private/components/_buttons.scss +2 -0
- package/package.json +2 -1
- package/src/App.tsx +50 -0
- package/src/bin/index.ts +71 -0
- package/src/bin/tsconfig.json +13 -0
- package/src/bin/util/index.test.ts +85 -0
- package/src/bin/util/index.ts +132 -0
- package/src/bin/util/test/data.json +13 -0
- package/src/colors.scss +1 -0
- package/src/font-weight.scss +1 -0
- package/src/grid.scss +1 -0
- package/src/index.tsx +37 -0
- package/src/intro.stories.mdx +41 -0
- package/src/lib/components/autocompleteAddress/demo.tsx +38 -0
- package/src/lib/components/autocompleteAddress/index.stories.mdx +44 -0
- package/src/lib/components/autocompleteAddress/index.tsx +316 -0
- package/src/lib/components/autocompleteAddress/mapStyle.ts +187 -0
- package/src/lib/components/autocompleteAddress/style.module.scss +82 -0
- package/src/lib/components/autocompleteAddress/util/index.test.ts +51 -0
- package/src/lib/components/autocompleteAddress/util/index.ts +55 -0
- package/src/lib/components/button/icons/index.ts +14 -0
- package/src/lib/components/button/icons/send-purple.svg +4 -0
- package/src/lib/components/button/icons/send-white.svg +4 -0
- package/src/lib/components/button/index.stories.mdx +121 -0
- package/src/lib/components/button/index.tsx +64 -0
- package/src/lib/components/button/styles.module.scss +5 -0
- package/src/lib/components/cards/a.stories.mdx +44 -0
- package/src/lib/components/cards/cardButton/index.stories.mdx +47 -0
- package/src/lib/components/cards/cardButton/index.tsx +61 -0
- package/src/lib/components/cards/cardButton/style.module.scss +33 -0
- package/src/lib/components/cards/cardWithLeftIcon/index.stories.mdx +103 -0
- package/src/lib/components/cards/cardWithLeftIcon/index.tsx +87 -0
- package/src/lib/components/cards/cardWithLeftIcon/style.module.scss +23 -0
- package/src/lib/components/cards/cardWithTopIcon/index.stories.mdx +105 -0
- package/src/lib/components/cards/cardWithTopIcon/index.tsx +60 -0
- package/src/lib/components/cards/cardWithTopIcon/style.module.scss +10 -0
- package/src/lib/components/cards/cardWithTopLeftIcon/index.stories.mdx +101 -0
- package/src/lib/components/cards/cardWithTopLeftIcon/index.tsx +72 -0
- package/src/lib/components/cards/cardWithTopLeftIcon/style.module.scss +21 -0
- package/src/lib/components/cards/icons/arrow-right.svg +4 -0
- package/src/lib/components/cards/icons/chevron-right.svg +3 -0
- package/src/lib/components/cards/icons/feather-logo.svg +10 -0
- package/src/lib/components/cards/icons/index.ts +36 -0
- package/src/lib/components/cards/icons/info.svg +12 -0
- package/src/lib/components/cards/index.test.ts +37 -0
- package/src/lib/components/cards/index.tsx +57 -0
- package/src/lib/components/cards/infoCard/index.stories.mdx +61 -0
- package/src/lib/components/cards/infoCard/index.tsx +47 -0
- package/src/lib/components/cards/infoCard/style.module.scss +53 -0
- package/src/lib/components/chip/icons/remove-button-highlighted.svg +4 -0
- package/src/lib/components/chip/icons/remove-button.svg +4 -0
- package/src/lib/components/chip/index.stories.mdx +101 -0
- package/src/lib/components/chip/index.tsx +38 -0
- package/src/lib/components/chip/style.module.scss +54 -0
- package/src/lib/components/comparisonTable/components/Chevron.tsx +19 -0
- package/src/lib/components/comparisonTable/components/Row/index.tsx +68 -0
- package/src/lib/components/comparisonTable/components/Row/style.module.scss +114 -0
- package/src/lib/components/comparisonTable/components/TableArrows/Arrow.tsx +19 -0
- package/src/lib/components/comparisonTable/components/TableArrows/index.tsx +52 -0
- package/src/lib/components/comparisonTable/components/TableArrows/style.module.scss +53 -0
- package/src/lib/components/comparisonTable/components/TableInfoButton/index.tsx +37 -0
- package/src/lib/components/comparisonTable/components/TableInfoButton/style.module.scss +30 -0
- package/src/lib/components/comparisonTable/components/TableRating/StarIcon.tsx +13 -0
- package/src/lib/components/comparisonTable/components/TableRating/ZapIcon.tsx +17 -0
- package/src/lib/components/comparisonTable/components/TableRating/index.tsx +45 -0
- package/src/lib/components/comparisonTable/components/TableRating/style.module.scss +13 -0
- package/src/lib/components/comparisonTable/components/TableRowHeader/index.tsx +35 -0
- package/src/lib/components/comparisonTable/components/TableRowHeader/style.module.scss +3 -0
- package/src/lib/components/comparisonTable/components/TableTrueFalse.tsx +40 -0
- package/src/lib/components/comparisonTable/hooks/useActiveTableArrows.ts +63 -0
- package/src/lib/components/comparisonTable/index.stories.mdx +254 -0
- package/src/lib/components/comparisonTable/index.tsx +211 -0
- package/src/lib/components/comparisonTable/style.module.scss +104 -0
- package/src/lib/components/dateSelector/datepicker.scss +406 -0
- package/src/lib/components/dateSelector/icons/calendar.svg +6 -0
- package/src/lib/components/dateSelector/icons/chevron-left.svg +3 -0
- package/src/lib/components/dateSelector/icons/chevron-right.svg +3 -0
- package/src/lib/components/dateSelector/index.stories.mdx +62 -0
- package/src/lib/components/dateSelector/index.test.ts +33 -0
- package/src/lib/components/dateSelector/index.tsx +247 -0
- package/src/lib/components/dateSelector/style.module.scss +77 -0
- package/src/lib/components/downloadButton/icons/check.svg +3 -0
- package/src/lib/components/downloadButton/icons/download.svg +5 -0
- package/src/lib/components/downloadButton/index.stories.mdx +59 -0
- package/src/lib/components/downloadButton/index.tsx +67 -0
- package/src/lib/components/downloadButton/style.module.scss +19 -0
- package/src/lib/components/downloadRing/icons/check-outside-circle.tsx +26 -0
- package/src/lib/components/downloadRing/icons/download-cloud.tsx +18 -0
- package/src/lib/components/downloadRing/icons/style.module.scss +7 -0
- package/src/lib/components/downloadRing/index.stories.mdx +35 -0
- package/src/lib/components/downloadRing/index.tsx +79 -0
- package/src/lib/components/downloadRing/style.module.scss +66 -0
- package/src/lib/components/dropzone/images/error.tsx +18 -0
- package/src/lib/components/dropzone/images/file.tsx +26 -0
- package/src/lib/components/dropzone/images/style.module.scss +7 -0
- package/src/lib/components/dropzone/images/upload-complete.tsx +24 -0
- package/src/lib/components/dropzone/images/upload.tsx +18 -0
- package/src/lib/components/dropzone/index.stories.mdx +44 -0
- package/src/lib/components/dropzone/index.tsx +152 -0
- package/src/lib/components/dropzone/style.module.scss +90 -0
- package/src/lib/components/input/a.stories.mdx +28 -0
- package/src/lib/components/input/autoSuggestInput/index.stories.mdx +137 -0
- package/src/lib/components/input/autoSuggestInput/index.tsx +81 -0
- package/src/lib/components/input/autoSuggestInput/style.module.scss +71 -0
- package/src/lib/components/input/autoSuggestMultiSelect/index.stories.mdx +115 -0
- package/src/lib/components/input/autoSuggestMultiSelect/index.tsx +75 -0
- package/src/lib/components/input/autoSuggestMultiSelect/style.module.scss +4 -0
- package/src/lib/components/input/currency/format/index.test.ts +49 -0
- package/src/lib/components/input/currency/format/index.ts +15 -0
- package/src/lib/components/input/currency/index.stories.mdx +25 -0
- package/src/lib/components/input/currency/index.test.tsx +56 -0
- package/src/lib/components/input/currency/index.tsx +53 -0
- package/src/lib/components/input/iban/formatIban/index.test.ts +11 -0
- package/src/lib/components/input/iban/formatIban/index.ts +22 -0
- package/src/lib/components/input/iban/index.stories.mdx +21 -0
- package/src/lib/components/input/iban/index.tsx +20 -0
- package/src/lib/components/input/index.stories.mdx +62 -0
- package/src/lib/components/input/index.tsx +51 -0
- package/src/lib/components/input/style.module.scss +94 -0
- package/src/lib/components/modal/bottomModal/img/close.svg +4 -0
- package/src/lib/components/modal/bottomModal/index.tsx +68 -0
- package/src/lib/components/modal/bottomModal/style.module.scss +104 -0
- package/src/lib/components/modal/bottomOrRegularModal/index.tsx +43 -0
- package/src/lib/components/modal/bottomOrRegularModal/style.module.scss +16 -0
- package/src/lib/components/modal/hooks/useOnClose.ts +51 -0
- package/src/lib/components/modal/index.stories.mdx +316 -0
- package/src/lib/components/modal/index.ts +14 -0
- package/src/lib/components/modal/regularModal/img/close.svg +4 -0
- package/src/lib/components/modal/regularModal/index.tsx +55 -0
- package/src/lib/components/modal/regularModal/style.module.scss +106 -0
- package/src/lib/components/multiDropzone/UploadFileCell/index.tsx +138 -0
- package/src/lib/components/multiDropzone/UploadFileCell/style.module.scss +101 -0
- package/src/lib/components/multiDropzone/icons/bmp-complete.svg +10 -0
- package/src/lib/components/multiDropzone/icons/bmp.svg +10 -0
- package/src/lib/components/multiDropzone/icons/doc-complete.svg +11 -0
- package/src/lib/components/multiDropzone/icons/doc.svg +11 -0
- package/src/lib/components/multiDropzone/icons/docx-complete.svg +12 -0
- package/src/lib/components/multiDropzone/icons/docx.svg +12 -0
- package/src/lib/components/multiDropzone/icons/eye.svg +4 -0
- package/src/lib/components/multiDropzone/icons/generic-complete.svg +4 -0
- package/src/lib/components/multiDropzone/icons/generic-error.svg +7 -0
- package/src/lib/components/multiDropzone/icons/generic.svg +4 -0
- package/src/lib/components/multiDropzone/icons/heic-complete.svg +11 -0
- package/src/lib/components/multiDropzone/icons/heic.svg +11 -0
- package/src/lib/components/multiDropzone/icons/index.ts +51 -0
- package/src/lib/components/multiDropzone/icons/jpeg-complete.svg +11 -0
- package/src/lib/components/multiDropzone/icons/jpeg.svg +11 -0
- package/src/lib/components/multiDropzone/icons/jpg-complete.svg +10 -0
- package/src/lib/components/multiDropzone/icons/jpg.svg +10 -0
- package/src/lib/components/multiDropzone/icons/pdf-complete.svg +8 -0
- package/src/lib/components/multiDropzone/icons/pdf.svg +8 -0
- package/src/lib/components/multiDropzone/icons/png-complete.svg +10 -0
- package/src/lib/components/multiDropzone/icons/png.svg +10 -0
- package/src/lib/components/multiDropzone/icons/trash.svg +6 -0
- package/src/lib/components/multiDropzone/icons/upload.svg +5 -0
- package/src/lib/components/multiDropzone/index.stories.mdx +91 -0
- package/src/lib/components/multiDropzone/index.tsx +99 -0
- package/src/lib/components/multiDropzone/style.module.scss +32 -0
- package/src/lib/components/segmentedControl/index.stories.mdx +47 -0
- package/src/lib/components/segmentedControl/index.tsx +105 -0
- package/src/lib/components/segmentedControl/style.module.scss +36 -0
- package/src/lib/components/signaturePad/img/reset.svg +4 -0
- package/src/lib/components/signaturePad/img/sign.svg +3 -0
- package/src/lib/components/signaturePad/index.stories.mdx +17 -0
- package/src/lib/components/signaturePad/index.tsx +96 -0
- package/src/lib/components/signaturePad/style.module.scss +90 -0
- package/src/lib/index.tsx +71 -0
- package/src/lib/models/autoSuggestInput/index.ts +4 -0
- package/src/lib/models/download.ts +1 -0
- package/src/lib/models/downloadRing/index.ts +6 -0
- package/src/lib/scss/index.scss +22 -0
- package/src/lib/scss/private/_reset.scss +149 -0
- package/src/lib/scss/private/base/_colors.scss +19 -0
- package/src/lib/scss/private/base/_cursors.scss +31 -0
- package/src/lib/scss/private/base/_display.scss +35 -0
- package/src/lib/scss/private/base/_grid.scss +52 -0
- package/src/lib/scss/private/base/_index.scss +9 -0
- package/src/lib/scss/private/base/_shadows.scss +2 -0
- package/src/lib/scss/private/base/_spacing.scss +89 -0
- package/src/lib/scss/private/base/_typography.scss +128 -0
- package/src/lib/scss/private/base/_width_and_height.scss +25 -0
- package/src/lib/scss/private/base/cursors.stories.mdx +18 -0
- package/src/lib/scss/private/base/demo.tsx +119 -0
- package/src/lib/scss/private/base/display.stories.mdx +19 -0
- package/src/lib/scss/private/base/flex/_flex.scss +63 -0
- package/src/lib/scss/private/base/flex/flex.stories.mdx +139 -0
- package/src/lib/scss/private/base/flex/style.module.scss +24 -0
- package/src/lib/scss/private/base/spacing.stories.mdx +173 -0
- package/src/lib/scss/private/base/style.module.scss +42 -0
- package/src/lib/scss/private/base/typography.stories.mdx +71 -0
- package/src/lib/scss/private/base/width_and_height.stories.mdx +172 -0
- package/src/lib/scss/private/components/_badge.scss +41 -0
- package/src/lib/scss/private/components/_buttons.scss +193 -0
- package/src/lib/scss/private/components/_cards.scss +32 -0
- package/src/lib/scss/private/components/_index.scss +6 -0
- package/src/lib/scss/private/components/_input.scss +241 -0
- package/src/lib/scss/private/components/_notices.scss +39 -0
- package/src/lib/scss/private/components/_spinner.scss +60 -0
- package/src/lib/scss/private/components/assets/checkmark.svg +3 -0
- package/src/lib/scss/private/components/assets/icon-form-dropdown.svg +3 -0
- package/src/lib/scss/private/components/badge.stories.mdx +37 -0
- package/src/lib/scss/private/components/button.stories.mdx +107 -0
- package/src/lib/scss/private/components/cards.stories.mdx +35 -0
- package/src/lib/scss/private/components/checkbox.stories.mdx +47 -0
- package/src/lib/scss/private/components/input.stories.mdx +33 -0
- package/src/lib/scss/private/components/notices.stories.mdx +37 -0
- package/src/lib/scss/private/components/radio.stories.mdx +47 -0
- package/src/lib/scss/private/components/select.stories.mdx +17 -0
- package/src/lib/scss/private/components/spinner.stories.mdx +25 -0
- package/src/lib/scss/public/colors/_index.scss +2 -0
- package/src/lib/scss/public/colors/default.scss +125 -0
- package/src/lib/scss/public/colors/overrides.scss +0 -0
- package/src/lib/scss/public/colors.stories.mdx +27 -0
- package/src/lib/scss/public/demo.tsx +285 -0
- package/src/lib/scss/public/font/_index.scss +2 -0
- package/src/lib/scss/public/font/default.scss +3 -0
- package/src/lib/scss/public/font/overrides.scss +0 -0
- package/src/lib/scss/public/font-weight.scss +9 -0
- package/src/lib/scss/public/font-weight.stories.mdx +32 -0
- package/src/lib/scss/public/grid.scss +21 -0
- package/src/lib/scss/public/grid.stories.mdx +41 -0
- package/src/lib/scss/third-party/_google_places.scss +62 -0
- package/src/lib/scss/third-party/_index.scss +1 -0
- package/src/lib/scss/utils/_index.scss +3 -0
- package/src/lib/util/calendarDate/index.test.ts +32 -0
- package/src/lib/util/calendarDate/index.ts +30 -0
- package/src/lib/util/zeroFill.test.ts +15 -0
- package/src/lib/util/zeroFill.ts +7 -0
- package/src/react-app-env.d.ts +1 -0
- package/src/setupTests.js +8 -0
- package/src/theme.stories.mdx +54 -0
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
const colors = [
|
|
4
|
+
{
|
|
5
|
+
name: 'Primary 25',
|
|
6
|
+
code: 'primary-25',
|
|
7
|
+
hex: '#fcfcff',
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: 'Primary 50',
|
|
11
|
+
code: 'primary-50',
|
|
12
|
+
hex: '#f7f7ff',
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
name: 'Primary 100',
|
|
16
|
+
code: 'primary-100',
|
|
17
|
+
hex: '#e6e5ff',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
name: 'Primary 300',
|
|
21
|
+
code: 'primary-300',
|
|
22
|
+
hex: '#b1b0f5',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Primary 500',
|
|
26
|
+
code: 'primary-500',
|
|
27
|
+
hex: '#8e8cee',
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'Primary 700',
|
|
31
|
+
code: 'primary-700',
|
|
32
|
+
hex: '#6160a2',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: 'Primary 900',
|
|
36
|
+
code: 'primary-900',
|
|
37
|
+
hex: '#2e2e4c',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'Blue 100',
|
|
41
|
+
code: 'blue-100',
|
|
42
|
+
hex: '#e5f0ff',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Blue 300',
|
|
46
|
+
code: 'blue-300',
|
|
47
|
+
hex: '#b0cdf3',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
name: 'Blue 500',
|
|
51
|
+
code: 'blue-500',
|
|
52
|
+
hex: '#8bb4ea',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: 'Blue 700',
|
|
56
|
+
code: 'blue-700',
|
|
57
|
+
hex: '#5f7ba0',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'Blue 900',
|
|
61
|
+
code: 'blue-900',
|
|
62
|
+
hex: '#2d394a',
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: 'Glacier 100',
|
|
66
|
+
code: 'glacier-100',
|
|
67
|
+
hex: '#e0f7fe',
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Glacier 300',
|
|
71
|
+
code: 'glacier-300',
|
|
72
|
+
hex: '#aeddec',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'Glacier 500',
|
|
76
|
+
code: 'glacier-500',
|
|
77
|
+
hex: '#8bcbdf',
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'Glacier 700',
|
|
81
|
+
code: 'glacier-700',
|
|
82
|
+
hex: '#5d8896',
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
name: 'Glacier 900',
|
|
86
|
+
code: 'glacier-900',
|
|
87
|
+
hex: '#2d4148',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'Red 100',
|
|
91
|
+
code: 'red-100',
|
|
92
|
+
hex: '#fedede',
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
name: 'Red 300',
|
|
96
|
+
code: 'red-300',
|
|
97
|
+
hex: '#faa0a0',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
name: 'Red 500',
|
|
101
|
+
code: 'red-500',
|
|
102
|
+
hex: '#e55454',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'Red 700',
|
|
106
|
+
code: 'red-700',
|
|
107
|
+
hex: '#c64848',
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
name: 'Red 900',
|
|
111
|
+
code: 'red-900',
|
|
112
|
+
hex: '#4b2525',
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: 'Pink 100',
|
|
116
|
+
code: 'pink-100',
|
|
117
|
+
hex: '#ffebf1',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: 'Pink 300',
|
|
121
|
+
code: 'pink-300',
|
|
122
|
+
hex: '#ffb1cb',
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
name: 'Pink 500',
|
|
126
|
+
code: 'pink-500',
|
|
127
|
+
hex: '#f96092',
|
|
128
|
+
},
|
|
129
|
+
{
|
|
130
|
+
name: 'Pink 700',
|
|
131
|
+
code: 'pink-700',
|
|
132
|
+
hex: '#c0305f',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'Pink 900',
|
|
136
|
+
code: 'pink-900',
|
|
137
|
+
hex: '#700024',
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
name: 'Grey 100',
|
|
141
|
+
code: 'grey-100',
|
|
142
|
+
hex: '#fafaff',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
name: 'Grey 200',
|
|
146
|
+
code: 'grey-200',
|
|
147
|
+
hex: '#f5f5fa',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'Grey 300',
|
|
151
|
+
code: 'grey-300',
|
|
152
|
+
hex: '#d2d2d8',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
name: 'Grey 500',
|
|
156
|
+
code: 'grey-500',
|
|
157
|
+
hex: '#b4b4ba',
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: 'Grey 600',
|
|
161
|
+
code: 'grey-600',
|
|
162
|
+
hex: '#696970',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: 'Grey 700',
|
|
166
|
+
code: 'grey-700',
|
|
167
|
+
hex: '#4c4c53',
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'Grey 900',
|
|
171
|
+
code: 'grey-900',
|
|
172
|
+
hex: '#26262e',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
name: 'Green 100',
|
|
176
|
+
code: 'green-100',
|
|
177
|
+
hex: '#e4ffe6',
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
name: 'Green 300',
|
|
181
|
+
code: 'green-300',
|
|
182
|
+
hex: '#c4f5c8',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: 'Green 500',
|
|
186
|
+
code: 'green-500',
|
|
187
|
+
hex: '#84de8a',
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
name: 'Green 700',
|
|
191
|
+
code: 'green-700',
|
|
192
|
+
hex: '#5b985f',
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
name: 'Green 900',
|
|
196
|
+
code: 'green-900',
|
|
197
|
+
hex: '#354a2d',
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
name: 'Spearmint 100',
|
|
201
|
+
code: 'spearmint-100',
|
|
202
|
+
hex: '#e3fff2',
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
name: 'Spearmint 300',
|
|
206
|
+
code: 'spearmint-300',
|
|
207
|
+
hex: '#aaeacc',
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: 'Spearmint 500',
|
|
211
|
+
code: 'spearmint-500',
|
|
212
|
+
hex: '#85dcb4',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
name: 'Spearmint 700',
|
|
216
|
+
code: 'spearmint-700',
|
|
217
|
+
hex: '#599278',
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
name: 'Spearmint 900',
|
|
221
|
+
code: 'spearmint-900',
|
|
222
|
+
hex: '#2b4639',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
name: 'Yellow 100',
|
|
226
|
+
code: 'yellow-100',
|
|
227
|
+
hex: '#fff8e3',
|
|
228
|
+
},
|
|
229
|
+
{
|
|
230
|
+
name: 'Yellow 300',
|
|
231
|
+
code: 'yellow-300',
|
|
232
|
+
hex: '#fae3a5',
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
name: 'Yellow 500',
|
|
236
|
+
code: 'yellow-500',
|
|
237
|
+
hex: '#f7ce5c',
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: 'Yellow 700',
|
|
241
|
+
code: 'yellow-700',
|
|
242
|
+
hex: '#cc9e21',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
name: 'Yellow 900',
|
|
246
|
+
code: 'yellow-900',
|
|
247
|
+
hex: '#4a3d10',
|
|
248
|
+
},
|
|
249
|
+
];
|
|
250
|
+
|
|
251
|
+
export const Colors = () => (
|
|
252
|
+
<table style={{ width: '100%' }}>
|
|
253
|
+
<tr
|
|
254
|
+
style={{
|
|
255
|
+
height: '40px',
|
|
256
|
+
lineHeight: '40px',
|
|
257
|
+
textAlign: 'left',
|
|
258
|
+
}}
|
|
259
|
+
>
|
|
260
|
+
<th style={{ fontWeight: 'bold' }}>Color</th>
|
|
261
|
+
<th style={{ fontWeight: 'bold' }}>Name</th>
|
|
262
|
+
<th style={{ fontWeight: 'bold' }}>Sass</th>
|
|
263
|
+
<th style={{ fontWeight: 'bold' }}>Text class</th>
|
|
264
|
+
<th style={{ fontWeight: 'bold' }}>Hex</th>
|
|
265
|
+
</tr>
|
|
266
|
+
{colors.map((color) => (
|
|
267
|
+
<tr style={{ height: '40px', lineHeight: '40px' }}>
|
|
268
|
+
<td>
|
|
269
|
+
<div
|
|
270
|
+
style={{
|
|
271
|
+
width: '24px',
|
|
272
|
+
height: '24px',
|
|
273
|
+
borderRadius: '4px',
|
|
274
|
+
backgroundColor: color.hex,
|
|
275
|
+
}}
|
|
276
|
+
/>
|
|
277
|
+
</td>
|
|
278
|
+
<td>{color.name}</td>
|
|
279
|
+
<td>{`$ds-${color.code}`}</td>
|
|
280
|
+
<td>{`tc-${color.code}`}</td>
|
|
281
|
+
<td>{color.hex}</td>
|
|
282
|
+
</tr>
|
|
283
|
+
))}
|
|
284
|
+
</table>
|
|
285
|
+
);
|
|
File without changes
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<Meta title="CSS/Variables/Font weight" />
|
|
2
|
+
|
|
3
|
+
# Font weight
|
|
4
|
+
|
|
5
|
+
For enhanced reusability we’re providing you with a set of font weight. Please don't hardcode any font weight value and use this instead.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
### Class name
|
|
10
|
+
|
|
11
|
+
| Class | Output |
|
|
12
|
+
| ------------ | ------------------ |
|
|
13
|
+
| `.fw-normal` | `font-weight: 400` |
|
|
14
|
+
| `.fw-bold` | `font-weight: 700` |
|
|
15
|
+
|
|
16
|
+
### Import in code
|
|
17
|
+
|
|
18
|
+
```sass
|
|
19
|
+
// demo.scss
|
|
20
|
+
@import '@popsure/dirty-swan/dist/font-weight';
|
|
21
|
+
|
|
22
|
+
.element {
|
|
23
|
+
font-weight: $p-font-weight-bold;
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Table
|
|
28
|
+
|
|
29
|
+
| Variable | Value | Name |
|
|
30
|
+
| ----------------------- | ----- | ------ |
|
|
31
|
+
| `$p-font-weight-normal` | 400 | normal |
|
|
32
|
+
| `$p-font-weight-bold` | 700 | bold |
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
$p-desktop-breakpoint: 64rem;
|
|
2
|
+
$p-tablet-breakpoint: 45rem;
|
|
3
|
+
$p-mobile-breakpoint: 34rem;
|
|
4
|
+
|
|
5
|
+
@mixin p-size-mobile {
|
|
6
|
+
@media (max-width: $p-mobile-breakpoint) {
|
|
7
|
+
@content;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
@mixin p-size-tablet {
|
|
12
|
+
@media (min-width: $p-mobile-breakpoint) {
|
|
13
|
+
@content;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
@mixin p-size-desktop {
|
|
18
|
+
@media (min-width: $p-desktop-breakpoint) {
|
|
19
|
+
@content;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<Meta title="CSS/Variables/Sizes" />
|
|
2
|
+
|
|
3
|
+
# Sizes
|
|
4
|
+
|
|
5
|
+
Dirty swan provide you with a set of sizes and utilities for building responsive layout.
|
|
6
|
+
|
|
7
|
+
## Variable & value
|
|
8
|
+
|
|
9
|
+
| Variable | Value |
|
|
10
|
+
| ----------------------- | ----- |
|
|
11
|
+
| `$p-desktop-breakpoint` | 64rem |
|
|
12
|
+
| `$p-tablet-breakpoint` | 45rem |
|
|
13
|
+
| `$p-mobile-breakpoint` | 34rem |
|
|
14
|
+
|
|
15
|
+
## Helper
|
|
16
|
+
|
|
17
|
+
You can use the following helper within your sass code.
|
|
18
|
+
`p-size-mobile`, `p-size-tablet` and `p-size-desktop`
|
|
19
|
+
|
|
20
|
+
| Help | Range |
|
|
21
|
+
| ---------------- | ------- |
|
|
22
|
+
| `p-size-mobile` | < 34rem |
|
|
23
|
+
| `p-size-tablet` | > 34rem |
|
|
24
|
+
| `p-size-desktop` | > 64rem |
|
|
25
|
+
|
|
26
|
+
### Example
|
|
27
|
+
|
|
28
|
+
```sass
|
|
29
|
+
// demo.scss
|
|
30
|
+
@import '@popsure/dirty-swan/dist/grid';
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
.reponsive-element {
|
|
34
|
+
height: 80px;
|
|
35
|
+
|
|
36
|
+
@include p-size-mobile {
|
|
37
|
+
// If the screen width is < 34rm, the following gets applied
|
|
38
|
+
height: 40px;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
```
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
@use "../../scss/public/font-weight.scss" as *;
|
|
2
|
+
|
|
3
|
+
.pac-item {
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
height: 48px;
|
|
7
|
+
cursor: pointer;
|
|
8
|
+
|
|
9
|
+
border-top: none;
|
|
10
|
+
|
|
11
|
+
font-family: Lato, sans-serif;
|
|
12
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
background-color: var(--ds-grey-200);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pac-item-selected {
|
|
19
|
+
background-color: var(--ds-primary-100);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.pac-item {
|
|
23
|
+
padding-left: 16px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.pac-matched,
|
|
27
|
+
.pac-item-query,
|
|
28
|
+
.pac-item {
|
|
29
|
+
font-size: 16px;
|
|
30
|
+
// font-weight: $p-font-weight-normal;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.pac-icon {
|
|
34
|
+
display: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@keyframes appear-in {
|
|
38
|
+
from {
|
|
39
|
+
opacity: 0;
|
|
40
|
+
transform: translateY(10px);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
to {
|
|
44
|
+
opacity: 1;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pac-container {
|
|
49
|
+
background-color: white;
|
|
50
|
+
border: 1px solid var(--ds-grey-300);
|
|
51
|
+
box-shadow: none;
|
|
52
|
+
border-radius: 8px;
|
|
53
|
+
margin-top: 8px;
|
|
54
|
+
animation-name: appear-in;
|
|
55
|
+
animation-duration: 0.3s;
|
|
56
|
+
animation-fill-mode: both;
|
|
57
|
+
|
|
58
|
+
&::after {
|
|
59
|
+
content: ('');
|
|
60
|
+
display: none;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'google_places';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CalendarDate } from '@popsure/public-models';
|
|
2
|
+
import { calendarDateToISODate, isoStringtoCalendarDate } from '.';
|
|
3
|
+
|
|
4
|
+
describe('Calendar date to ISO date', () => {
|
|
5
|
+
it('Should add trailing 0s', () => {
|
|
6
|
+
const expectedOutput = '2019-04-09';
|
|
7
|
+
const input: CalendarDate = { day: 9, month: 4, year: 2019 };
|
|
8
|
+
|
|
9
|
+
expect(calendarDateToISODate(input)).toEqual(expectedOutput);
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('Should format date correctly', () => {
|
|
13
|
+
const expectedOutput = '2019-10-29';
|
|
14
|
+
const input: CalendarDate = { day: 29, month: 10, year: 2019 };
|
|
15
|
+
|
|
16
|
+
expect(calendarDateToISODate(input)).toEqual(expectedOutput);
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
describe('ISO string to Calendar date', () => {
|
|
21
|
+
it('Should convert valid ISO 8601 string to CalendarDate', () => {
|
|
22
|
+
expect(isoStringtoCalendarDate('1990-03-24')).toEqual({
|
|
23
|
+
year: 1990,
|
|
24
|
+
month: 3,
|
|
25
|
+
day: 24,
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test('Converting invalid ISO 8601 string to CalendarDate should be undefined', () => {
|
|
30
|
+
expect(isoStringtoCalendarDate('1990-24-03')).toBeUndefined();
|
|
31
|
+
});
|
|
32
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import customParseFormat from 'dayjs/plugin/customParseFormat';
|
|
3
|
+
import { CalendarDate } from '@popsure/public-models';
|
|
4
|
+
|
|
5
|
+
import { zerofill } from '../../util/zeroFill';
|
|
6
|
+
|
|
7
|
+
dayjs.extend(customParseFormat);
|
|
8
|
+
|
|
9
|
+
export function calendarDateToISODate(calendarDate: CalendarDate) {
|
|
10
|
+
return `${calendarDate.year}-${zerofill(calendarDate.month)}-${zerofill(
|
|
11
|
+
calendarDate.day
|
|
12
|
+
)}`;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export function isoStringtoCalendarDate(
|
|
16
|
+
input: string
|
|
17
|
+
): CalendarDate | undefined {
|
|
18
|
+
const date = dayjs(input, 'YYYY-MM-DD');
|
|
19
|
+
const dateValidity = dayjs(input, 'YYYY-MM-DD', true).isValid();
|
|
20
|
+
|
|
21
|
+
if (dateValidity === false) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const year = date.year();
|
|
26
|
+
const month = date.get('month');
|
|
27
|
+
const day = date.date();
|
|
28
|
+
|
|
29
|
+
return { year, month: month + 1, day };
|
|
30
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { zerofill } from './zeroFill';
|
|
2
|
+
|
|
3
|
+
describe('Zero fill number', () => {
|
|
4
|
+
it('Should add one zero in front of a number', () => {
|
|
5
|
+
expect(zerofill(1)).toEqual('01');
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
it('Shouldn’t add any in front of a number', () => {
|
|
9
|
+
expect(zerofill(10)).toEqual('10');
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
it('Fill 3 0s for a 4 sized number', () => {
|
|
13
|
+
expect(zerofill(1, 4)).toEqual('0001');
|
|
14
|
+
});
|
|
15
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="react-scripts" />
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<Meta title="Theme" />
|
|
2
|
+
|
|
3
|
+
# Theme configuration
|
|
4
|
+
|
|
5
|
+
Customizing the default theme for your project.
|
|
6
|
+
|
|
7
|
+

|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Dirty Swan ship with a way to configure colors, fonts… so that you can tweak it according to your needs.
|
|
12
|
+
You can use the CLI in order to customize dirty swan theme. To get strated simply run `yarn dirty-swan init` and you'll get a default configuration file.
|
|
13
|
+
|
|
14
|
+
```shell
|
|
15
|
+
$> yarn dirty-swan init
|
|
16
|
+
🦢 Creating configuration file at: ./dirty-swan.config.json
|
|
17
|
+
🦢 Successfully created configuration file at: ./dirty-swan.config.json
|
|
18
|
+
✨ Done in 0.48s.
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The configuration file look like so:
|
|
22
|
+
|
|
23
|
+
```json
|
|
24
|
+
{
|
|
25
|
+
"theme": {
|
|
26
|
+
"colors": {
|
|
27
|
+
"primary": {
|
|
28
|
+
"100": "",
|
|
29
|
+
"300": "",
|
|
30
|
+
"500": "",
|
|
31
|
+
"700": "",
|
|
32
|
+
"900": ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
"font": {
|
|
36
|
+
"sans": {
|
|
37
|
+
"family": [],
|
|
38
|
+
"url": ""
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
if you want to apply that theme you'll need to run `yarn dirty-swan theme [path to your configuration file]`.
|
|
46
|
+
|
|
47
|
+
```shell
|
|
48
|
+
$> yarn dirty-swan theme ./dirty-swan.config.json
|
|
49
|
+
🦢 Reading configuration file theme/hallesche.json
|
|
50
|
+
🦢 Successfully updated with new theme 💫
|
|
51
|
+
✨ Done in 0.74s.
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Et voilà! You can now run your project as usual and dirty swan should have updated its style.
|