@terraware/web-components 3.5.12-rc.7 → 3.5.12
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/components/AntSwitch/index.js +27 -0
- package/components/AntSwitch/styles.scss +66 -0
- package/components/Autocomplete/Autocomplete.js +131 -0
- package/components/Autocomplete/styles.scss +155 -0
- package/components/Badge/index.js +32 -0
- package/components/BusySpinner/index.js +49 -0
- package/components/Button/Button.js +51 -0
- package/components/Button/button.test.js +25 -0
- package/components/Button/styles.scss +453 -0
- package/components/Checkbox.js +70 -0
- package/components/Confirm/index.js +94 -0
- package/components/DatePicker/DatePicker.js +150 -0
- package/components/DatePicker/styles.scss +95 -0
- package/components/DialogBox/DialogBox.js +91 -0
- package/components/DialogBox/styles.scss +165 -0
- package/components/Divisor.js +21 -0
- package/components/Dropdown.js +102 -0
- package/components/ErrorBox/ErrorBox.js +47 -0
- package/components/ErrorBox/styles.scss +63 -0
- package/components/FileChooser/index.js +137 -0
- package/components/FormBottomBar/index.js +90 -0
- package/components/Icon/Icon.js +25 -0
- package/components/Icon/icons/index.js +241 -0
- package/components/Icon/styles.scss +41 -0
- package/components/IconTooltip/index.js +61 -0
- package/components/Map/MapBox.d.ts.map +1 -1
- package/components/Map/MapBox.js +479 -0
- package/components/Map/MapContainer.js +30 -0
- package/components/Map/MapDateSliderControl.js +66 -0
- package/components/Map/MapDrawer.js +45 -0
- package/components/Map/MapLegend.js +172 -0
- package/components/Map/MapViewStyleControl.js +74 -0
- package/components/Map/ReactMapboxWrapper.d.ts +3 -0
- package/components/Map/ReactMapboxWrapper.d.ts.map +1 -0
- package/components/Map/ReactMapboxWrapper.js +9 -0
- package/components/Map/index.js +190 -0
- package/components/Map/styles.scss +130 -0
- package/components/Map/types.js +24 -0
- package/components/Map/useMaintainLayerOrder.js +32 -0
- package/components/Message/Message.js +67 -0
- package/components/Message/styles.scss +202 -0
- package/components/MultiSelect/MultiSelect.test.js +75 -0
- package/components/MultiSelect/index.js +120 -0
- package/components/MultiSelect/styles.scss +180 -0
- package/components/Navbar/NavFooter.js +17 -0
- package/components/Navbar/NavItem.js +73 -0
- package/components/Navbar/NavSection.js +22 -0
- package/components/Navbar/Navbar.js +46 -0
- package/components/Navbar/SubNavbar.js +17 -0
- package/components/Navbar/styles.scss +155 -0
- package/components/Note.js +25 -0
- package/components/PageForm/index.js +43 -0
- package/components/PhotoChooser/index.js +137 -0
- package/components/Pill/index.js +46 -0
- package/components/Pill/styles.scss +50 -0
- package/components/PillList/index.js +29 -0
- package/components/PillList/styles.scss +12 -0
- package/components/PlacementWrapper/index.js +63 -0
- package/components/PopoverMenu/Popover.js +88 -0
- package/components/PopoverMenu/index.js +59 -0
- package/components/PopoverMultiSelect/index.js +62 -0
- package/components/PopoverMultiSelect/styles.scss +10 -0
- package/components/ProgressCircle/ProgressCircle.js +34 -0
- package/components/ProgressCircle/styles.scss +87 -0
- package/components/RadioButton.js +25 -0
- package/components/Select/Select.js +19 -0
- package/components/Select/SelectT.js +245 -0
- package/components/Select/styles.scss +307 -0
- package/components/Separator/index.js +21 -0
- package/components/Size.js +5 -0
- package/components/Slider/index.js +60 -0
- package/components/SummaryBox.js +73 -0
- package/components/Tabs/index.js +111 -0
- package/components/TextTruncated/index.js +146 -0
- package/components/Textfield/Textfield.js +172 -0
- package/components/Textfield/TruncatedTextArea.js +71 -0
- package/components/Textfield/styles.scss +271 -0
- package/components/Tooltip/Tooltip.js +54 -0
- package/components/ViewPhotosDialog/index.js +136 -0
- package/components/ViewPhotosDialog/styles.scss +18 -0
- package/components/svg/BlobbyGrayIconImage.js +39 -0
- package/components/svg/BlobbyGrayIconImport.js +39 -0
- package/components/svg/BlobbyGrayIconUploadToTheCloud.js +39 -0
- package/components/svg/BlobbyIconCloudChecked.js +156 -0
- package/components/svg/BlobbyIconExportOrUploadPhoto.js +156 -0
- package/components/svg/BlobbyIconFolder.js +156 -0
- package/components/svg/BlobbyIconGraphReport.js +156 -0
- package/components/svg/BlobbyIconHappy.js +156 -0
- package/components/svg/BlobbyIconHeartMonitor.js +156 -0
- package/components/svg/BlobbyIconLeaf.js +156 -0
- package/components/svg/BlobbyIconLibrary.js +156 -0
- package/components/svg/BlobbyIconNursery.js +158 -0
- package/components/svg/BlobbyIconOrganization.js +156 -0
- package/components/svg/BlobbyIconParchment.js +156 -0
- package/components/svg/BlobbyIconPeople.js +156 -0
- package/components/svg/BlobbyIconSeedBank.js +156 -0
- package/components/svg/BlobbyIconSeedling.js +156 -0
- package/components/svg/BlobbyIconSeeds.js +156 -0
- package/components/svg/BlobbyIconSite.js +159 -0
- package/components/svg/BlobbyIconSparkles.js +156 -0
- package/components/svg/BlobbyIconWrench.js +156 -0
- package/components/svg/Bug.js +25 -0
- package/components/svg/Calendar.js +25 -0
- package/components/svg/CaretDown.js +25 -0
- package/components/svg/CaretLeft.js +25 -0
- package/components/svg/CaretRight.js +25 -0
- package/components/svg/CaretUp.js +25 -0
- package/components/svg/ChevronDown.js +25 -0
- package/components/svg/ChevronUp.js +25 -0
- package/components/svg/Close.js +25 -0
- package/components/svg/Critical.js +25 -0
- package/components/svg/Edit.js +156 -0
- package/components/svg/Error.js +25 -0
- package/components/svg/Filter.js +25 -0
- package/components/svg/Folder.js +25 -0
- package/components/svg/Help.js +25 -0
- package/components/svg/Home.js +25 -0
- package/components/svg/IconAdd.js +25 -0
- package/components/svg/IconArrowRight.js +27 -0
- package/components/svg/IconBusinessNetwork.js +25 -0
- package/components/svg/IconCancel.js +25 -0
- package/components/svg/IconChargingBattery.js +25 -0
- package/components/svg/IconCheckmark.js +25 -0
- package/components/svg/IconCoinInHand.js +25 -0
- package/components/svg/IconColumns.js +25 -0
- package/components/svg/IconComment.js +26 -0
- package/components/svg/IconDashboard.js +25 -0
- package/components/svg/IconDataMigration.js +25 -0
- package/components/svg/IconEdit.js +27 -0
- package/components/svg/IconExport.js +25 -0
- package/components/svg/IconExternalLink.js +25 -0
- package/components/svg/IconEye.js +25 -0
- package/components/svg/IconEyeOff.js +25 -0
- package/components/svg/IconFile.js +25 -0
- package/components/svg/IconFolder.js +25 -0
- package/components/svg/IconFullScreen.js +26 -0
- package/components/svg/IconFutures.js +25 -0
- package/components/svg/IconGraphReport.js +25 -0
- package/components/svg/IconHeartMonitor.js +25 -0
- package/components/svg/IconHelp.js +27 -0
- package/components/svg/IconHistory.js +25 -0
- package/components/svg/IconImport.js +25 -0
- package/components/svg/IconIndex.js +25 -0
- package/components/svg/IconLayers.js +25 -0
- package/components/svg/IconLibrary.js +26 -0
- package/components/svg/IconList.js +25 -0
- package/components/svg/IconLivePlant.js +25 -0
- package/components/svg/IconLocations.js +25 -0
- package/components/svg/IconMail.js +25 -0
- package/components/svg/IconManager.js +25 -0
- package/components/svg/IconMarker.js +25 -0
- package/components/svg/IconMenu.js +25 -0
- package/components/svg/IconMenuHorizontal.js +25 -0
- package/components/svg/IconModule.js +25 -0
- package/components/svg/IconMyLocation.js +25 -0
- package/components/svg/IconNote.js +27 -0
- package/components/svg/IconNursery.js +27 -0
- package/components/svg/IconOrg.js +25 -0
- package/components/svg/IconParchment.js +25 -0
- package/components/svg/IconPhoto.js +25 -0
- package/components/svg/IconRedo.js +25 -0
- package/components/svg/IconRestorationSite.js +25 -0
- package/components/svg/IconSeedBank.js +25 -0
- package/components/svg/IconSeedling.js +25 -0
- package/components/svg/IconSettings.js +25 -0
- package/components/svg/IconSlice.js +25 -0
- package/components/svg/IconSubmit.js +25 -0
- package/components/svg/IconSubtract.js +27 -0
- package/components/svg/IconSynced.js +25 -0
- package/components/svg/IconTrashCan.js +25 -0
- package/components/svg/IconTreasureMap.js +25 -0
- package/components/svg/IconUndo.js +25 -0
- package/components/svg/IconVariable.js +25 -0
- package/components/svg/IconWifi.js +25 -0
- package/components/svg/Info.js +25 -0
- package/components/svg/Key.js +25 -0
- package/components/svg/Leaf.js +25 -0
- package/components/svg/Lock.js +25 -0
- package/components/svg/Logo.js +43 -0
- package/components/svg/MenuVertical.js +25 -0
- package/components/svg/Notification.js +25 -0
- package/components/svg/Person.js +25 -0
- package/components/svg/Plus.js +25 -0
- package/components/svg/RestorationSite.js +25 -0
- package/components/svg/Search.js +25 -0
- package/components/svg/Seeds.js +25 -0
- package/components/svg/Site.js +25 -0
- package/components/svg/Sparkles.js +25 -0
- package/components/svg/Species.js +25 -0
- package/components/svg/Species2.js +156 -0
- package/components/svg/Spinner.js +52 -0
- package/components/svg/Success.js +25 -0
- package/components/svg/SuccessFilled.js +25 -0
- package/components/svg/TerrawareLogoDesktop.js +49 -0
- package/components/svg/TerrawareLogoMobile.js +30 -0
- package/components/svg/Touchscreen.js +25 -0
- package/components/svg/UploadCloud.js +156 -0
- package/components/svg/Warning.js +25 -0
- package/components/svg/WelcomeClipboard.js +133 -0
- package/components/svg/index.js +832 -0
- package/components/table/EnhancedTableToolbar.js +76 -0
- package/components/table/EnhancedTableToolbarV2.js +49 -0
- package/components/table/TableCellRenderer.js +244 -0
- package/components/table/TableHeader.js +75 -0
- package/components/table/TableHeaderItem.js +100 -0
- package/components/table/density.js +28 -0
- package/components/table/index.js +346 -0
- package/components/table/sort.js +72 -0
- package/components/table/sort.test.js +37 -0
- package/components/table/types.js +5 -0
- package/components/types/index.js +5 -0
- package/fonts/Inter.ttf +0 -0
- package/index.css +11 -0
- package/index.js +377 -0
- package/package.json +2 -5
- package/setupTests.js +5 -0
- package/style-dictionary-dist/TerrawareTheme.js +193 -0
- package/style-dictionary-dist/terraware.scss +414 -0
- package/theme.js +86 -0
- package/utils/date.js +124 -0
- package/utils/date.test.js +87 -0
- package/utils/index.js +53 -0
- package/utils/preventDefaultEvent.js +8 -0
- package/utils/text.js +17 -0
- package/utils/text.test.js +23 -0
- package/utils/useDeviceInfo.js +85 -0
- package/index.cjs.js +0 -88606
- package/index.cjs.js.map +0 -1
- package/index.esm.js +0 -88533
- package/index.esm.js.map +0 -1
|
@@ -0,0 +1,453 @@
|
|
|
1
|
+
@import '../../style-dictionary-dist/terraware.scss';
|
|
2
|
+
|
|
3
|
+
@font-face {
|
|
4
|
+
font-family: 'Inter';
|
|
5
|
+
src: local('Inter'), url(../../fonts/Inter.ttf) format('truetype');
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.button {
|
|
9
|
+
border: 0;
|
|
10
|
+
border-style: solid;
|
|
11
|
+
position: relative;
|
|
12
|
+
margin: 5px;
|
|
13
|
+
|
|
14
|
+
&:hover {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
&:focus {
|
|
19
|
+
outline: $tw-sz-btn-stroke solid $tw-clr-brdr-focus;
|
|
20
|
+
outline-offset: 2px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
&:disabled {
|
|
24
|
+
opacity: $tw-opcty-semantic-off;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.tw-icon {
|
|
28
|
+
vertical-align: top;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
&--small {
|
|
32
|
+
min-height: $tw-sz-btn-small-height;
|
|
33
|
+
font-size: $tw-fnt-btn-label-small-font-size;
|
|
34
|
+
font-weight: $tw-fnt-btn-label-small-font-weight;
|
|
35
|
+
font-family: $tw-fnt-btn-label-small-font-family;
|
|
36
|
+
line-height: $tw-fnt-btn-label-small-line-height;
|
|
37
|
+
min-width: $tw-sz-btn-small-min-width;
|
|
38
|
+
padding: calc((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2)
|
|
39
|
+
calc(#{$tw-sz-btn-small-height}/ 2);
|
|
40
|
+
border-radius: calc(#{$tw-sz-btn-small-height} / 2);
|
|
41
|
+
|
|
42
|
+
.tw-icon--small {
|
|
43
|
+
height: $tw-fnt-btn-label-small-line-height;
|
|
44
|
+
width: $tw-fnt-btn-label-small-line-height;
|
|
45
|
+
margin-right: calc((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2);
|
|
46
|
+
|
|
47
|
+
&.icon-spinner {
|
|
48
|
+
margin-right: 0;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
.icon-right {
|
|
52
|
+
height: $tw-fnt-btn-label-small-line-height;
|
|
53
|
+
width: $tw-fnt-btn-label-small-line-height;
|
|
54
|
+
margin-left: calc((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2);
|
|
55
|
+
margin-right: 0;
|
|
56
|
+
}
|
|
57
|
+
&.button-with-icon {
|
|
58
|
+
padding-left: calc(
|
|
59
|
+
(#{$tw-sz-btn-small-height} / 2) - (((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2))
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
&.button-with-right-icon {
|
|
63
|
+
padding-right: calc(
|
|
64
|
+
(#{$tw-sz-btn-small-height} / 2) - (((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2))
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
&.button-no-label.button-with-icon {
|
|
68
|
+
padding-left: calc((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2);
|
|
69
|
+
padding-right: calc((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2);
|
|
70
|
+
.tw-icon--small {
|
|
71
|
+
margin-right: 0;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
&--medium {
|
|
77
|
+
min-height: $tw-sz-btn-medium-height;
|
|
78
|
+
font-size: $tw-fnt-btn-label-medium-font-size;
|
|
79
|
+
font-weight: $tw-fnt-btn-label-medium-font-weight;
|
|
80
|
+
font-family: $tw-fnt-btn-label-medium-font-family;
|
|
81
|
+
line-height: $tw-fnt-btn-label-medium-line-height;
|
|
82
|
+
min-width: $tw-sz-btn-medium-min-width;
|
|
83
|
+
padding: calc((#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}) / 2)
|
|
84
|
+
calc(#{$tw-sz-btn-medium-height}/ 2);
|
|
85
|
+
border-radius: calc(#{$tw-sz-btn-medium-height} / 2);
|
|
86
|
+
|
|
87
|
+
.tw-icon--medium {
|
|
88
|
+
height: $tw-fnt-btn-label-medium-line-height;
|
|
89
|
+
width: $tw-fnt-btn-label-medium-line-height;
|
|
90
|
+
margin-right: calc((#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}) / 2);
|
|
91
|
+
|
|
92
|
+
&.icon-spinner {
|
|
93
|
+
margin-right: 0;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
.icon-right {
|
|
97
|
+
height: $tw-fnt-btn-label-medium-line-height;
|
|
98
|
+
width: $tw-fnt-btn-label-medium-line-height;
|
|
99
|
+
margin-left: calc((#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}) / 2);
|
|
100
|
+
margin-right: 0;
|
|
101
|
+
}
|
|
102
|
+
&.button-with-icon {
|
|
103
|
+
padding-left: calc(
|
|
104
|
+
(#{$tw-sz-btn-medium-height} / 2) -
|
|
105
|
+
(((#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}) / 2))
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
&.button-with-right-icon {
|
|
109
|
+
padding-right: calc(
|
|
110
|
+
(#{$tw-sz-btn-medium-height} / 2) -
|
|
111
|
+
(((#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}) / 2))
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
&.button-no-label.button-with-icon {
|
|
115
|
+
padding-left: 8px;
|
|
116
|
+
padding-right: 8px;
|
|
117
|
+
.tw-icon--medium {
|
|
118
|
+
margin-right: 0;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
&--large {
|
|
124
|
+
min-height: $tw-sz-btn-large-height;
|
|
125
|
+
font-size: $tw-fnt-btn-label-large-font-size;
|
|
126
|
+
font-weight: $tw-fnt-btn-label-large-font-weight;
|
|
127
|
+
font-family: $tw-fnt-btn-label-large-font-family;
|
|
128
|
+
line-height: $tw-fnt-btn-label-large-line-height;
|
|
129
|
+
min-width: $tw-sz-btn-large-min-width;
|
|
130
|
+
padding: calc((#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}) / 2)
|
|
131
|
+
calc(#{$tw-sz-btn-large-height}/ 2);
|
|
132
|
+
border-radius: calc(#{$tw-sz-btn-large-height} / 2);
|
|
133
|
+
|
|
134
|
+
.tw-icon--large {
|
|
135
|
+
height: $tw-fnt-btn-label-large-line-height;
|
|
136
|
+
width: $tw-fnt-btn-label-large-line-height;
|
|
137
|
+
margin-right: calc((#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}) / 2);
|
|
138
|
+
|
|
139
|
+
&.icon-spinner {
|
|
140
|
+
margin-right: 0;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
.icon-right {
|
|
144
|
+
height: $tw-fnt-btn-label-large-line-height;
|
|
145
|
+
width: $tw-fnt-btn-label-large-line-height;
|
|
146
|
+
margin-left: calc((#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}) / 2);
|
|
147
|
+
margin-right: 0;
|
|
148
|
+
}
|
|
149
|
+
&.button-with-icon {
|
|
150
|
+
padding-left: calc(
|
|
151
|
+
(#{$tw-sz-btn-large-height} / 2) - (((#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}) / 2))
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
&.button-with-right-icon {
|
|
155
|
+
padding-right: calc(
|
|
156
|
+
(#{$tw-sz-btn-large-height} / 2) - (((#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}) / 2))
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
&.button-no-label.button-with-icon {
|
|
160
|
+
padding-left: 10px;
|
|
161
|
+
padding-right: 10px;
|
|
162
|
+
.tw-icon--large {
|
|
163
|
+
margin-right: 0;
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
&--xlarge {
|
|
169
|
+
min-height: $tw-sz-btn-x-large-height;
|
|
170
|
+
font-size: $tw-fnt-btn-label-x-large-font-size;
|
|
171
|
+
font-weight: $tw-fnt-btn-label-x-large-font-weight;
|
|
172
|
+
font-family: $tw-fnt-btn-label-x-large-font-family;
|
|
173
|
+
line-height: $tw-fnt-btn-label-x-large-line-height;
|
|
174
|
+
min-width: $tw-sz-btn-x-large-min-width;
|
|
175
|
+
padding: calc((#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}) / 2)
|
|
176
|
+
calc(#{$tw-sz-btn-x-large-height}/ 2);
|
|
177
|
+
border-radius: calc(#{$tw-sz-btn-x-large-height} / 2);
|
|
178
|
+
|
|
179
|
+
.tw-icon--xlarge {
|
|
180
|
+
height: $tw-fnt-btn-label-x-large-line-height;
|
|
181
|
+
width: $tw-fnt-btn-label-x-large-line-height;
|
|
182
|
+
margin-right: calc((#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}) / 2);
|
|
183
|
+
|
|
184
|
+
&.icon-spinner {
|
|
185
|
+
margin-right: 0;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
.icon-right {
|
|
189
|
+
height: $tw-fnt-btn-label-x-large-line-height;
|
|
190
|
+
width: $tw-fnt-btn-label-x-large-line-height;
|
|
191
|
+
margin-left: calc((#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}) / 2);
|
|
192
|
+
margin-right: 0;
|
|
193
|
+
}
|
|
194
|
+
&.button-with-icon {
|
|
195
|
+
padding-left: calc(
|
|
196
|
+
(#{$tw-sz-btn-x-large-height} / 2) -
|
|
197
|
+
(((#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}) / 2))
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
&.button-with-right-icon {
|
|
201
|
+
padding-right: calc(
|
|
202
|
+
(#{$tw-sz-btn-x-large-height} / 2) -
|
|
203
|
+
(((#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}) / 2))
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
&.button-no-label.button-with-icon {
|
|
207
|
+
padding-left: 12px;
|
|
208
|
+
padding-right: 12px;
|
|
209
|
+
.tw-icon--xlarge {
|
|
210
|
+
margin-right: 0;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
&.button-no-label {
|
|
216
|
+
min-width: auto;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.productive-primary {
|
|
221
|
+
background-color: $tw-clr-bg-brand;
|
|
222
|
+
color: $tw-clr-txt-on-brand;
|
|
223
|
+
|
|
224
|
+
svg {
|
|
225
|
+
fill: $tw-clr-icn-on-brand;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&:hover {
|
|
229
|
+
background: $tw-clr-bg-brand-hover;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
&:active {
|
|
233
|
+
background-color: $tw-clr-bg-brand-active;
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.productive-secondary {
|
|
238
|
+
background-color: $tw-clr-bg-brand-ghost;
|
|
239
|
+
color: $tw-clr-txt-brand;
|
|
240
|
+
svg {
|
|
241
|
+
fill: $tw-clr-icn-brand;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
border: $tw-sz-btn-stroke solid $tw-clr-brdr-brand;
|
|
245
|
+
&:hover {
|
|
246
|
+
background-color: $tw-clr-bg-brand-ghost-hover;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
&:active {
|
|
250
|
+
background-color: $tw-clr-bg-brand-ghost-active;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
.productive-ghost {
|
|
255
|
+
background-color: $tw-clr-bg-brand-ghost;
|
|
256
|
+
color: $tw-clr-txt-brand;
|
|
257
|
+
|
|
258
|
+
svg {
|
|
259
|
+
fill: $tw-clr-icn-on-brand;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
&:hover {
|
|
263
|
+
background: $tw-clr-bg-brand-ghost-hover;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
&:active {
|
|
267
|
+
background-color: $tw-clr-bg-brand-ghost-active;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.passive-primary {
|
|
272
|
+
background-color: $tw-clr-bg-tertiary;
|
|
273
|
+
color: $tw-clr-txt;
|
|
274
|
+
svg {
|
|
275
|
+
fill: $tw-clr-icn;
|
|
276
|
+
}
|
|
277
|
+
&:hover {
|
|
278
|
+
background: $tw-clr-bg-tertiary-hover;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
&:active {
|
|
282
|
+
background-color: $tw-clr-bg-tertiary-active;
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
.passive-secondary {
|
|
287
|
+
background-color: $tw-clr-bg-ghost;
|
|
288
|
+
color: $tw-clr-brdr-secondary;
|
|
289
|
+
svg {
|
|
290
|
+
fill: $tw-clr-brdr-secondary;
|
|
291
|
+
}
|
|
292
|
+
border: $tw-sz-btn-stroke solid $tw-clr-brdr-secondary;
|
|
293
|
+
&:hover {
|
|
294
|
+
background-color: $tw-clr-bg-ghost-hover;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
&:active {
|
|
298
|
+
background-color: $tw-clr-bg-ghost-active;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.passive-ghost {
|
|
303
|
+
background-color: $tw-clr-bg-ghost;
|
|
304
|
+
color: $tw-clr-txt;
|
|
305
|
+
svg {
|
|
306
|
+
fill: $tw-clr-icn;
|
|
307
|
+
}
|
|
308
|
+
&:hover {
|
|
309
|
+
background-color: $tw-clr-bg-ghost-hover;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
&:active {
|
|
313
|
+
background-color: $tw-clr-bg-ghost-active;
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.destructive-primary {
|
|
318
|
+
background-color: $tw-clr-bg-danger;
|
|
319
|
+
color: $tw-clr-txt-on-danger;
|
|
320
|
+
svg {
|
|
321
|
+
fill: $tw-clr-icn-on-danger;
|
|
322
|
+
}
|
|
323
|
+
&:hover {
|
|
324
|
+
background: $tw-clr-bg-danger-hover;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
&:active {
|
|
328
|
+
background-color: $tw-clr-bg-danger-active;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
.destructive-secondary {
|
|
333
|
+
background-color: $tw-clr-bg-danger-ghost;
|
|
334
|
+
color: $tw-clr-txt-danger;
|
|
335
|
+
svg {
|
|
336
|
+
fill: $tw-clr-icn-danger;
|
|
337
|
+
}
|
|
338
|
+
border: $tw-sz-btn-stroke solid $tw-clr-brdr-danger;
|
|
339
|
+
&:hover {
|
|
340
|
+
background-color: $tw-clr-bg-danger-ghost-hover;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
&:active {
|
|
344
|
+
background-color: $tw-clr-bg-danger-ghost-active;
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.destructive-ghost {
|
|
349
|
+
background-color: $tw-clr-bg-danger-ghost;
|
|
350
|
+
color: $tw-clr-txt-danger;
|
|
351
|
+
svg {
|
|
352
|
+
fill: $tw-clr-icn-danger;
|
|
353
|
+
}
|
|
354
|
+
&:hover {
|
|
355
|
+
background-color: $tw-clr-bg-danger-ghost-hover;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
&:active {
|
|
359
|
+
background-color: $tw-clr-bg-danger-ghost-active;
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
.productive-secondary,
|
|
364
|
+
.passive-secondary,
|
|
365
|
+
.destructive-secondary {
|
|
366
|
+
&--small {
|
|
367
|
+
padding: calc(
|
|
368
|
+
(#{$tw-sz-btn-small-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-small-line-height}) / 2
|
|
369
|
+
)
|
|
370
|
+
calc((#{$tw-sz-btn-small-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
371
|
+
|
|
372
|
+
&.button-with-icon {
|
|
373
|
+
padding-left: calc(
|
|
374
|
+
(#{$tw-sz-btn-small-height} / 2) - #{$tw-sz-btn-stroke} - ((((
|
|
375
|
+
#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}
|
|
376
|
+
) / 2)))
|
|
377
|
+
);
|
|
378
|
+
}
|
|
379
|
+
&.button-no-label.button-with-icon {
|
|
380
|
+
padding-left: 4px;
|
|
381
|
+
padding-right: 4px;
|
|
382
|
+
.tw-icon--small {
|
|
383
|
+
margin-right: 0;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
&--medium {
|
|
389
|
+
padding: calc(
|
|
390
|
+
(#{$tw-sz-btn-medium-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-medium-line-height}) / 2
|
|
391
|
+
)
|
|
392
|
+
calc((#{$tw-sz-btn-medium-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
393
|
+
|
|
394
|
+
&.button-with-icon {
|
|
395
|
+
padding-left: calc(
|
|
396
|
+
(#{$tw-sz-btn-medium-height} / 2) - #{$tw-sz-btn-stroke} - ((((
|
|
397
|
+
#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}
|
|
398
|
+
) / 2)))
|
|
399
|
+
);
|
|
400
|
+
}
|
|
401
|
+
&.button-no-label.button-with-icon {
|
|
402
|
+
padding-left: 6px;
|
|
403
|
+
padding-right: 6px;
|
|
404
|
+
.tw-icon--medium {
|
|
405
|
+
margin-right: 0;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
&--large {
|
|
411
|
+
padding: calc(
|
|
412
|
+
(#{$tw-sz-btn-large-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-large-line-height}) / 2
|
|
413
|
+
)
|
|
414
|
+
calc((#{$tw-sz-btn-large-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
415
|
+
|
|
416
|
+
&.button-with-icon {
|
|
417
|
+
padding-left: calc(
|
|
418
|
+
(#{$tw-sz-btn-large-height} / 2) - #{$tw-sz-btn-stroke} - ((((
|
|
419
|
+
#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}
|
|
420
|
+
) / 2)))
|
|
421
|
+
);
|
|
422
|
+
}
|
|
423
|
+
&.button-no-label.button-with-icon {
|
|
424
|
+
padding-left: 8px;
|
|
425
|
+
padding-right: 8px;
|
|
426
|
+
.tw-icon--large {
|
|
427
|
+
margin-right: 0;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
&--xlarge {
|
|
433
|
+
padding: calc(
|
|
434
|
+
(#{$tw-sz-btn-x-large-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-x-large-line-height}) / 2
|
|
435
|
+
)
|
|
436
|
+
calc((#{$tw-sz-btn-x-large-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
437
|
+
|
|
438
|
+
&.button-with-icon {
|
|
439
|
+
padding-left: calc(
|
|
440
|
+
(#{$tw-sz-btn-x-large-height} / 2) - #{$tw-sz-btn-stroke} - ((((
|
|
441
|
+
#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}
|
|
442
|
+
) / 2)))
|
|
443
|
+
);
|
|
444
|
+
}
|
|
445
|
+
&.button-no-label.button-with-icon {
|
|
446
|
+
padding-left: 10px;
|
|
447
|
+
padding-right: 10px;
|
|
448
|
+
.tw-icon--xlarge {
|
|
449
|
+
margin-right: 0;
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.CheckboxStyle = void 0;
|
|
8
|
+
exports.default = Checkbox;
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
const CheckboxStyle = theme => ({
|
|
12
|
+
padding: theme.spacing(0, 1, 0, 0),
|
|
13
|
+
'& .MuiSvgIcon-root': {
|
|
14
|
+
fill: theme.palette.TwClrBrdrSecondary
|
|
15
|
+
},
|
|
16
|
+
'&:hover > .MuiSvgIcon-root': {
|
|
17
|
+
fill: theme.palette.TwClrBrdrHover
|
|
18
|
+
},
|
|
19
|
+
'&.Mui-checked > .MuiSvgIcon-root': {
|
|
20
|
+
fill: theme.palette.TwClrBgSelected,
|
|
21
|
+
color: theme.palette.TwClrBgSelected
|
|
22
|
+
},
|
|
23
|
+
'&.MuiCheckbox-indeterminate > .MuiSvgIcon-root': {
|
|
24
|
+
fill: theme.palette.TwClrBgSelected,
|
|
25
|
+
color: theme.palette.TwClrBgSelected
|
|
26
|
+
},
|
|
27
|
+
'&:focus > .MuiSvgIcon-root': {
|
|
28
|
+
border: "2px solid ".concat(theme.palette.TwClrBgSelected)
|
|
29
|
+
},
|
|
30
|
+
'&.Mui-disabled': {
|
|
31
|
+
opacity: 0.5
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
exports.CheckboxStyle = CheckboxStyle;
|
|
35
|
+
function Checkbox(props) {
|
|
36
|
+
var _props$value;
|
|
37
|
+
const theme = (0, _material.useTheme)();
|
|
38
|
+
const onChange = (event, checked) => {
|
|
39
|
+
if (props.indeterminate) {
|
|
40
|
+
props.onChange(true);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
props.onChange(checked);
|
|
44
|
+
};
|
|
45
|
+
return /*#__PURE__*/_react.default.createElement(_material.FormControlLabel, {
|
|
46
|
+
id: props.id,
|
|
47
|
+
onChange: onChange,
|
|
48
|
+
label: props.label,
|
|
49
|
+
disabled: props.disabled,
|
|
50
|
+
control: /*#__PURE__*/_react.default.createElement(_material.Checkbox, {
|
|
51
|
+
disabled: props.disabled,
|
|
52
|
+
disableRipple: true,
|
|
53
|
+
id: 'check-' + props.id,
|
|
54
|
+
indeterminate: props.indeterminate,
|
|
55
|
+
checked: (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : false,
|
|
56
|
+
size: "medium",
|
|
57
|
+
sx: [CheckboxStyle(theme), ...(Array.isArray(props.sx) ? props.sx : [props.sx])]
|
|
58
|
+
}),
|
|
59
|
+
className: props.className,
|
|
60
|
+
sx: {
|
|
61
|
+
alignItems: 'flex-start',
|
|
62
|
+
color: theme.palette.TwClrTxt,
|
|
63
|
+
fontFamily: 'Inter',
|
|
64
|
+
fontSize: '16px',
|
|
65
|
+
fontWeight: 500,
|
|
66
|
+
lineHeight: '24px',
|
|
67
|
+
margin: theme.spacing(1, 0, 0, 0)
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = Confirm;
|
|
9
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
12
|
+
var _DialogBox = _interopRequireDefault(require("../DialogBox/DialogBox"));
|
|
13
|
+
/**
|
|
14
|
+
* A generic confirm modal built on top of DialogBox.
|
|
15
|
+
* Most properties are optional with default values.
|
|
16
|
+
* Required properties are commented as such.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function Confirm(_ref) {
|
|
20
|
+
let {
|
|
21
|
+
confirmButtonDisabled,
|
|
22
|
+
confirmButtonIcon,
|
|
23
|
+
confirmButtonId,
|
|
24
|
+
confirmButtonPriority,
|
|
25
|
+
confirmButtonText,
|
|
26
|
+
confirmButtonType,
|
|
27
|
+
closeButtonId,
|
|
28
|
+
closeButtonText,
|
|
29
|
+
message,
|
|
30
|
+
onClose,
|
|
31
|
+
onConfirm,
|
|
32
|
+
open,
|
|
33
|
+
size,
|
|
34
|
+
textStyle,
|
|
35
|
+
title
|
|
36
|
+
} = _ref;
|
|
37
|
+
const theme = (0, _material.useTheme)();
|
|
38
|
+
const middleButtons = (0, _react.useMemo)(() => {
|
|
39
|
+
const buttons = [/*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
40
|
+
disabled: confirmButtonDisabled,
|
|
41
|
+
icon: confirmButtonIcon,
|
|
42
|
+
id: confirmButtonId || 'confirm-submit',
|
|
43
|
+
key: "button-2",
|
|
44
|
+
label: confirmButtonText,
|
|
45
|
+
onClick: onConfirm,
|
|
46
|
+
priority: confirmButtonPriority || 'primary',
|
|
47
|
+
type: confirmButtonType || 'productive'
|
|
48
|
+
})];
|
|
49
|
+
if (onClose && closeButtonText) {
|
|
50
|
+
buttons.unshift( /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
51
|
+
id: closeButtonId || 'confirm-close',
|
|
52
|
+
key: "button-1",
|
|
53
|
+
label: closeButtonText,
|
|
54
|
+
onClick: onClose,
|
|
55
|
+
priority: "secondary",
|
|
56
|
+
type: "passive"
|
|
57
|
+
}));
|
|
58
|
+
}
|
|
59
|
+
return buttons;
|
|
60
|
+
}, [confirmButtonDisabled, confirmButtonIcon, confirmButtonId, confirmButtonPriority, confirmButtonText, confirmButtonType, closeButtonId, closeButtonText, onClose, onConfirm]);
|
|
61
|
+
const content = (0, _react.useMemo)(() => {
|
|
62
|
+
const text = (str, key) => {
|
|
63
|
+
return /*#__PURE__*/_react.default.createElement(_material.Typography, {
|
|
64
|
+
color: theme.palette.TwClrTxt,
|
|
65
|
+
fontSize: "16px",
|
|
66
|
+
fontWeight: 400,
|
|
67
|
+
key: key,
|
|
68
|
+
lineHeight: "24px",
|
|
69
|
+
textAlign: "center",
|
|
70
|
+
sx: {
|
|
71
|
+
marginBottom: theme.spacing(1),
|
|
72
|
+
'&:last-child': {
|
|
73
|
+
marginBottom: 0
|
|
74
|
+
},
|
|
75
|
+
...(textStyle || {})
|
|
76
|
+
}
|
|
77
|
+
}, str);
|
|
78
|
+
};
|
|
79
|
+
if (typeof message === 'string') {
|
|
80
|
+
return text(message);
|
|
81
|
+
} else if (Array.isArray(message)) {
|
|
82
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, message.map((str, i) => text(str, "".concat(str, "_").concat(i))));
|
|
83
|
+
} else {
|
|
84
|
+
return message;
|
|
85
|
+
}
|
|
86
|
+
}, [message, textStyle, theme]);
|
|
87
|
+
return /*#__PURE__*/_react.default.createElement(_DialogBox.default, {
|
|
88
|
+
onClose: onClose,
|
|
89
|
+
open: open !== null && open !== void 0 ? open : true,
|
|
90
|
+
title: title,
|
|
91
|
+
size: size || 'medium',
|
|
92
|
+
middleButtons: middleButtons
|
|
93
|
+
}, content);
|
|
94
|
+
}
|