@mrshmllw/smores-react 2.19.2 → 3.0.0
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/Accordion/Accordion.d.ts +1 -0
- package/dist/Accordion/Accordion.js +16 -12
- package/dist/Accordion/Accordion.js.map +1 -1
- package/dist/Accordion/Accordion.stories.d.ts +1 -2
- package/dist/Accordion/Accordion.stories.js +2 -8
- package/dist/Accordion/Accordion.stories.js.map +1 -1
- package/dist/Accordion/Collection.d.ts +2 -0
- package/dist/Accordion/Collection.js +52 -0
- package/dist/Accordion/Collection.js.map +1 -0
- package/dist/Accordion/__tests__/Accordion.js +9 -0
- package/dist/Accordion/__tests__/Accordion.js.map +1 -0
- package/dist/ActionDropdown/ActionDropdown.js +7 -7
- package/dist/ActionDropdown/ActionDropdown.js.map +1 -1
- package/dist/ActionDropdown/ActionDropdown.stories.js +1 -1
- package/dist/ActionDropdown/Container.js +16 -10
- package/dist/ActionDropdown/Container.js.map +1 -1
- package/dist/ActionDropdown/List.js +3 -3
- package/dist/ActionDropdown/List.js.map +1 -1
- package/dist/ActionDropdown/__tests__/ActionDropdown.js +3 -3
- package/dist/ActionDropdown/__tests__/ActionDropdown.js.map +1 -1
- package/dist/Banner/Banner.stories.d.ts +9 -0
- package/dist/Banner/Banner.stories.js +86 -0
- package/dist/Banner/Banner.stories.js.map +1 -0
- package/dist/Banner/BannerContainer.d.ts +7 -0
- package/dist/Banner/BannerContainer.js +40 -0
- package/dist/Banner/BannerContainer.js.map +1 -0
- package/dist/Banner/BannerItem.d.ts +7 -0
- package/dist/Banner/BannerItem.js +64 -0
- package/dist/Banner/BannerItem.js.map +1 -0
- package/dist/Banner/hooks.d.ts +3 -0
- package/dist/Banner/hooks.js +6 -0
- package/dist/Banner/hooks.js.map +1 -0
- package/dist/Banner/index.d.ts +2 -0
- package/dist/Banner/index.js +3 -0
- package/dist/Banner/index.js.map +1 -0
- package/dist/Banner/types.d.ts +18 -0
- package/dist/Banner/types.js +2 -0
- package/dist/Banner/types.js.map +1 -0
- package/dist/Box/Box.stories.js +2 -2
- package/dist/Box/Box.stories.js.map +1 -1
- package/dist/BrandCard/BrandCard.d.ts +27 -0
- package/dist/BrandCard/BrandCard.js +60 -0
- package/dist/BrandCard/BrandCard.js.map +1 -0
- package/dist/BrandCard/BrandCard.stories.d.ts +11 -0
- package/dist/BrandCard/BrandCard.stories.js +54 -0
- package/dist/BrandCard/BrandCard.stories.js.map +1 -0
- package/dist/BrandCard/__tests__/BrandCard.js +9 -0
- package/dist/BrandCard/__tests__/BrandCard.js.map +1 -0
- package/dist/BrandCard/index.d.ts +1 -0
- package/dist/BrandCard/index.js +2 -0
- package/dist/BrandCard/index.js.map +1 -0
- package/dist/Button/Button.d.ts +4 -6
- package/dist/Button/Button.js +52 -54
- package/dist/Button/Button.js.map +1 -1
- package/dist/Button/Button.stories.js +1 -1
- package/dist/Button/Collection.d.ts +2 -0
- package/dist/Button/Collection.js +4 -2
- package/dist/Button/Collection.js.map +1 -1
- package/dist/Button/LegacyButton.js +6 -6
- package/dist/Button/LegacyButton.js.map +1 -1
- package/dist/Button/__tests__/Button.js.map +1 -1
- package/dist/Card/Card.d.ts +19 -1
- package/dist/Card/Card.js +42 -10
- package/dist/Card/Card.js.map +1 -1
- package/dist/Card/Card.stories.d.ts +8 -4
- package/dist/Card/Card.stories.js +74 -18
- package/dist/Card/Card.stories.js.map +1 -1
- package/dist/CheckBox/CheckBox.js +39 -16
- package/dist/CheckBox/CheckBox.js.map +1 -1
- package/dist/Chip/Chip.js +15 -9
- package/dist/Chip/Chip.js.map +1 -1
- package/dist/Datepicker/Datepicker.d.ts +3 -0
- package/dist/Datepicker/Datepicker.js +34 -20
- package/dist/Datepicker/Datepicker.js.map +1 -1
- package/dist/Datepicker/DatesList.js +18 -10
- package/dist/Datepicker/DatesList.js.map +1 -1
- package/dist/Divider/Divider.js +1 -1
- package/dist/Divider/Divider.js.map +1 -1
- package/dist/Dropdown/Collection.d.ts +2 -0
- package/dist/Dropdown/Collection.js +91 -0
- package/dist/Dropdown/Collection.js.map +1 -0
- package/dist/Dropdown/Dropdown.d.ts +2 -1
- package/dist/Dropdown/Dropdown.js +24 -30
- package/dist/Dropdown/Dropdown.js.map +1 -1
- package/dist/Dropdown/Dropdown.stories.d.ts +2 -16
- package/dist/Dropdown/Dropdown.stories.js +7 -156
- package/dist/Dropdown/Dropdown.stories.js.map +1 -1
- package/dist/Icon/Icon.js +1 -1
- package/dist/Icon/Icon.stories.js +2 -2
- package/dist/IconStrict/IconStrict.d.ts +20 -0
- package/dist/IconStrict/IconStrict.js +50 -0
- package/dist/IconStrict/IconStrict.js.map +1 -0
- package/dist/IconStrict/IconStrict.stories.d.ts +11 -0
- package/dist/IconStrict/IconStrict.stories.js +33 -0
- package/dist/IconStrict/IconStrict.stories.js.map +1 -0
- package/dist/IconStrict/__tests__/IconStrict.js +9 -0
- package/dist/IconStrict/__tests__/IconStrict.js.map +1 -0
- package/dist/IconStrict/index.d.ts +1 -0
- package/dist/IconStrict/index.js +2 -0
- package/dist/IconStrict/index.js.map +1 -0
- package/dist/IconWrapper/IconWrapper.js +2 -2
- package/dist/IconWrapper/IconWrapper.js.map +1 -1
- package/dist/LabelledText/LabelledText.js +1 -1
- package/dist/LabelledText/LabelledText.js.map +1 -1
- package/dist/Link/Link.d.ts +3 -0
- package/dist/Link/Link.js +10 -13
- package/dist/Link/Link.js.map +1 -1
- package/dist/Link/Link.stories.d.ts +2 -0
- package/dist/Link/Link.stories.js +5 -1
- package/dist/Link/Link.stories.js.map +1 -1
- package/dist/Loader/Loader.js +1 -1
- package/dist/Loader/Loader.js.map +1 -1
- package/dist/Loader/Loader.stories.d.ts +1 -1
- package/dist/Loader/Loader.stories.js +3 -3
- package/dist/Loader/Loader.stories.js.map +1 -1
- package/dist/Loader/__tests__/Loader.js +1 -1
- package/dist/Loader/__tests__/Loader.js.map +1 -1
- package/dist/Modal/Modal.js +6 -23
- package/dist/Modal/Modal.js.map +1 -1
- package/dist/NumberInput/Collection.d.ts +2 -0
- package/dist/NumberInput/Collection.js +97 -0
- package/dist/NumberInput/Collection.js.map +1 -0
- package/dist/NumberInput/NumberInput.d.ts +1 -6
- package/dist/NumberInput/NumberInput.js +13 -89
- package/dist/NumberInput/NumberInput.js.map +1 -1
- package/dist/NumberInput/NumberInput.stories.d.ts +2 -7
- package/dist/NumberInput/NumberInput.stories.js +5 -73
- package/dist/NumberInput/NumberInput.stories.js.map +1 -1
- package/dist/Pagination/Pagination.js +43 -12
- package/dist/Pagination/Pagination.js.map +1 -1
- package/dist/Pagination/Pagination.stories.js +8 -1
- package/dist/Pagination/Pagination.stories.js.map +1 -1
- package/dist/RadioGroup/RadioElement.js +4 -4
- package/dist/RadioGroup/RadioElement.js.map +1 -1
- package/dist/RadioGroup/RadioGroup.d.ts +4 -0
- package/dist/RadioGroup/RadioGroup.js +2 -2
- package/dist/RadioGroup/RadioGroup.js.map +1 -1
- package/dist/RadioGroup/RadioGroup.stories.d.ts +3 -0
- package/dist/RadioGroup/RadioGroup.stories.js +2 -0
- package/dist/RadioGroup/RadioGroup.stories.js.map +1 -1
- package/dist/RadioGroup/RadioItem.d.ts +2 -0
- package/dist/RadioGroup/RadioItem.js +25 -9
- package/dist/RadioGroup/RadioItem.js.map +1 -1
- package/dist/Row/Row.js +14 -8
- package/dist/Row/Row.js.map +1 -1
- package/dist/Row/Row.stories.js +1 -1
- package/dist/SearchInput/Container.js +2 -2
- package/dist/SearchInput/Container.js.map +1 -1
- package/dist/SearchInput/SearchInput.d.ts +0 -2
- package/dist/SearchInput/SearchInput.js +8 -55
- package/dist/SearchInput/SearchInput.js.map +1 -1
- package/dist/SearchInput/SearchInput.stories.d.ts +0 -1
- package/dist/SearchInput/SearchInput.stories.js +0 -5
- package/dist/SearchInput/SearchInput.stories.js.map +1 -1
- package/dist/SearchInput/SearchOptions.d.ts +0 -2
- package/dist/SearchInput/SearchOptions.js +12 -16
- package/dist/SearchInput/SearchOptions.js.map +1 -1
- package/dist/Snackbar/SnackbarContainer.js +1 -1
- package/dist/Snackbar/SnackbarItem.js +5 -5
- package/dist/Snackbar/SnackbarItem.js.map +1 -1
- package/dist/SupportMessage/Collection.js +6 -1
- package/dist/SupportMessage/Collection.js.map +1 -1
- package/dist/SupportMessage/SupportMessage.d.ts +1 -1
- package/dist/SupportMessage/SupportMessage.js +27 -26
- package/dist/SupportMessage/SupportMessage.js.map +1 -1
- package/dist/Tag/Collection.d.ts +2 -0
- package/dist/Tag/Collection.js +77 -0
- package/dist/Tag/Collection.js.map +1 -0
- package/dist/Tag/Tag.d.ts +3 -13
- package/dist/Tag/Tag.js +7 -8
- package/dist/Tag/Tag.js.map +1 -1
- package/dist/Tag/Tag.stories.d.ts +1 -1
- package/dist/Tag/Tag.stories.js +5 -9
- package/dist/Tag/Tag.stories.js.map +1 -1
- package/dist/Tag/__tests__/Tag.js +1 -1
- package/dist/Tag/__tests__/Tag.js.map +1 -1
- package/dist/Text/Text.js +1 -1
- package/dist/Text/Text.stories.js +4 -4
- package/dist/Text/Text.stories.js.map +1 -1
- package/dist/Text/fontMapping.js +1 -1
- package/dist/TextInput/Collection.d.ts +2 -0
- package/dist/TextInput/Collection.js +69 -0
- package/dist/TextInput/Collection.js.map +1 -0
- package/dist/TextInput/TextInput.d.ts +0 -3
- package/dist/TextInput/TextInput.js +7 -60
- package/dist/TextInput/TextInput.js.map +1 -1
- package/dist/TextInput/TextInput.stories.d.ts +2 -10
- package/dist/TextInput/TextInput.stories.js +5 -111
- package/dist/TextInput/TextInput.stories.js.map +1 -1
- package/dist/Textarea/Container.js +1 -1
- package/dist/Textarea/Container.js.map +1 -1
- package/dist/Textarea/Textarea.d.ts +1 -0
- package/dist/Textarea/Textarea.js +10 -16
- package/dist/Textarea/Textarea.js.map +1 -1
- package/dist/Textarea/Textarea.stories.js +2 -0
- package/dist/Textarea/Textarea.stories.js.map +1 -1
- package/dist/Toggle/Toggle.js +19 -13
- package/dist/Toggle/Toggle.js.map +1 -1
- package/dist/Tooltip/Tooltip.d.ts +3 -3
- package/dist/Tooltip/Tooltip.js +16 -13
- package/dist/Tooltip/Tooltip.js.map +1 -1
- package/dist/Tooltip/Tooltip.stories.d.ts +1 -0
- package/dist/Tooltip/Tooltip.stories.js +15 -4
- package/dist/Tooltip/Tooltip.stories.js.map +1 -1
- package/dist/colors.stories.js +37 -11
- package/dist/colors.stories.js.map +1 -1
- package/dist/fields/Field/Field.d.ts +0 -1
- package/dist/fields/Field/Field.js.map +1 -1
- package/dist/fields/Fieldset/Fieldset.js +1 -1
- package/dist/fields/Fieldset/Fieldset.js.map +1 -1
- package/dist/fields/commonFieldTypes.d.ts +4 -3
- package/dist/fields/components/CommonInput.d.ts +18 -0
- package/dist/fields/components/CommonInput.js +64 -0
- package/dist/fields/components/CommonInput.js.map +1 -0
- package/dist/fields/components/InternalField.d.ts +3 -3
- package/dist/fields/components/InternalField.js +7 -7
- package/dist/fields/components/InternalField.js.map +1 -1
- package/dist/fields/components/Placeholder.js +3 -3
- package/dist/fields/components/Placeholder.js.map +1 -1
- package/dist/fontStyle.js +2 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/theme.d.ts +58 -28
- package/dist/theme.js +34 -18
- package/dist/theme.js.map +1 -1
- package/dist/utils/focusOutline.d.ts +1 -0
- package/dist/utils/focusOutline.js +7 -1
- package/dist/utils/focusOutline.js.map +1 -1
- package/package.json +2 -1
- package/dist/ConfirmationRadioButtons/Confirmation.d.ts +0 -17
- package/dist/ConfirmationRadioButtons/Confirmation.js +0 -100
- package/dist/ConfirmationRadioButtons/Confirmation.js.map +0 -1
- package/dist/ConfirmationRadioButtons/Confirmation.stories.d.ts +0 -21
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js +0 -76
- package/dist/ConfirmationRadioButtons/Confirmation.stories.js.map +0 -1
- package/dist/ConfirmationRadioButtons/Container.d.ts +0 -2
- package/dist/ConfirmationRadioButtons/Container.js +0 -8
- package/dist/ConfirmationRadioButtons/Container.js.map +0 -1
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.d.ts +0 -17
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.js +0 -41
- package/dist/ConfirmationRadioButtons/RadioButtonStyled.js.map +0 -1
- package/dist/ConfirmationRadioButtons/__tests__/Confirmation.js +0 -8
- package/dist/ConfirmationRadioButtons/__tests__/Confirmation.js.map +0 -1
- package/dist/ConfirmationRadioButtons/index.d.ts +0 -1
- package/dist/ConfirmationRadioButtons/index.js +0 -2
- package/dist/ConfirmationRadioButtons/index.js.map +0 -1
- package/dist/Message/Message.d.ts +0 -21
- package/dist/Message/Message.js +0 -45
- package/dist/Message/Message.js.map +0 -1
- package/dist/Message/Message.stories.d.ts +0 -13
- package/dist/Message/Message.stories.js +0 -38
- package/dist/Message/Message.stories.js.map +0 -1
- package/dist/Message/__tests__/Message.js +0 -26
- package/dist/Message/__tests__/Message.js.map +0 -1
- package/dist/Message/index.d.ts +0 -1
- package/dist/Message/index.js +0 -2
- package/dist/Message/index.js.map +0 -1
- package/dist/RadioButton/Container.d.ts +0 -2
- package/dist/RadioButton/Container.js +0 -9
- package/dist/RadioButton/Container.js.map +0 -1
- package/dist/RadioButton/RadioButton.d.ts +0 -10
- package/dist/RadioButton/RadioButton.js +0 -68
- package/dist/RadioButton/RadioButton.js.map +0 -1
- package/dist/RadioButton/RadioButton.stories.d.ts +0 -15
- package/dist/RadioButton/RadioButton.stories.js +0 -29
- package/dist/RadioButton/RadioButton.stories.js.map +0 -1
- package/dist/RadioButton/__tests__/RadioButton.js +0 -13
- package/dist/RadioButton/__tests__/RadioButton.js.map +0 -1
- package/dist/RadioButton/index.d.ts +0 -1
- package/dist/RadioButton/index.js +0 -2
- package/dist/RadioButton/index.js.map +0 -1
- /package/dist/{ConfirmationRadioButtons/__tests__/Confirmation.d.ts → Accordion/__tests__/Accordion.d.ts} +0 -0
- /package/dist/{Message/__tests__/Message.d.ts → BrandCard/__tests__/BrandCard.d.ts} +0 -0
- /package/dist/{RadioButton/__tests__/RadioButton.d.ts → IconStrict/__tests__/IconStrict.d.ts} +0 -0
@@ -9,10 +9,8 @@ export interface SearchInputProps extends CommonFieldProps {
|
|
9
9
|
placeholder?: string;
|
10
10
|
searchList: SearchInputItem[];
|
11
11
|
onFound: (element: string) => void;
|
12
|
-
resultsRelativePosition?: boolean;
|
13
12
|
showIcon?: boolean;
|
14
13
|
onBlur?: (e: FocusEvent<HTMLInputElement>) => void;
|
15
|
-
outlined?: boolean;
|
16
14
|
value?: string;
|
17
15
|
}
|
18
16
|
export declare const SearchInput: React.ForwardRefExoticComponent<SearchInputProps & React.RefAttributes<HTMLInputElement>>;
|
@@ -10,16 +10,14 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
10
10
|
return t;
|
11
11
|
};
|
12
12
|
import React, { forwardRef, useMemo, useState, } from 'react';
|
13
|
-
import styled from 'styled-components';
|
14
|
-
import { darken } from 'polished';
|
15
|
-
import { theme } from '../theme';
|
16
|
-
import { Icon } from '../Icon';
|
17
13
|
import { Field } from '../fields/Field';
|
18
14
|
import { useUniqueId } from '../utils/id';
|
19
15
|
import { useControllableState } from '../utils/useControlledState';
|
20
16
|
import { SearchOptions } from './SearchOptions';
|
17
|
+
import { Input, StyledFrontIcon } from '../fields/components/CommonInput';
|
18
|
+
import { Box } from '../Box';
|
21
19
|
export const SearchInput = forwardRef(function SearchInput(_a, ref) {
|
22
|
-
var { id: idProp, name = 'search_input', className = '', placeholder, searchList,
|
20
|
+
var { id: idProp, name = 'search_input', className = '', placeholder, searchList, showIcon = false, renderAsTitle = false, value, onBlur, onFound, fallback } = _a, otherProps = __rest(_a, ["id", "name", "className", "placeholder", "searchList", "showIcon", "renderAsTitle", "value", "onBlur", "onFound", "fallback"]);
|
23
21
|
const id = useUniqueId(idProp);
|
24
22
|
const [showOptions, setShowOptions] = useState(false);
|
25
23
|
const [selectedValue, setSelectedValue] = useControllableState({
|
@@ -63,60 +61,15 @@ export const SearchInput = forwardRef(function SearchInput(_a, ref) {
|
|
63
61
|
setSelectedValue(nextValue.label);
|
64
62
|
onFound(nextValue.value);
|
65
63
|
};
|
66
|
-
return (React.createElement(Field, Object.assign({ className: className, renderAsTitle: renderAsTitle, htmlFor: id
|
67
|
-
React.createElement(
|
68
|
-
showIcon && React.createElement(
|
69
|
-
React.createElement(
|
64
|
+
return (React.createElement(Field, Object.assign({ className: className, renderAsTitle: renderAsTitle, htmlFor: id }, otherProps),
|
65
|
+
React.createElement(Box, { flex: true, alignItems: "center", justifyContent: "flex-start" },
|
66
|
+
showIcon && React.createElement(StyledFrontIcon, { render: "search", color: "sesame" }),
|
67
|
+
React.createElement(Input, { id: id, name: name, ref: ref, placeholder: placeholder, frontIcon: showIcon ? 'present' : '', fallback: fallback, autoComplete: "off", value: displayedInputText, onChange: handleInputChange, selected: isSelected, onBlur: (e) => {
|
70
68
|
if (displayedInputText === '') {
|
71
69
|
setSearchQuery(null);
|
72
70
|
}
|
73
71
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
74
72
|
} })),
|
75
|
-
showOptions && (React.createElement(SearchOptions, { displayedList: filteredList, onSelect: handleSelect
|
73
|
+
showOptions && (React.createElement(SearchOptions, { displayedList: filteredList, onSelect: handleSelect }))));
|
76
74
|
});
|
77
|
-
const StyledInputBox = styled.div `
|
78
|
-
display: flex;
|
79
|
-
align-items: center;
|
80
|
-
border-bottom: ${({ outlined }) => outlined ? 'none' : `1px solid ${theme.colors.outline}`};
|
81
|
-
${({ outlined }) => outlined &&
|
82
|
-
`
|
83
|
-
background-color: ${theme.colors.white};
|
84
|
-
border: 2px solid ${theme.colors.outline};
|
85
|
-
border-radius: 8px;
|
86
|
-
height: auto;
|
87
|
-
`}
|
88
|
-
padding: ${({ showIcon }) => (showIcon ? '14px 10px' : '16px 12px')};
|
89
|
-
|
90
|
-
&:hover,
|
91
|
-
&:focus,
|
92
|
-
&:focus-within {
|
93
|
-
border-color: ${darken(0.1, theme.colors.outline)};
|
94
|
-
}
|
95
|
-
|
96
|
-
${({ selected }) => selected &&
|
97
|
-
`
|
98
|
-
border-color: ${theme.colors.outline};
|
99
|
-
`}
|
100
|
-
color: ${({ outlined }) => outlined ? `${theme.colors.outline}` : `${theme.colors.secondary}`};
|
101
|
-
`;
|
102
|
-
const StyledInput = styled.input `
|
103
|
-
display: block;
|
104
|
-
border: none;
|
105
|
-
outline: none;
|
106
|
-
font-size: 16px;
|
107
|
-
width: 100%;
|
108
|
-
box-sizing: border-box;
|
109
|
-
|
110
|
-
&::placeholder {
|
111
|
-
color: ${theme.colors.subtext};
|
112
|
-
}
|
113
|
-
|
114
|
-
${({ outlined }) => outlined &&
|
115
|
-
`
|
116
|
-
height: auto;
|
117
|
-
`}
|
118
|
-
`;
|
119
|
-
const SearchIcon = styled(Icon) `
|
120
|
-
margin-right: 8px;
|
121
|
-
`;
|
122
75
|
//# sourceMappingURL=SearchInput.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAGZ,UAAU,EACV,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAGZ,UAAU,EACV,OAAO,EACP,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CA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KAAK,IACJ,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,GAAG,EACR,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EACpC,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAC,KAAK,EAClB,KAAK,EAAE,kBAAkB,EACzB,QAAQ,EAAE,iBAAiB,EAC3B,QAAQ,EAAE,UAAU,EACpB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE;oBACZ,IAAI,kBAAkB,KAAK,EAAE,EAAE;wBAC7B,cAAc,CAAC,IAAI,CAAC,CAAA;qBACrB;oBACD,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAG,CAAC,CAAC,CAAA;gBACb,CAAC,GACD,CACE;QAEL,WAAW,IAAI,CACd,oBAAC,aAAa,IAAC,aAAa,EAAE,YAAY,EAAE,QAAQ,EAAE,YAAY,GAAI,CACvE,CACK,CACT,CAAA;AACH,CAAC,CACF,CAAA"}
|
@@ -7,13 +7,8 @@ export default {
|
|
7
7
|
};
|
8
8
|
const Template = (props) => React.createElement(Container, Object.assign({}, props));
|
9
9
|
export const Default = Template.bind({});
|
10
|
-
export const Outlined = Template.bind({});
|
11
|
-
Outlined.args = {
|
12
|
-
outlined: true,
|
13
|
-
};
|
14
10
|
export const ShowIcon = Template.bind({});
|
15
11
|
ShowIcon.args = {
|
16
12
|
showIcon: true,
|
17
|
-
outlined: true,
|
18
13
|
};
|
19
14
|
//# sourceMappingURL=SearchInput.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchInput.stories.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,eAAe;IACb,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,WAAW;CACvB,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAuB,EAAE,EAAE,CAAC,oBAAC,SAAS,oBAAK,KAAK,EAAI,CAAA;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAEzC,QAAQ,CAAC,IAAI,GAAG;IACd,QAAQ,EAAE,IAAI;CACf,CAAA
|
1
|
+
{"version":3,"file":"SearchInput.stories.js","sourceRoot":"","sources":["../../src/SearchInput/SearchInput.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,WAAW,EAAoB,MAAM,eAAe,CAAA;AAC7D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAEvC,eAAe;IACb,KAAK,EAAE,cAAc;IACrB,SAAS,EAAE,WAAW;CACvB,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAuB,EAAE,EAAE,CAAC,oBAAC,SAAS,oBAAK,KAAK,EAAI,CAAA;AAEtE,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,MAAM,CAAC,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAEzC,QAAQ,CAAC,IAAI,GAAG;IACd,QAAQ,EAAE,IAAI;CACf,CAAA"}
|
@@ -2,17 +2,19 @@ import { Box } from '../Box';
|
|
2
2
|
import React from 'react';
|
3
3
|
import styled from 'styled-components';
|
4
4
|
import { theme } from '../theme';
|
5
|
-
|
5
|
+
import { darken } from 'polished';
|
6
|
+
export const SearchOptions = ({ displayedList, onSelect, }) => {
|
6
7
|
return (React.createElement(BoxWithPositionRelative, null,
|
7
|
-
React.createElement(StyledResultsContainer,
|
8
|
-
React.createElement(ResultsList,
|
8
|
+
React.createElement(StyledResultsContainer, null,
|
9
|
+
React.createElement(ResultsList, null, displayedList.length ? (displayedList.map((el, i) => (React.createElement("li", { key: i, onClick: () => onSelect(el) }, el.label)))) : (React.createElement("li", null, "No results"))))));
|
9
10
|
};
|
10
11
|
const StyledResultsContainer = styled.div `
|
11
12
|
box-sizing: border-box;
|
12
13
|
overflow-y: hidden;
|
13
|
-
|
14
|
+
position: absolute;
|
14
15
|
width: 100%;
|
15
|
-
|
16
|
+
left: 0px;
|
17
|
+
top: -8px;
|
16
18
|
|
17
19
|
ul {
|
18
20
|
max-height: 192px;
|
@@ -24,26 +26,20 @@ const ResultsList = styled.ul `
|
|
24
26
|
overflow-y: auto;
|
25
27
|
padding: 0;
|
26
28
|
margin: 0;
|
27
|
-
background-color: ${theme.colors.
|
28
|
-
border:
|
29
|
-
|
30
|
-
border-bottom-right-radius: 8px;
|
29
|
+
background-color: ${theme.colors.custard};
|
30
|
+
border-radius: 12px;
|
31
|
+
margin-top: 14px;
|
31
32
|
z-index: 1000;
|
32
33
|
|
33
|
-
${({ outlined }) => outlined &&
|
34
|
-
`
|
35
|
-
border: 2px solid ${theme.colors.outline};
|
36
|
-
`}
|
37
|
-
|
38
34
|
li {
|
39
35
|
padding: 16px 14px;
|
40
36
|
box-sizing: border-box;
|
41
37
|
font-size: 16px;
|
42
|
-
color: ${theme.colors.
|
38
|
+
color: ${theme.colors.liquorice};
|
43
39
|
cursor: pointer;
|
44
40
|
|
45
41
|
&:hover {
|
46
|
-
background-color: ${theme.colors.
|
42
|
+
background-color: ${darken(0.1, theme.colors.custard)};
|
47
43
|
}
|
48
44
|
}
|
49
45
|
`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SearchOptions.js","sourceRoot":"","sources":["../../src/SearchInput/SearchOptions.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,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ED,MAAM,uBAAuB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE1C,CAAA"}
|
@@ -9,13 +9,13 @@ export const SnackbarItem = ({ autoCloseTime = 4, id, message, leadingIcon, canM
|
|
9
9
|
useTimeout(() => deleteSnack(id), autoCloseTime * 1000);
|
10
10
|
return (React.createElement(SnackItem, { p: "16px", key: id, mt: "16px", flex: true, justifyContent: "space-between" },
|
11
11
|
React.createElement(Box, { flex: true, alignItems: "center" },
|
12
|
-
leadingIcon && (React.createElement(Icon, { mr: "12px", render: leadingIcon, size: 24, color: "
|
13
|
-
React.createElement(Text, { typo: "desc-small", color: "
|
14
|
-
canManuallyClose && (React.createElement(CloseButton, { onClick: () => deleteSnack(id), "aria-label": `close snackbar ${message}` }, showCloseIcon ? (React.createElement(Icon, { render: "cross", size: 16, color: "
|
12
|
+
leadingIcon && (React.createElement(Icon, { mr: "12px", render: leadingIcon, size: 24, color: "mascarpone" })),
|
13
|
+
React.createElement(Text, { typo: "desc-small", color: "mascarpone" }, message)),
|
14
|
+
canManuallyClose && (React.createElement(CloseButton, { onClick: () => deleteSnack(id), "aria-label": `close snackbar ${message}` }, showCloseIcon ? (React.createElement(Icon, { render: "cross", size: 16, color: "mascarpone" })) : (React.createElement(UnderlinedText, { tag: "span", typo: "desc-medium", color: "mascarpone" }, "Dismiss"))))));
|
15
15
|
};
|
16
16
|
const SnackItem = styled(Box) `
|
17
|
-
border-radius:
|
18
|
-
background-color: ${theme.colors.
|
17
|
+
border-radius: 16px;
|
18
|
+
background-color: ${theme.colors.liquorice};
|
19
19
|
`;
|
20
20
|
const CloseButton = styled.button `
|
21
21
|
cursor: pointer;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SnackbarItem.js","sourceRoot":"","sources":["../../src/Snackbar/SnackbarItem.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAA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CAEhC,CAAA;AAED,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;CAElC,CAAA"}
|
@@ -10,7 +10,7 @@ const variationList = [
|
|
10
10
|
description: 'Information needs to be communicated to the user.',
|
11
11
|
},
|
12
12
|
{
|
13
|
-
type: '
|
13
|
+
type: 'fallback',
|
14
14
|
title: 'Additional information',
|
15
15
|
description: 'Information needs to be communicated to the user.',
|
16
16
|
},
|
@@ -24,6 +24,11 @@ const variationList = [
|
|
24
24
|
title: 'Error encountered',
|
25
25
|
description: "An error has occurred, here's feedback on how to proceed.",
|
26
26
|
},
|
27
|
+
{
|
28
|
+
type: 'success',
|
29
|
+
title: 'Error encountered',
|
30
|
+
description: "An error has occurred, here's feedback on how to proceed.",
|
31
|
+
},
|
27
32
|
];
|
28
33
|
export const CollectionPage = () => {
|
29
34
|
return (React.createElement(Box, { flex: true, direction: "column" }, variationList.map(({ type, title, description }) => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../src/SupportMessage/Collection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,cAAc,EAAuB,MAAM,kBAAkB,CAAA;AAEtE,MAAM,aAAa,GAA0B;IAC3C;QACE,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,wBAAwB;QAC/B,WAAW,EAAE,mDAAmD;KACjE;IACD;QACE,IAAI,EAAE,
|
1
|
+
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../src/SupportMessage/Collection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EA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AE,EAAC,KAAK;gBAChB,oBAAC,KAAK,IAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,cAAc,iBAE7B;gBACR,oBAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,GACxB,CACE;YACN,oBAAC,GAAG,IAAC,IAAI,QAAC,EAAE,EAAC,KAAK;gBAChB,oBAAC,KAAK,IAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,cAAc,gBAE7B;gBACR,oBAAC,cAAc,IACb,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,GAChC,CACE,CACF,CACP,CAAA;IACH,CAAC,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,WAAW,GAAG,OAAO,CAAA;AAE3B,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;iBAIT,WAAW;CAC3B,CAAA;AAED,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;WAGf,WAAW;;CAErB,CAAA"}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import { FC, MouseEventHandler, ReactElement } from 'react';
|
2
2
|
import { MarginProps } from '../utils/space';
|
3
|
-
type SupportMessageType = 'info' | '
|
3
|
+
type SupportMessageType = 'info' | 'fallback' | 'alert' | 'warning' | 'success';
|
4
4
|
export type SupportMessageProps = {
|
5
5
|
className?: string;
|
6
6
|
description: string | ReactElement;
|
@@ -11,51 +11,53 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
11
11
|
};
|
12
12
|
import React from 'react';
|
13
13
|
import styled, { css } from 'styled-components';
|
14
|
-
import { darken
|
14
|
+
import { darken } from 'polished';
|
15
15
|
import { Box } from '../Box';
|
16
16
|
import { Icon } from '../Icon';
|
17
17
|
import { Text } from '../Text';
|
18
18
|
import { theme } from '../theme';
|
19
19
|
const styles = {
|
20
20
|
info: {
|
21
|
-
iconColor: '
|
22
|
-
backgroundColor: theme.colors.
|
23
|
-
|
24
|
-
hoverBackgroundColor: darken(0.1, theme.colors.background),
|
21
|
+
iconColor: 'liquorice',
|
22
|
+
backgroundColor: theme.colors.custard,
|
23
|
+
hoverBackgroundColor: darken(0.1, theme.colors.custard),
|
25
24
|
icon: 'info',
|
26
25
|
},
|
27
|
-
|
28
|
-
iconColor: '
|
29
|
-
backgroundColor: theme.colors.
|
30
|
-
|
31
|
-
hoverBackgroundColor: theme.colors.outline,
|
26
|
+
fallback: {
|
27
|
+
iconColor: 'liquorice',
|
28
|
+
backgroundColor: theme.colors.coconut,
|
29
|
+
hoverBackgroundColor: darken(0.1, theme.colors.coconut),
|
32
30
|
icon: 'info',
|
33
31
|
},
|
34
32
|
alert: {
|
35
|
-
iconColor: '
|
36
|
-
backgroundColor: theme.colors.
|
37
|
-
|
38
|
-
hoverBackgroundColor: darken(0.1, theme.colors.bgSecondary),
|
33
|
+
iconColor: 'tangerine',
|
34
|
+
backgroundColor: theme.colors.sherbert,
|
35
|
+
hoverBackgroundColor: darken(0.1, theme.colors.sherbert),
|
39
36
|
icon: 'alert',
|
40
37
|
},
|
41
38
|
warning: {
|
42
|
-
iconColor: '
|
43
|
-
backgroundColor:
|
44
|
-
|
45
|
-
hoverBackgroundColor: lighten(0.35, theme.colors.error),
|
39
|
+
iconColor: 'strawberry',
|
40
|
+
backgroundColor: theme.colors.watermelon,
|
41
|
+
hoverBackgroundColor: darken(0.1, theme.colors.watermelon),
|
46
42
|
icon: 'warning',
|
47
43
|
},
|
44
|
+
success: {
|
45
|
+
iconColor: 'apple',
|
46
|
+
backgroundColor: theme.colors.mint,
|
47
|
+
hoverBackgroundColor: darken(0.1, theme.colors.mint),
|
48
|
+
icon: 'included',
|
49
|
+
},
|
48
50
|
};
|
49
51
|
export const SupportMessage = (_a) => {
|
50
52
|
var { className, description, onClick, type = 'info', title } = _a, marginProps = __rest(_a, ["className", "description", "onClick", "type", "title"]);
|
51
53
|
return (React.createElement(Wrapper, Object.assign({ className: className, type: type, onClick: onClick }, marginProps),
|
52
54
|
React.createElement(IconWrapper, null,
|
53
|
-
React.createElement(Icon, { size:
|
54
|
-
React.createElement(Box, { flex: true, direction: "column", mx: "
|
55
|
+
React.createElement(Icon, { size: 20, render: styles[type].icon, color: styles[type].iconColor })),
|
56
|
+
React.createElement(Box, { flex: true, direction: "column", mx: "8px" },
|
55
57
|
title && React.createElement(Title, null, title),
|
56
58
|
React.createElement(Description, { tag: "p" }, description)),
|
57
59
|
onClick && (React.createElement(Box, { ml: { custom: 'auto' } },
|
58
|
-
React.createElement(Icon, { size: 16, render: "caret", color: "
|
60
|
+
React.createElement(Icon, { size: 16, render: "caret", color: "marzipan", rotate: 270 })))));
|
59
61
|
};
|
60
62
|
const IconWrapper = styled(Box) `
|
61
63
|
align-self: flex-start;
|
@@ -63,10 +65,9 @@ const IconWrapper = styled(Box) `
|
|
63
65
|
const Wrapper = styled(Box)(({ type, onClick }) => css `
|
64
66
|
align-items: center;
|
65
67
|
background-color: ${styles[type].backgroundColor};
|
66
|
-
border:
|
67
|
-
border-radius: 8px;
|
68
|
+
border-radius: 16px;
|
68
69
|
${onClick && `cursor: pointer`};
|
69
|
-
padding:
|
70
|
+
padding: 12px;
|
70
71
|
display: flex;
|
71
72
|
width: 100%;
|
72
73
|
|
@@ -78,12 +79,12 @@ const Wrapper = styled(Box)(({ type, onClick }) => css `
|
|
78
79
|
const Title = styled.p `
|
79
80
|
font-size: 16px;
|
80
81
|
font-weight: ${theme.font.weight.medium};
|
81
|
-
color: ${theme.colors.
|
82
|
+
color: ${theme.colors.liquorice};
|
82
83
|
line-height: 20.8px;
|
83
84
|
margin-bottom: 4px;
|
84
85
|
`;
|
85
86
|
const Description = styled(Text) `
|
86
|
-
color: ${theme.colors.
|
87
|
+
color: ${theme.colors.liquorice};
|
87
88
|
font-size: 14px;
|
88
89
|
line-height: 20px;
|
89
90
|
`;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"SupportMessage.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAClE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,
|
1
|
+
{"version":3,"file":"SupportMessage.js","sourceRoot":"","sources":["../../src/SupportMessage/SupportMessage.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAA8C,MAAM,OAAO,CAAA;AAClE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAEjC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,KAAK,EAAS,MAAM,UAAU,CAAA;AAUvC,MAAM,MAAM,GAA2C;IACrD,IAAI,EAAE;QACJ,SAAS,EAAE,WAAW;QACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;QACrC,oBAAoB,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;QACvD,IAAI,EAAE,MAAM;KACb;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,WAAW;QACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO;QACrC,oBAAoB,EAAE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;QACvD,IAAI,EAAE,MAAM;KACb;IACD,KAAK,EAAE;QACL,SAAS,EAAE,WAAW;QACtB,eAAe,EAAE,KAAK,CAAC,MAAM,CAAC,QAAQ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E,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE;YACzB,oBAAC,IAAI,IAAC,IAAI,EAAE,EAAE,EAAE,MAAM,EAAC,OAAO,EAAC,KAAK,EAAC,UAAU,EAAC,MAAM,EAAE,GAAG,GAAI,CAC3D,CACP,CACO,CACX,CAAA;CAAA,CAAA;AAOD,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;CAE9B,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CACzB,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;;wBAEJ,MAAM,CAAC,IAAI,CAAC,CAAC,eAAe;;MAE9C,OAAO,IAAI,iBAAiB;;;;;;;QAO1B,OAAO,IAAI,qBAAqB,MAAM,CAAC,IAAI,CAAC,CAAC,oBAAoB,GAAG;;GAEzE,CACF,CAAA;AAED,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAA;;iBAEL,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM;WAC9B,KAAK,CAAC,MAAM,CAAC,SAAS;;;CAGhC,CAAA;AAED,MAAM,WAAW,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;WACrB,KAAK,CAAC,MAAM,CAAC,SAAS;;;CAGhC,CAAA"}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import styled from 'styled-components';
|
3
|
+
import { Text } from '../Text';
|
4
|
+
import { Box } from '../Box';
|
5
|
+
import { Tag } from './Tag';
|
6
|
+
const tagList = [
|
7
|
+
{
|
8
|
+
title: 'default',
|
9
|
+
color: 'cream',
|
10
|
+
bgColor: 'feijoa',
|
11
|
+
label: 'default',
|
12
|
+
},
|
13
|
+
{
|
14
|
+
title: 'fallback',
|
15
|
+
color: 'liquorice',
|
16
|
+
bgColor: 'coconut',
|
17
|
+
label: 'default (fallback)',
|
18
|
+
},
|
19
|
+
{
|
20
|
+
title: 'inactive',
|
21
|
+
color: 'cream',
|
22
|
+
bgColor: 'sesame',
|
23
|
+
label: 'disabled',
|
24
|
+
},
|
25
|
+
{
|
26
|
+
title: 'new',
|
27
|
+
color: 'liquorice',
|
28
|
+
bgColor: 'bubblegum',
|
29
|
+
label: 'new',
|
30
|
+
},
|
31
|
+
{
|
32
|
+
title: 'success',
|
33
|
+
color: 'cream',
|
34
|
+
bgColor: 'apple',
|
35
|
+
label: 'included',
|
36
|
+
},
|
37
|
+
{
|
38
|
+
title: 'warning',
|
39
|
+
color: 'liquorice',
|
40
|
+
bgColor: 'lemon',
|
41
|
+
label: 'warning',
|
42
|
+
},
|
43
|
+
{
|
44
|
+
title: 'agentWarning',
|
45
|
+
color: 'liquorice',
|
46
|
+
bgColor: 'tangerine',
|
47
|
+
label: 'agent warning',
|
48
|
+
},
|
49
|
+
{
|
50
|
+
title: 'error',
|
51
|
+
color: 'cream',
|
52
|
+
bgColor: 'strawberry',
|
53
|
+
label: 'error',
|
54
|
+
},
|
55
|
+
];
|
56
|
+
export const CollectionPage = () => {
|
57
|
+
return (React.createElement(Box, null,
|
58
|
+
tagList.slice(0, 3).map((props, index) => (React.createElement(Row, { key: index, label: props.title },
|
59
|
+
React.createElement(Tag, { key: index, color: props.color, bgColor: props.bgColor, label: props.label })))),
|
60
|
+
tagList.slice(3, 6).map((props, index) => (React.createElement(Row, { key: index, label: props.title },
|
61
|
+
React.createElement(Tag, { key: index, color: props.color, bgColor: props.bgColor, label: props.label })))),
|
62
|
+
tagList.slice(6, 9).map((props, index) => (React.createElement(Row, { key: index, label: props.title },
|
63
|
+
React.createElement(Tag, { key: index, color: props.color, bgColor: props.bgColor, label: props.label }))))));
|
64
|
+
};
|
65
|
+
const Row = ({ label, children, }) => {
|
66
|
+
return (React.createElement(RowWrapper, { mb: "16px" },
|
67
|
+
React.createElement(Box, { width: "140px" },
|
68
|
+
React.createElement(Text, { tag: "span", typo: "label-large" }, label)),
|
69
|
+
children));
|
70
|
+
};
|
71
|
+
const RowWrapper = styled(Box) `
|
72
|
+
display: flex;
|
73
|
+
flex-direction: row;
|
74
|
+
align-items: center;
|
75
|
+
gap: 16px;
|
76
|
+
`;
|
77
|
+
//# sourceMappingURL=Collection.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../src/Tag/Collection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAA;AAC5C,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAC5B,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAG3B,MAAM,OAAO,GAKP;IACJ;QACE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,QAAQ;QACjB,KAAK,EAAE,SAAS;KACjB;IACD;QACE,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,SAAS;QAClB,KAAK,EAAE,oBAAoB;KAC5B;IACD;QACE,KAAK,EAAE,UAAU;QACjB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,QAAQ;QACjB,KAAK,EAAE,UAAU;KAClB;IACD;QACE,KAAK,EAAE,KAAK;QACZ,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,KAAK;KACb;IACD;QACE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,OAAO;QACd,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,UAAU;KAClB;IACD;QACE,KAAK,EAAE,SAAS;QAChB,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,SAAS;KACjB;IACD;QACE,KAAK,EAAE,cAAc;QACrB,KAAK,EAAE,WAAW;QAClB,OAAO,EAAE,WAAW;QACpB,KAAK,EAAE,eAAe;KACvB;IACD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AAE,KAAK,CAAC,KAAK,GAClB,CACE,CACP,CAAC,CACE,CACP,CAAA;AACH,CAAC,CAAA;AAED,MAAM,GAAG,GAAgD,CAAC,EACxD,KAAK,EACL,QAAQ,GACT,EAAE,EAAE;IACH,OAAO,CACL,oBAAC,UAAU,IAAC,EAAE,EAAC,MAAM;QACnB,oBAAC,GAAG,IAAC,KAAK,EAAC,OAAO;YAChB,oBAAC,IAAI,IAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,aAAa,IAChC,KAAK,CACD,CACH;QACL,QAAQ,CACE,CACd,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;;CAK7B,CAAA"}
|
package/dist/Tag/Tag.d.ts
CHANGED
@@ -1,21 +1,11 @@
|
|
1
1
|
import { FC } from 'react';
|
2
2
|
import { MarginProps } from '../utils/space';
|
3
3
|
import { Color } from '../theme';
|
4
|
-
export type
|
4
|
+
export type TagProps = {
|
5
5
|
label: string;
|
6
|
-
className?: string;
|
7
6
|
color: Color;
|
8
|
-
typo?: string;
|
9
|
-
} & MarginProps;
|
10
|
-
type GradientProps = {
|
11
7
|
bgColor: Color;
|
12
|
-
borderColor: Color;
|
13
|
-
bgGradient?: boolean;
|
14
|
-
} | {
|
15
|
-
bgColor?: Color;
|
16
8
|
borderColor?: Color;
|
17
|
-
|
18
|
-
};
|
19
|
-
export type TagProps = DefaultProps & GradientProps;
|
9
|
+
className?: string;
|
10
|
+
} & MarginProps;
|
20
11
|
export declare const Tag: FC<TagProps>;
|
21
|
-
export {};
|
package/dist/Tag/Tag.js
CHANGED
@@ -15,20 +15,19 @@ import { Text } from '../Text';
|
|
15
15
|
import { theme } from '../theme';
|
16
16
|
import { Box } from '../Box';
|
17
17
|
export const Tag = (_a) => {
|
18
|
-
var { label, color, borderColor, bgColor, className
|
19
|
-
return (React.createElement(Wrapper, Object.assign({ bgColor: bgColor, className: className, borderColor: borderColor,
|
20
|
-
React.createElement(TagText, { tag: "span", typo:
|
18
|
+
var { label, color, borderColor, bgColor, className } = _a, marginProps = __rest(_a, ["label", "color", "borderColor", "bgColor", "className"]);
|
19
|
+
return (React.createElement(Wrapper, Object.assign({ bgColor: bgColor, className: className, borderColor: borderColor }, marginProps, { flex: true, alignContent: "center", justifyContent: "center" }),
|
20
|
+
React.createElement(TagText, { tag: "span", typo: "label", color: color }, label)));
|
21
21
|
};
|
22
22
|
const Wrapper = styled(Box) `
|
23
23
|
background-color: ${({ bgColor }) => bgColor && theme.colors[bgColor]};
|
24
|
-
background: ${({ bgGradient }) => bgGradient &&
|
25
|
-
`linear-gradient(90deg, rgba(247, 46, 73, 1) 0%, rgba(246, 148, 210, 1) 100%)`};
|
26
|
-
border-radius: 8px;
|
27
24
|
border: ${({ borderColor }) => borderColor && `1px solid ${theme.colors[borderColor]}`};
|
25
|
+
|
26
|
+
border-radius: 6px;
|
27
|
+
padding: 4px 8px;
|
28
|
+
|
28
29
|
box-sizing: border-box;
|
29
30
|
display: inline-flex;
|
30
|
-
height: 23px;
|
31
|
-
padding: 5px 12px;
|
32
31
|
`;
|
33
32
|
const TagText = styled(Text) `
|
34
33
|
font-size: 10px;
|
package/dist/Tag/Tag.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAGtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;
|
1
|
+
{"version":3,"file":"Tag.js","sourceRoot":"","sources":["../../src/Tag/Tag.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAa,MAAM,OAAO,CAAA;AACjC,OAAO,MAAM,MAAM,mBAAmB,CAAA;AAGtC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAC9B,OAAO,EAAS,KAAK,EAAE,MAAM,UAAU,CAAA;AACvC,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAA;AAU5B,MAAM,CAAC,MAAM,GAAG,GAAiB,CAAC,EAOjC,EAAE,EAAE;QAP6B,EAChC,KAAK,EACL,KAAK,EACL,WAAW,EACX,OAAO,EACP,SAAS,OAEV,EADI,WAAW,cANkB,yDAOjC,CADe;IACV,OAAA,CACJ,oBAAC,OAAO,kBACN,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,IACpB,WAAW,IACf,IAAI,QACJ,YAAY,EAAC,QAAQ,EACrB,cAAc,EAAC,QAAQ;QAEvB,oBAAC,OAAO,IAAC,GAAG,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,IAC1C,KAAK,CACE,CACF,CACX,CAAA;CAAA,CAAA;AAID,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,CAAC,CAAc;sBACnB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;YAC3D,CAAC,EAAE,WAAW,EAAE,EAAE,EAAE,CAC5B,WAAW,IAAI,aAAa,KAAK,CAAC,MAAM,CAAC,WAAW,CAAC,EAAE;;;;;;;CAO1D,CAAA;AAED,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,CAAA;;;;;CAK3B,CAAA"}
|
package/dist/Tag/Tag.stories.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Tag } from './Tag';
|
3
|
+
import { CollectionPage } from './Collection';
|
3
4
|
export default {
|
4
5
|
title: 'Tag',
|
5
6
|
component: Tag,
|
@@ -8,19 +9,14 @@ const Template = (props) => React.createElement(Tag, Object.assign({}, props));
|
|
8
9
|
export const Default = Template.bind({});
|
9
10
|
Default.args = {
|
10
11
|
label: 'This is a tag',
|
11
|
-
bgColor: '
|
12
|
-
borderColor: '
|
13
|
-
color: '
|
12
|
+
bgColor: 'feijoa',
|
13
|
+
borderColor: 'feijoa',
|
14
|
+
color: 'cream',
|
14
15
|
};
|
15
16
|
Default.argTypes = {
|
16
17
|
theme: { table: { disable: true } },
|
17
18
|
as: { table: { disable: true } },
|
18
19
|
forwardedAs: { table: { disable: true } },
|
19
20
|
};
|
20
|
-
export const
|
21
|
-
BgGradient.args = {
|
22
|
-
label: 'This is a gradient background tag',
|
23
|
-
bgGradient: true,
|
24
|
-
color: 'white',
|
25
|
-
};
|
21
|
+
export const Collection = CollectionPage.bind({});
|
26
22
|
//# sourceMappingURL=Tag.stories.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Tag.stories.js","sourceRoot":"","sources":["../../src/Tag/Tag.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAY,MAAM,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"Tag.stories.js","sourceRoot":"","sources":["../../src/Tag/Tag.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAY,MAAM,OAAO,CAAA;AACrC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAE7C,eAAe;IACb,KAAK,EAAE,KAAK;IACZ,SAAS,EAAE,GAAG;CACf,CAAA;AAED,MAAM,QAAQ,GAAG,CAAC,KAAe,EAAE,EAAE,CAAC,oBAAC,GAAG,oBAAK,KAAK,EAAI,CAAA;AAExD,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;AAExC,OAAO,CAAC,IAAI,GAAG;IACb,KAAK,EAAE,eAAe;IACtB,OAAO,EAAE,QAAQ;IACjB,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,OAAO;CACf,CAAA;AAED,OAAO,CAAC,QAAQ,GAAG;IACjB,KAAK,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IACnC,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;IAChC,WAAW,EAAE,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE;CAC1C,CAAA;AAED,MAAM,CAAC,MAAM,UAAU,GAAG,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA"}
|