@terraware/web-components 1.0.3 → 1.0.6
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/Autocomplete.d.ts +16 -0
- package/components/Autocomplete.d.ts.map +1 -0
- package/components/Autocomplete.js +53 -0
- package/components/Button/Button.d.ts +18 -0
- package/components/Button/Button.d.ts.map +1 -0
- package/components/Button/Button.js +42 -0
- package/components/Button/button.test.d.ts +2 -0
- package/components/Button/button.test.d.ts.map +1 -0
- package/components/Button/button.test.js +33 -0
- package/components/Button/styles.scss +443 -0
- package/components/Checkbox.d.ts +12 -0
- package/components/Checkbox.d.ts.map +1 -0
- package/components/Checkbox.js +33 -0
- package/components/DatePicker.d.ts +19 -0
- package/components/DatePicker.d.ts.map +1 -0
- package/components/DatePicker.js +45 -0
- package/components/DialogBox/DialogBox.d.ts +16 -0
- package/components/DialogBox/DialogBox.d.ts.map +1 -0
- package/components/DialogBox/DialogBox.js +85 -0
- package/components/DialogBox/styles.scss +138 -0
- package/components/Divisor.d.ts +6 -0
- package/components/Divisor.d.ts.map +1 -0
- package/components/Divisor.js +24 -0
- package/components/Dropdown.d.ts +15 -0
- package/components/Dropdown.d.ts.map +1 -0
- package/components/Dropdown.js +59 -0
- package/components/Icon/Icon.d.ts +11 -0
- package/components/Icon/Icon.d.ts.map +1 -0
- package/components/Icon/Icon.js +25 -0
- package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyGrayIconUploadToTheCloud.js +41 -0
- package/components/Icon/icons/assets/BlobbyIconHappy.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconHappy.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconHappy.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconHeartMonitor.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconHeartMonitor.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconHeartMonitor.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconLeaf.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconLeaf.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconLeaf.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconLibrary.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconLibrary.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconLibrary.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconOrganization.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconOrganization.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconOrganization.js +158 -0
- package/components/Icon/icons/assets/BlobbyIconPeople.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconPeople.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconPeople.js +158 -0
- package/components/Icon/icons/assets/BlobbyIconSeedBank.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconSeedBank.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconSeedBank.js +165 -0
- package/components/Icon/icons/assets/BlobbyIconWrench.d.ts +8 -0
- package/components/Icon/icons/assets/BlobbyIconWrench.d.ts.map +1 -0
- package/components/Icon/icons/assets/BlobbyIconWrench.js +165 -0
- package/components/Icon/icons/assets/Bug.d.ts +8 -0
- package/components/Icon/icons/assets/Bug.d.ts.map +1 -0
- package/components/Icon/icons/assets/Bug.js +36 -0
- package/components/Icon/icons/assets/Calendar.d.ts +8 -0
- package/components/Icon/icons/assets/Calendar.d.ts.map +1 -0
- package/components/Icon/icons/assets/Calendar.js +35 -0
- package/components/Icon/icons/assets/CaretDown.d.ts +8 -0
- package/components/Icon/icons/assets/CaretDown.d.ts.map +1 -0
- package/components/Icon/icons/assets/CaretDown.js +35 -0
- package/components/Icon/icons/assets/CaretLeft.d.ts +8 -0
- package/components/Icon/icons/assets/CaretLeft.d.ts.map +1 -0
- package/components/Icon/icons/assets/CaretLeft.js +35 -0
- package/components/Icon/icons/assets/CaretUp.d.ts +8 -0
- package/components/Icon/icons/assets/CaretUp.d.ts.map +1 -0
- package/components/Icon/icons/assets/CaretUp.js +35 -0
- package/components/Icon/icons/assets/ChevronDown.d.ts +8 -0
- package/components/Icon/icons/assets/ChevronDown.d.ts.map +1 -0
- package/components/Icon/icons/assets/ChevronDown.js +36 -0
- package/components/Icon/icons/assets/ChevronUp.d.ts +8 -0
- package/components/Icon/icons/assets/ChevronUp.d.ts.map +1 -0
- package/components/Icon/icons/assets/ChevronUp.js +35 -0
- package/components/Icon/icons/assets/Close.d.ts +8 -0
- package/components/Icon/icons/assets/Close.d.ts.map +1 -0
- package/components/Icon/icons/assets/Close.js +35 -0
- package/components/Icon/icons/assets/Critical.d.ts +8 -0
- package/components/Icon/icons/assets/Critical.d.ts.map +1 -0
- package/components/Icon/icons/assets/Critical.js +35 -0
- package/components/Icon/icons/assets/Edit.d.ts +8 -0
- package/components/Icon/icons/assets/Edit.d.ts.map +1 -0
- package/components/Icon/icons/assets/Edit.js +158 -0
- package/components/Icon/icons/assets/Error.d.ts +8 -0
- package/components/Icon/icons/assets/Error.d.ts.map +1 -0
- package/components/Icon/icons/assets/Error.js +35 -0
- package/components/Icon/icons/assets/Export.d.ts +8 -0
- package/components/Icon/icons/assets/Export.d.ts.map +1 -0
- package/components/Icon/icons/assets/Export.js +36 -0
- package/components/Icon/icons/assets/Filter.d.ts +8 -0
- package/components/Icon/icons/assets/Filter.d.ts.map +1 -0
- package/components/Icon/icons/assets/Filter.js +36 -0
- package/components/Icon/icons/assets/Folder.d.ts +8 -0
- package/components/Icon/icons/assets/Folder.d.ts.map +1 -0
- package/components/Icon/icons/assets/Folder.js +35 -0
- package/components/Icon/icons/assets/Help.d.ts +8 -0
- package/components/Icon/icons/assets/Help.d.ts.map +1 -0
- package/components/Icon/icons/assets/Help.js +35 -0
- package/components/Icon/icons/assets/Home.d.ts +8 -0
- package/components/Icon/icons/assets/Home.d.ts.map +1 -0
- package/components/Icon/icons/assets/Home.js +35 -0
- package/components/Icon/icons/assets/IconCancel.d.ts +8 -0
- package/components/Icon/icons/assets/IconCancel.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconCancel.js +36 -0
- package/components/Icon/icons/assets/IconChargingBattery.d.ts +8 -0
- package/components/Icon/icons/assets/IconChargingBattery.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconChargingBattery.js +36 -0
- package/components/Icon/icons/assets/IconCheckmark.d.ts +8 -0
- package/components/Icon/icons/assets/IconCheckmark.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconCheckmark.js +36 -0
- package/components/Icon/icons/assets/IconDashboard.d.ts +8 -0
- package/components/Icon/icons/assets/IconDashboard.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconDashboard.js +36 -0
- package/components/Icon/icons/assets/IconHeartMonitor.d.ts +8 -0
- package/components/Icon/icons/assets/IconHeartMonitor.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconHeartMonitor.js +35 -0
- package/components/Icon/icons/assets/IconMail.d.ts +8 -0
- package/components/Icon/icons/assets/IconMail.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconMail.js +36 -0
- package/components/Icon/icons/assets/IconManager.d.ts +8 -0
- package/components/Icon/icons/assets/IconManager.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconManager.js +36 -0
- package/components/Icon/icons/assets/IconMenu.d.ts +8 -0
- package/components/Icon/icons/assets/IconMenu.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconMenu.js +36 -0
- package/components/Icon/icons/assets/IconOrg.d.ts +8 -0
- package/components/Icon/icons/assets/IconOrg.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconOrg.js +36 -0
- package/components/Icon/icons/assets/IconSeedBank.d.ts +8 -0
- package/components/Icon/icons/assets/IconSeedBank.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconSeedBank.js +35 -0
- package/components/Icon/icons/assets/IconWifi.d.ts +8 -0
- package/components/Icon/icons/assets/IconWifi.d.ts.map +1 -0
- package/components/Icon/icons/assets/IconWifi.js +36 -0
- package/components/Icon/icons/assets/Info.d.ts +8 -0
- package/components/Icon/icons/assets/Info.d.ts.map +1 -0
- package/components/Icon/icons/assets/Info.js +35 -0
- package/components/Icon/icons/assets/Key.d.ts +8 -0
- package/components/Icon/icons/assets/Key.d.ts.map +1 -0
- package/components/Icon/icons/assets/Key.js +35 -0
- package/components/Icon/icons/assets/Leaf.d.ts +8 -0
- package/components/Icon/icons/assets/Leaf.d.ts.map +1 -0
- package/components/Icon/icons/assets/Leaf.js +35 -0
- package/components/Icon/icons/assets/Lock.d.ts +8 -0
- package/components/Icon/icons/assets/Lock.d.ts.map +1 -0
- package/components/Icon/icons/assets/Lock.js +34 -0
- package/components/Icon/icons/assets/MenuVertical.d.ts +8 -0
- package/components/Icon/icons/assets/MenuVertical.d.ts.map +1 -0
- package/components/Icon/icons/assets/MenuVertical.js +36 -0
- package/components/Icon/icons/assets/Notification.d.ts +8 -0
- package/components/Icon/icons/assets/Notification.d.ts.map +1 -0
- package/components/Icon/icons/assets/Notification.js +35 -0
- package/components/Icon/icons/assets/Person.d.ts +8 -0
- package/components/Icon/icons/assets/Person.d.ts.map +1 -0
- package/components/Icon/icons/assets/Person.js +35 -0
- package/components/Icon/icons/assets/Plus.d.ts +8 -0
- package/components/Icon/icons/assets/Plus.d.ts.map +1 -0
- package/components/Icon/icons/assets/Plus.js +35 -0
- package/components/Icon/icons/assets/RestorationSite.d.ts +8 -0
- package/components/Icon/icons/assets/RestorationSite.d.ts.map +1 -0
- package/components/Icon/icons/assets/RestorationSite.js +35 -0
- package/components/Icon/icons/assets/Search.d.ts +8 -0
- package/components/Icon/icons/assets/Search.d.ts.map +1 -0
- package/components/Icon/icons/assets/Search.js +35 -0
- package/components/Icon/icons/assets/Seeds.d.ts +8 -0
- package/components/Icon/icons/assets/Seeds.d.ts.map +1 -0
- package/components/Icon/icons/assets/Seeds.js +35 -0
- package/components/Icon/icons/assets/Site.d.ts +8 -0
- package/components/Icon/icons/assets/Site.d.ts.map +1 -0
- package/components/Icon/icons/assets/Site.js +35 -0
- package/components/Icon/icons/assets/Sparkles.d.ts +8 -0
- package/components/Icon/icons/assets/Sparkles.d.ts.map +1 -0
- package/components/Icon/icons/assets/Sparkles.js +36 -0
- package/components/Icon/icons/assets/Species.d.ts +8 -0
- package/components/Icon/icons/assets/Species.d.ts.map +1 -0
- package/components/Icon/icons/assets/Species.js +35 -0
- package/components/Icon/icons/assets/Species2.d.ts +8 -0
- package/components/Icon/icons/assets/Species2.d.ts.map +1 -0
- package/components/Icon/icons/assets/Species2.js +158 -0
- package/components/Icon/icons/assets/Spinner.d.ts +8 -0
- package/components/Icon/icons/assets/Spinner.d.ts.map +1 -0
- package/components/Icon/icons/assets/Spinner.js +61 -0
- package/components/Icon/icons/assets/Success.d.ts +8 -0
- package/components/Icon/icons/assets/Success.d.ts.map +1 -0
- package/components/Icon/icons/assets/Success.js +35 -0
- package/components/Icon/icons/assets/Touchscreen.d.ts +8 -0
- package/components/Icon/icons/assets/Touchscreen.d.ts.map +1 -0
- package/components/Icon/icons/assets/Touchscreen.js +36 -0
- package/components/Icon/icons/assets/UploadCloud.d.ts +8 -0
- package/components/Icon/icons/assets/UploadCloud.d.ts.map +1 -0
- package/components/Icon/icons/assets/UploadCloud.js +158 -0
- package/components/Icon/icons/assets/Warning.d.ts +8 -0
- package/components/Icon/icons/assets/Warning.d.ts.map +1 -0
- package/components/Icon/icons/assets/Warning.js +35 -0
- package/components/Icon/icons/assets/index.d.ts +57 -0
- package/components/Icon/icons/assets/index.d.ts.map +1 -0
- package/components/Icon/icons/assets/index.js +455 -0
- package/components/Icon/icons/index.d.ts +8 -0
- package/components/Icon/icons/index.d.ts.map +1 -0
- package/components/Icon/icons/index.js +179 -0
- package/components/Icon/styles.scss +43 -0
- package/components/Navbar/NavFooter.d.ts +7 -0
- package/components/Navbar/NavFooter.d.ts.map +1 -0
- package/components/Navbar/NavFooter.js +19 -0
- package/components/Navbar/NavItem.d.ts +13 -0
- package/components/Navbar/NavItem.d.ts.map +1 -0
- package/components/Navbar/NavItem.js +42 -0
- package/components/Navbar/NavSection.d.ts +7 -0
- package/components/Navbar/NavSection.d.ts.map +1 -0
- package/components/Navbar/NavSection.js +23 -0
- package/components/Navbar/Navbar.d.ts +8 -0
- package/components/Navbar/Navbar.d.ts.map +1 -0
- package/components/Navbar/Navbar.js +64 -0
- package/components/Navbar/logo.svg +25 -0
- package/components/Navbar/styles.scss +159 -0
- package/components/Note.d.ts +6 -0
- package/components/Note.d.ts.map +1 -0
- package/components/Note.js +35 -0
- package/components/ProgressCircle/ProgressCircle.d.ts +10 -0
- package/components/ProgressCircle/ProgressCircle.d.ts.map +1 -0
- package/components/ProgressCircle/ProgressCircle.js +37 -0
- package/components/ProgressCircle/styles.scss +84 -0
- package/components/RadioButton.d.ts +10 -0
- package/components/RadioButton.d.ts.map +1 -0
- package/components/RadioButton.js +31 -0
- package/components/Select/Select.d.ts +23 -0
- package/components/Select/Select.d.ts.map +1 -0
- package/components/Select/Select.js +248 -0
- package/components/Select/styles.scss +282 -0
- package/components/Size.d.ts +2 -0
- package/components/Size.d.ts.map +1 -0
- package/components/Size.js +5 -0
- package/components/SummaryBox.d.ts +11 -0
- package/components/SummaryBox.d.ts.map +1 -0
- package/components/SummaryBox.js +79 -0
- package/components/Textfield/Textfield.d.ts +27 -0
- package/components/Textfield/Textfield.d.ts.map +1 -0
- package/components/Textfield/Textfield.js +123 -0
- package/components/Textfield/styles.scss +216 -0
- package/components/table/EnhancedTableToolbar.d.ts +9 -0
- package/components/table/EnhancedTableToolbar.d.ts.map +1 -0
- package/components/table/EnhancedTableToolbar.js +53 -0
- package/components/table/TableCellRenderer.d.ts +26 -0
- package/components/table/TableCellRenderer.d.ts.map +1 -0
- package/components/table/TableCellRenderer.js +166 -0
- package/components/table/TableHeader.d.ts +16 -0
- package/components/table/TableHeader.d.ts.map +1 -0
- package/components/table/TableHeader.js +68 -0
- package/components/table/TableHeaderItem.d.ts +17 -0
- package/components/table/TableHeaderItem.d.ts.map +1 -0
- package/components/table/TableHeaderItem.js +77 -0
- package/components/table/index.d.ts +40 -0
- package/components/table/index.d.ts.map +1 -0
- package/components/table/index.js +322 -0
- package/components/table/sort.d.ts +9 -0
- package/components/table/sort.d.ts.map +1 -0
- package/components/table/sort.js +51 -0
- package/components/table/types.d.ts +22 -0
- package/components/table/types.d.ts.map +1 -0
- package/components/table/types.js +5 -0
- package/fonts/Inter.ttf +0 -0
- package/index.css +13 -0
- package/index.d.ts +28 -0
- package/index.d.ts.map +1 -0
- package/license-report.html +50 -0
- package/package.json +1 -77
- package/setupTests.d.ts +2 -0
- package/setupTests.d.ts.map +1 -0
- package/setupTests.js +5 -0
- package/stories/Autocomplete.stories.d.ts +9 -0
- package/stories/Autocomplete.stories.d.ts.map +1 -0
- package/stories/Button.stories.d.ts +35 -0
- package/stories/Button.stories.d.ts.map +1 -0
- package/stories/Checkbox.stories.d.ts +9 -0
- package/stories/Checkbox.stories.d.ts.map +1 -0
- package/stories/DatePicker.stories.d.ts +11 -0
- package/stories/DatePicker.stories.d.ts.map +1 -0
- package/stories/DialogBox.stories.d.ts +14 -0
- package/stories/DialogBox.stories.d.ts.map +1 -0
- package/stories/Divisor.stories.d.ts +20 -0
- package/stories/Divisor.stories.d.ts.map +1 -0
- package/stories/Dropdown.stories.d.ts +9 -0
- package/stories/Dropdown.stories.d.ts.map +1 -0
- package/stories/Icon.stories.d.ts +9 -0
- package/stories/Icon.stories.d.ts.map +1 -0
- package/stories/Navbar.stories.d.ts +10 -0
- package/stories/Navbar.stories.d.ts.map +1 -0
- package/stories/Note.stories.d.ts +9 -0
- package/stories/Note.stories.d.ts.map +1 -0
- package/stories/ProgressCircle.stories.d.ts +9 -0
- package/stories/ProgressCircle.stories.d.ts.map +1 -0
- package/stories/RadioButton.stories.d.ts +9 -0
- package/stories/RadioButton.stories.d.ts.map +1 -0
- package/stories/Select.stories.d.ts +9 -0
- package/stories/Select.stories.d.ts.map +1 -0
- package/stories/SummaryBox.stories.d.ts +11 -0
- package/stories/SummaryBox.stories.d.ts.map +1 -0
- package/stories/Table.stories.d.ts +12 -0
- package/stories/Table.stories.d.ts.map +1 -0
- package/stories/TextfieldNew.stories.d.ts +29 -0
- package/stories/TextfieldNew.stories.d.ts.map +1 -0
- package/style-dictionary-dist/button_variables.scss +299 -0
- package/style-dictionary-dist/dialogBox_variables.scss +251 -0
- package/style-dictionary-dist/navbar_variables.scss +257 -0
- package/style-dictionary-dist/progressCircle_variables.scss +251 -0
- package/style-dictionary-dist/textfield_variables.scss +297 -0
- package/theme.d.ts +60 -0
- package/theme.d.ts.map +1 -0
- package/theme.js +76 -0
- package/utils/date.d.ts +3 -0
- package/utils/date.d.ts.map +1 -0
- package/utils/date.js +13 -0
- package/utils/index.d.ts +6 -0
- package/utils/index.d.ts.map +1 -0
- package/utils/index.js +39 -0
- package/utils/preventDefaultEvent.d.ts +4 -0
- package/utils/preventDefaultEvent.d.ts.map +1 -0
- package/utils/preventDefaultEvent.js +13 -0
- package/utils/text.d.ts +3 -0
- package/utils/text.d.ts.map +1 -0
- package/utils/text.js +13 -0
- package/utils/useDeviceInfo.d.ts +42 -0
- package/utils/useDeviceInfo.d.ts.map +1 -0
- package/utils/useDeviceInfo.js +87 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
values: string[];
|
|
6
|
+
onChange: (id: string, value: string) => void;
|
|
7
|
+
selected: string | undefined;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
freeSolo: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare type DropdownItem = {
|
|
12
|
+
label: string;
|
|
13
|
+
value: string;
|
|
14
|
+
};
|
|
15
|
+
export default function Autocomplete({ id, label, values, onChange, selected, disabled, freeSolo, }: Props): JSX.Element;
|
|
16
|
+
//# sourceMappingURL=Autocomplete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Autocomplete.d.ts","sourceRoot":"","sources":["../../src/components/Autocomplete.tsx"],"names":[],"mappings":";AAGA,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,oBAAY,YAAY,GAAG;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,EAAE,EACF,KAAK,EACL,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,QAAQ,GACT,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAyBrB"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = Autocomplete;
|
|
9
|
+
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
function Autocomplete(_ref) {
|
|
15
|
+
var id = _ref.id,
|
|
16
|
+
label = _ref.label,
|
|
17
|
+
values = _ref.values,
|
|
18
|
+
onChange = _ref.onChange,
|
|
19
|
+
selected = _ref.selected,
|
|
20
|
+
disabled = _ref.disabled,
|
|
21
|
+
freeSolo = _ref.freeSolo;
|
|
22
|
+
|
|
23
|
+
var onChangeHandler = function onChangeHandler(event, value) {
|
|
24
|
+
if (event) {
|
|
25
|
+
if (value) {
|
|
26
|
+
onChange(id, value);
|
|
27
|
+
} else {
|
|
28
|
+
onChange(id, '');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement(_material.Autocomplete, {
|
|
34
|
+
disabled: disabled,
|
|
35
|
+
id: id,
|
|
36
|
+
options: values,
|
|
37
|
+
getOptionLabel: function getOptionLabel(option) {
|
|
38
|
+
return option ? option : '';
|
|
39
|
+
},
|
|
40
|
+
onChange: onChangeHandler,
|
|
41
|
+
onInputChange: onChangeHandler,
|
|
42
|
+
inputValue: selected,
|
|
43
|
+
freeSolo: freeSolo,
|
|
44
|
+
forcePopupIcon: true,
|
|
45
|
+
renderInput: function renderInput(params) {
|
|
46
|
+
return /*#__PURE__*/_react.default.createElement(_material.TextField, Object.assign({}, params, {
|
|
47
|
+
label: label,
|
|
48
|
+
variant: "outlined",
|
|
49
|
+
size: "small"
|
|
50
|
+
}));
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { IconName } from '../Icon/icons';
|
|
3
|
+
import { Size } from '../Size';
|
|
4
|
+
import './styles.scss';
|
|
5
|
+
export interface Props {
|
|
6
|
+
onClick: (event?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
7
|
+
label?: string;
|
|
8
|
+
type?: 'productive' | 'passive' | 'destructive';
|
|
9
|
+
priority?: 'primary' | 'secondary';
|
|
10
|
+
size?: Size;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
icon?: IconName;
|
|
13
|
+
processing?: boolean;
|
|
14
|
+
id?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
export default function Button(props: Props): JSX.Element;
|
|
18
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,eAAe,CAAC;AAEvB,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IAC3E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,GAAG,aAAa,CAAC;IAChD,QAAQ,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IACnC,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CA4BxD"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = Button;
|
|
9
|
+
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Icon = _interopRequireDefault(require("../Icon/Icon"));
|
|
13
|
+
|
|
14
|
+
require("./styles.scss");
|
|
15
|
+
|
|
16
|
+
function Button(props) {
|
|
17
|
+
var onClick = props.onClick,
|
|
18
|
+
label = props.label,
|
|
19
|
+
_props$type = props.type,
|
|
20
|
+
type = _props$type === void 0 ? 'productive' : _props$type,
|
|
21
|
+
_props$priority = props.priority,
|
|
22
|
+
priority = _props$priority === void 0 ? 'primary' : _props$priority,
|
|
23
|
+
_props$size = props.size,
|
|
24
|
+
size = _props$size === void 0 ? 'small' : _props$size,
|
|
25
|
+
disabled = props.disabled,
|
|
26
|
+
icon = props.icon,
|
|
27
|
+
processing = props.processing,
|
|
28
|
+
id = props.id,
|
|
29
|
+
className = props.className;
|
|
30
|
+
return /*#__PURE__*/_react.default.createElement("button", {
|
|
31
|
+
id: id,
|
|
32
|
+
onClick: onClick,
|
|
33
|
+
className: "button ".concat(type, "-").concat(priority, " button--").concat(size, " ").concat(type, "-").concat(priority, "--").concat(size, " ").concat(icon && !processing ? 'button-with-icon' : '', " ").concat(!label ? 'button-no-label' : '', " ").concat(className !== null && className !== void 0 ? className : ''),
|
|
34
|
+
disabled: disabled
|
|
35
|
+
}, processing && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
36
|
+
name: "spinner",
|
|
37
|
+
size: size
|
|
38
|
+
}), !processing && icon && /*#__PURE__*/_react.default.createElement(_Icon.default, {
|
|
39
|
+
name: icon,
|
|
40
|
+
size: size
|
|
41
|
+
}), !processing && !!label && label);
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.test.d.ts","sourceRoot":"","sources":["../../../src/components/Button/button.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
var _react = require("@testing-library/react");
|
|
6
|
+
|
|
7
|
+
var _react2 = _interopRequireDefault(require("react"));
|
|
8
|
+
|
|
9
|
+
var _Button = _interopRequireDefault(require("./Button"));
|
|
10
|
+
|
|
11
|
+
test('calls onClick prop when clicked', function () {
|
|
12
|
+
var handleClick = jest.fn();
|
|
13
|
+
(0, _react.render)( /*#__PURE__*/_react2.default.createElement(_Button.default, {
|
|
14
|
+
onClick: handleClick,
|
|
15
|
+
label: "Click me"
|
|
16
|
+
}));
|
|
17
|
+
|
|
18
|
+
_react.fireEvent.click(_react.screen.getByText(/click me/i));
|
|
19
|
+
|
|
20
|
+
expect(handleClick).toHaveBeenCalledTimes(1);
|
|
21
|
+
});
|
|
22
|
+
test('should not call onClick prop when button is disabled', function () {
|
|
23
|
+
var handleClick = jest.fn();
|
|
24
|
+
(0, _react.render)( /*#__PURE__*/_react2.default.createElement(_Button.default, {
|
|
25
|
+
onClick: handleClick,
|
|
26
|
+
label: "Click me",
|
|
27
|
+
disabled: true
|
|
28
|
+
}));
|
|
29
|
+
|
|
30
|
+
_react.fireEvent.click(_react.screen.getByText(/click me/i));
|
|
31
|
+
|
|
32
|
+
expect(handleClick).toHaveBeenCalledTimes(0);
|
|
33
|
+
});
|
|
@@ -0,0 +1,443 @@
|
|
|
1
|
+
@import '../../style-dictionary-dist/button_variables.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
|
+
|
|
13
|
+
&:hover {
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
&--small {
|
|
18
|
+
height: $tw-sz-btn-small-height;
|
|
19
|
+
font-size: $tw-fnt-btn-label-small-font-size;
|
|
20
|
+
font-weight: $tw-fnt-btn-label-small-font-weight;
|
|
21
|
+
font-family: $tw-fnt-btn-label-small-font-family;
|
|
22
|
+
line-height: $tw-fnt-btn-label-small-line-height;
|
|
23
|
+
min-width: $tw-sz-btn-small-min-width;
|
|
24
|
+
padding: calc((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2)
|
|
25
|
+
calc(#{$tw-sz-btn-small-height}/ 2);
|
|
26
|
+
border-radius: calc(#{$tw-sz-btn-small-height} / 2);
|
|
27
|
+
|
|
28
|
+
&:focus {
|
|
29
|
+
&:after {
|
|
30
|
+
content: '';
|
|
31
|
+
display: block;
|
|
32
|
+
position: absolute;
|
|
33
|
+
top: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
34
|
+
bottom: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
35
|
+
left: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
36
|
+
right: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
37
|
+
border-radius: calc(#{$tw-sz-btn-small-height + $tw-sz-btn-stroke * 4} / 2);
|
|
38
|
+
border: $tw-sz-btn-stroke solid $tw-clr-btn-stroke-focus;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
&.button-with-icon {
|
|
43
|
+
padding-left: calc(
|
|
44
|
+
(#{$tw-sz-btn-small-height} / 2) - (((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2))
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
.tw-icon--small {
|
|
48
|
+
margin-right: calc((#{$tw-sz-btn-small-height} - #{$tw-fnt-btn-label-small-line-height}) / 2);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
&.button-no-label.button-with-icon {
|
|
52
|
+
padding: 6px;
|
|
53
|
+
.tw-icon--small {
|
|
54
|
+
margin-right: 0;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
&--medium {
|
|
60
|
+
height: $tw-sz-btn-medium-height;
|
|
61
|
+
font-size: $tw-fnt-btn-label-medium-font-size;
|
|
62
|
+
font-weight: $tw-fnt-btn-label-medium-font-weight;
|
|
63
|
+
font-family: $tw-fnt-btn-label-medium-font-family;
|
|
64
|
+
line-height: $tw-fnt-btn-label-medium-line-height;
|
|
65
|
+
min-width: $tw-sz-btn-medium-min-width;
|
|
66
|
+
padding: calc((#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}) / 2)
|
|
67
|
+
calc(#{$tw-sz-btn-medium-height}/ 2);
|
|
68
|
+
border-radius: calc(#{$tw-sz-btn-medium-height} / 2);
|
|
69
|
+
|
|
70
|
+
&:focus {
|
|
71
|
+
&:after {
|
|
72
|
+
content: '';
|
|
73
|
+
display: block;
|
|
74
|
+
position: absolute;
|
|
75
|
+
top: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
76
|
+
bottom: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
77
|
+
left: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
78
|
+
right: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
79
|
+
border-radius: calc(#{$tw-sz-btn-medium-height + $tw-sz-btn-stroke * 4} / 2);
|
|
80
|
+
border: $tw-sz-btn-stroke solid $tw-clr-btn-stroke-focus;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
&.button-with-icon {
|
|
84
|
+
padding-left: calc(
|
|
85
|
+
(#{$tw-sz-btn-medium-height} / 2) -
|
|
86
|
+
(((#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}) / 2))
|
|
87
|
+
);
|
|
88
|
+
.tw-icon--medium {
|
|
89
|
+
margin-right: calc((#{$tw-sz-btn-medium-height} - #{$tw-fnt-btn-label-medium-line-height}) / 2);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
&.button-no-label.button-with-icon {
|
|
93
|
+
padding: 8px;
|
|
94
|
+
.tw-icon--medium {
|
|
95
|
+
margin-right: 0;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
&--large {
|
|
101
|
+
height: $tw-sz-btn-large-height;
|
|
102
|
+
font-size: $tw-fnt-btn-label-large-font-size;
|
|
103
|
+
font-weight: $tw-fnt-btn-label-large-font-weight;
|
|
104
|
+
font-family: $tw-fnt-btn-label-large-font-family;
|
|
105
|
+
line-height: $tw-fnt-btn-label-large-line-height;
|
|
106
|
+
min-width: $tw-sz-btn-large-min-width;
|
|
107
|
+
padding: calc((#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}) / 2)
|
|
108
|
+
calc(#{$tw-sz-btn-large-height}/ 2);
|
|
109
|
+
border-radius: calc(#{$tw-sz-btn-large-height} / 2);
|
|
110
|
+
|
|
111
|
+
&:focus {
|
|
112
|
+
&:after {
|
|
113
|
+
content: '';
|
|
114
|
+
display: block;
|
|
115
|
+
position: absolute;
|
|
116
|
+
top: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
117
|
+
bottom: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
118
|
+
left: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
119
|
+
right: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
120
|
+
border-radius: calc(#{$tw-sz-btn-large-height + $tw-sz-btn-stroke * 4} / 2);
|
|
121
|
+
border: $tw-sz-btn-stroke solid $tw-clr-btn-stroke-focus;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
&.button-with-icon {
|
|
125
|
+
padding-left: calc(
|
|
126
|
+
(#{$tw-sz-btn-large-height} / 2) - (((#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}) / 2))
|
|
127
|
+
);
|
|
128
|
+
.tw-icon--large {
|
|
129
|
+
margin-right: calc((#{$tw-sz-btn-large-height} - #{$tw-fnt-btn-label-large-line-height}) / 2);
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
&.button-no-label.button-with-icon {
|
|
133
|
+
padding: 10px;
|
|
134
|
+
.tw-icon--large {
|
|
135
|
+
margin-right: 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
&--xlarge {
|
|
141
|
+
height: $tw-sz-btn-x-large-height;
|
|
142
|
+
font-size: $tw-fnt-btn-label-x-large-font-size;
|
|
143
|
+
font-weight: $tw-fnt-btn-label-x-large-font-weight;
|
|
144
|
+
font-family: $tw-fnt-btn-label-x-large-font-family;
|
|
145
|
+
line-height: $tw-fnt-btn-label-x-large-line-height;
|
|
146
|
+
min-width: $tw-sz-btn-x-large-min-width;
|
|
147
|
+
padding: calc((#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}) / 2)
|
|
148
|
+
calc(#{$tw-sz-btn-x-large-height}/ 2);
|
|
149
|
+
border-radius: calc(#{$tw-sz-btn-x-large-height} / 2);
|
|
150
|
+
|
|
151
|
+
&:focus {
|
|
152
|
+
&:after {
|
|
153
|
+
content: '';
|
|
154
|
+
display: block;
|
|
155
|
+
position: absolute;
|
|
156
|
+
top: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
157
|
+
bottom: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
158
|
+
left: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
159
|
+
right: calc(#{-$tw-sz-btn-stroke} * 2);
|
|
160
|
+
border-radius: calc(#{$tw-sz-btn-x-large-height + $tw-sz-btn-stroke * 4} / 2);
|
|
161
|
+
border: $tw-sz-btn-stroke solid $tw-clr-btn-stroke-focus;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
&.button-with-icon {
|
|
165
|
+
padding-left: calc(
|
|
166
|
+
(#{$tw-sz-btn-x-large-height} / 2) -
|
|
167
|
+
(((#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}) / 2))
|
|
168
|
+
);
|
|
169
|
+
.tw-icon--xlarge {
|
|
170
|
+
margin-right: calc((#{$tw-sz-btn-x-large-height} - #{$tw-fnt-btn-label-x-large-line-height}) / 2);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
&.button-no-label.button-with-icon {
|
|
175
|
+
padding: 12px;
|
|
176
|
+
.tw-icon--xlarge {
|
|
177
|
+
margin-right: 0;
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
&.button-no-label {
|
|
183
|
+
min-width: auto;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.productive-primary {
|
|
188
|
+
background-color: $tw-clr-btn-productive-primary-fill;
|
|
189
|
+
color: $tw-clr-btn-productive-primary-label;
|
|
190
|
+
|
|
191
|
+
svg {
|
|
192
|
+
fill: $tw-clr-btn-productive-primary-label;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
&:hover {
|
|
196
|
+
background: $tw-clr-btn-productive-primary-fill-hover;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
&:active {
|
|
200
|
+
background-color: $tw-clr-btn-productive-primary-fill-active;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
&:disabled {
|
|
204
|
+
background-color: rgba($tw-clr-btn-productive-primary-fill, 0.4);
|
|
205
|
+
color: rgba($tw-clr-btn-productive-primary-label, 0.4);
|
|
206
|
+
svg {
|
|
207
|
+
fill: rgba($tw-clr-btn-productive-primary-label, 0.4);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.productive-secondary {
|
|
213
|
+
background-color: $tw-clr-btn-productive-secondary-fill;
|
|
214
|
+
color: $tw-clr-btn-productive-secondary-label;
|
|
215
|
+
svg {
|
|
216
|
+
fill: $tw-clr-btn-productive-secondary-label;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
border: $tw-sz-btn-stroke solid $tw-clr-btn-productive-secondary-stroke;
|
|
220
|
+
&:hover {
|
|
221
|
+
background: $tw-clr-btn-productive-secondary-fill-hover;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
&:active {
|
|
225
|
+
background-color: $tw-clr-btn-productive-secondary-fill-active;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
&:focus {
|
|
229
|
+
&:after {
|
|
230
|
+
top: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
231
|
+
bottom: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
232
|
+
left: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
233
|
+
right: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
&--small {
|
|
238
|
+
padding: calc(
|
|
239
|
+
(#{$tw-sz-btn-small-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-small-line-height}) / 2
|
|
240
|
+
)
|
|
241
|
+
calc((#{$tw-sz-btn-small-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
&--medium {
|
|
245
|
+
padding: calc(
|
|
246
|
+
(#{$tw-sz-btn-medium-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-medium-line-height}) / 2
|
|
247
|
+
)
|
|
248
|
+
calc((#{$tw-sz-btn-medium-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
&--large {
|
|
252
|
+
padding: calc(
|
|
253
|
+
(#{$tw-sz-btn-large-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-large-line-height}) / 2
|
|
254
|
+
)
|
|
255
|
+
calc((#{$tw-sz-btn-large-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
&--xlarge {
|
|
259
|
+
padding: calc(
|
|
260
|
+
(#{$tw-sz-btn-x-large-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-x-large-line-height}) / 2
|
|
261
|
+
)
|
|
262
|
+
calc((#{$tw-sz-btn-x-large-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
&:disabled {
|
|
266
|
+
background-color: rgba($tw-clr-btn-productive-secondary-fill, 0.4);
|
|
267
|
+
border: $tw-sz-btn-stroke solid rgba($tw-clr-btn-productive-secondary-stroke, 0.4);
|
|
268
|
+
color: rgba($tw-clr-btn-productive-secondary-label, 0.4);
|
|
269
|
+
svg {
|
|
270
|
+
fill: rgba($tw-clr-btn-productive-secondary-label, 0.4);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.passive-primary {
|
|
276
|
+
background-color: $tw-clr-btn-passive-primary-fill;
|
|
277
|
+
color: $tw-clr-btn-passive-primary-label;
|
|
278
|
+
svg {
|
|
279
|
+
fill: $tw-clr-btn-passive-primary-label;
|
|
280
|
+
}
|
|
281
|
+
&:hover {
|
|
282
|
+
background: $tw-clr-btn-passive-primary-fill-hover;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&:active {
|
|
286
|
+
background-color: $tw-clr-btn-passive-primary-fill-active;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
&:disabled {
|
|
290
|
+
background-color: rgba($tw-clr-btn-passive-primary-fill, 0.4);
|
|
291
|
+
color: rgba($tw-clr-btn-passive-primary-label, 0.4);
|
|
292
|
+
svg {
|
|
293
|
+
fill: rgba($tw-clr-btn-passive-primary-label, 0.4);
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.passive-secondary {
|
|
299
|
+
background-color: $tw-clr-btn-passive-secondary-fill;
|
|
300
|
+
color: $tw-clr-btn-passive-secondary-label;
|
|
301
|
+
svg {
|
|
302
|
+
fill: $tw-clr-btn-passive-secondary-label;
|
|
303
|
+
}
|
|
304
|
+
border: $tw-sz-btn-stroke solid $tw-clr-btn-passive-secondary-stroke;
|
|
305
|
+
&:hover {
|
|
306
|
+
background: $tw-clr-btn-passive-secondary-fill-hover;
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
&:active {
|
|
310
|
+
background-color: $tw-clr-btn-passive-secondary-fill-active;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
&:focus {
|
|
314
|
+
&:after {
|
|
315
|
+
top: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
316
|
+
bottom: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
317
|
+
left: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
318
|
+
right: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
&:disabled {
|
|
323
|
+
background-color: rgba($tw-clr-btn-passive-secondary-fill, 0.4);
|
|
324
|
+
border: $tw-sz-btn-stroke solid rgba($tw-clr-btn-passive-secondary-stroke, 0.4);
|
|
325
|
+
color: rgba($tw-clr-btn-passive-secondary-label, 0.4);
|
|
326
|
+
svg {
|
|
327
|
+
fill: rgba($tw-clr-btn-passive-secondary-label, 0.4);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
&--small {
|
|
332
|
+
padding: calc(
|
|
333
|
+
(#{$tw-sz-btn-small-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-small-line-height}) / 2
|
|
334
|
+
)
|
|
335
|
+
calc((#{$tw-sz-btn-small-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
&--medium {
|
|
339
|
+
padding: calc(
|
|
340
|
+
(#{$tw-sz-btn-medium-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-medium-line-height}) / 2
|
|
341
|
+
)
|
|
342
|
+
calc((#{$tw-sz-btn-medium-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
&--large {
|
|
346
|
+
padding: calc(
|
|
347
|
+
(#{$tw-sz-btn-large-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-large-line-height}) / 2
|
|
348
|
+
)
|
|
349
|
+
calc((#{$tw-sz-btn-large-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
&--xlarge {
|
|
353
|
+
padding: calc(
|
|
354
|
+
(#{$tw-sz-btn-x-large-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-x-large-line-height}) / 2
|
|
355
|
+
)
|
|
356
|
+
calc((#{$tw-sz-btn-x-large-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
.destructive-primary {
|
|
361
|
+
background-color: $tw-clr-btn-destructive-primary-fill;
|
|
362
|
+
color: $tw-clr-btn-destructive-primary-label;
|
|
363
|
+
svg {
|
|
364
|
+
fill: $tw-clr-btn-destructive-primary-label;
|
|
365
|
+
}
|
|
366
|
+
&:hover {
|
|
367
|
+
background: $tw-clr-btn-destructive-primary-fill-hover;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
&:active {
|
|
371
|
+
background-color: $tw-clr-btn-destructive-primary-fill-active;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
&:disabled {
|
|
375
|
+
background-color: rgba($tw-clr-btn-destructive-primary-fill, 0.4);
|
|
376
|
+
color: rgba($tw-clr-btn-destructive-primary-label, 0.4);
|
|
377
|
+
svg {
|
|
378
|
+
fill: rgba($tw-clr-btn-destructive-primary-label, 0.4);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
.destructive-secondary {
|
|
384
|
+
background-color: $tw-clr-btn-destructive-secondary-fill;
|
|
385
|
+
color: $tw-clr-btn-destructive-secondary-label;
|
|
386
|
+
svg {
|
|
387
|
+
fill: $tw-clr-btn-destructive-secondary-label;
|
|
388
|
+
}
|
|
389
|
+
border: $tw-sz-btn-stroke solid $tw-clr-btn-destructive-secondary-stroke;
|
|
390
|
+
&:hover {
|
|
391
|
+
background: $tw-clr-btn-destructive-secondary-fill-hover;
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
&:active {
|
|
395
|
+
background-color: $tw-clr-btn-destructive-secondary-fill-active;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
&:disabled {
|
|
399
|
+
background-color: rgba($tw-clr-btn-destructive-secondary-fill, 0.4);
|
|
400
|
+
border: $tw-sz-btn-stroke solid rgba($tw-clr-btn-destructive-secondary-stroke, 0.4);
|
|
401
|
+
color: rgba($tw-clr-btn-destructive-secondary-label, 0.4);
|
|
402
|
+
svg {
|
|
403
|
+
fill: rgba($tw-clr-btn-destructive-secondary-label, 0.4);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
&:focus {
|
|
408
|
+
&:after {
|
|
409
|
+
top: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
410
|
+
bottom: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
411
|
+
left: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
412
|
+
right: calc((#{-$tw-sz-btn-stroke} * 2) + #{-$tw-sz-btn-stroke});
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
&--small {
|
|
417
|
+
padding: calc(
|
|
418
|
+
(#{$tw-sz-btn-small-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-small-line-height}) / 2
|
|
419
|
+
)
|
|
420
|
+
calc((#{$tw-sz-btn-small-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
&--medium {
|
|
424
|
+
padding: calc(
|
|
425
|
+
(#{$tw-sz-btn-medium-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-medium-line-height}) / 2
|
|
426
|
+
)
|
|
427
|
+
calc((#{$tw-sz-btn-medium-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
&--large {
|
|
431
|
+
padding: calc(
|
|
432
|
+
(#{$tw-sz-btn-large-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-large-line-height}) / 2
|
|
433
|
+
)
|
|
434
|
+
calc((#{$tw-sz-btn-large-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
&--xlarge {
|
|
438
|
+
padding: calc(
|
|
439
|
+
(#{$tw-sz-btn-x-large-height} - (2 * #{$tw-sz-btn-stroke}) - #{$tw-fnt-btn-label-x-large-line-height}) / 2
|
|
440
|
+
)
|
|
441
|
+
calc((#{$tw-sz-btn-x-large-height} - 2 * #{$tw-sz-btn-stroke}) / 2);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface Props {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
value?: boolean | null;
|
|
7
|
+
onChange: (id: string, value: boolean) => void;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export default function Checkbox(props: Props): JSX.Element;
|
|
12
|
+
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../src/components/Checkbox.tsx"],"names":[],"mappings":"AACA,OAAO,KAAyB,MAAM,OAAO,CAAC;AAE9C,MAAM,WAAW,KAAK;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,KAAK,CAAC,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC/C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAe1D"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = Checkbox;
|
|
9
|
+
|
|
10
|
+
var _material = require("@mui/material");
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
function Checkbox(props) {
|
|
15
|
+
var _props$value;
|
|
16
|
+
|
|
17
|
+
var onChange = function onChange(event, checked) {
|
|
18
|
+
props.onChange(props.id, checked);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
return /*#__PURE__*/_react.default.createElement(_material.FormControlLabel, {
|
|
22
|
+
id: props.id,
|
|
23
|
+
onChange: onChange,
|
|
24
|
+
label: props.label,
|
|
25
|
+
disabled: props.disabled,
|
|
26
|
+
control: /*#__PURE__*/_react.default.createElement(_material.Checkbox, {
|
|
27
|
+
id: 'check-' + props.id,
|
|
28
|
+
color: "primary",
|
|
29
|
+
checked: (_props$value = props.value) !== null && _props$value !== void 0 ? _props$value : false
|
|
30
|
+
}),
|
|
31
|
+
className: props.className
|
|
32
|
+
});
|
|
33
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import 'moment/min/locales';
|
|
2
|
+
import React, { KeyboardEventHandler } from 'react';
|
|
3
|
+
export interface Props {
|
|
4
|
+
id: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
value?: string | null;
|
|
7
|
+
onChange: (id: string, value?: string | null) => void;
|
|
8
|
+
'aria-label': string;
|
|
9
|
+
onKeyPress?: KeyboardEventHandler;
|
|
10
|
+
maxDate?: string;
|
|
11
|
+
error?: boolean;
|
|
12
|
+
helperText?: string;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
className?: string;
|
|
15
|
+
autocomplete?: string;
|
|
16
|
+
autoOk?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export default function DatePicker(props: Props): JSX.Element;
|
|
19
|
+
//# sourceMappingURL=DatePicker.d.ts.map
|