beyond-system 0.4.12 → 0.5.1
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/components/react/MultiSelect/MultiSelect.d.ts +8 -0
- package/dist/components/react/MultiSelect/MultiSelect.js +56 -0
- package/dist/components/react/MultiSelect/MultiSelect.js.map +1 -0
- package/dist/components/react/MultiSelect/MultiSelect.stories.d.ts +7 -0
- package/dist/components/react/MultiSelect/MultiSelect.stories.js +37 -0
- package/dist/components/react/MultiSelect/MultiSelect.stories.js.map +1 -0
- package/dist/components/react/MultiSelect/index.d.ts +1 -0
- package/dist/components/react/MultiSelect/index.js +9 -0
- package/dist/components/react/MultiSelect/index.js.map +1 -0
- package/dist/components/react/Select/Select.d.ts +1 -1
- package/dist/components/react/Select/Select.js +13 -5
- package/dist/components/react/Select/Select.js.map +1 -1
- package/dist/components/react/Select/Select.stories.d.ts +1 -2
- package/dist/components/react/Select/Select.stories.js +5 -7
- package/dist/components/react/Select/Select.stories.js.map +1 -1
- package/dist/styles/global.css +9 -0
- package/package.json +84 -82
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactSelect from 'react-select';
|
|
3
|
+
type SelectProps = {
|
|
4
|
+
shape?: 'square' | 'rounded' | 'line' | 'none';
|
|
5
|
+
fill?: boolean;
|
|
6
|
+
} & React.ComponentProps<typeof ReactSelect>;
|
|
7
|
+
declare const MultiSelect: (props: SelectProps) => JSX.Element;
|
|
8
|
+
export default MultiSelect;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var tslib_1 = require("tslib");
|
|
4
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
var react_select_1 = tslib_1.__importDefault(require("react-select"));
|
|
6
|
+
var clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
7
|
+
var colors_1 = require("../../../colors");
|
|
8
|
+
var Checkbox_1 = tslib_1.__importDefault(require("../Checkbox"));
|
|
9
|
+
var MultiSelect = function (props) {
|
|
10
|
+
var _a;
|
|
11
|
+
var _b = props.shape, shape = _b === void 0 ? 'none' : _b, _c = props.fill, fill = _c === void 0 ? false : _c, selectProps = tslib_1.__rest(props, ["shape", "fill"]);
|
|
12
|
+
var hasFullBorder = shape === 'square' || shape === 'rounded';
|
|
13
|
+
var hasLineBorder = shape === 'line';
|
|
14
|
+
var borderRadius = shape === 'rounded' ? '20px' : '2px';
|
|
15
|
+
var qttySelected = (_a = selectProps.value) === null || _a === void 0 ? void 0 : _a.length;
|
|
16
|
+
var hasAnySelected = qttySelected > 0;
|
|
17
|
+
var inputText = hasAnySelected
|
|
18
|
+
? "".concat(qttySelected, " selecionado").concat(qttySelected > 1 ? 's' : '')
|
|
19
|
+
: selectProps.placeholder;
|
|
20
|
+
if (!selectProps.hideSelectedOptions) {
|
|
21
|
+
selectProps.placeholder = inputText;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
selectProps.placeholder = selectProps.placeholder || 'Selecione...';
|
|
25
|
+
}
|
|
26
|
+
return (react_1.default.createElement(react_select_1.default, tslib_1.__assign({ isMulti: true, noOptionsMessage: function () { return 'Sem opções'; }, loadingMessage: function () { return 'Carregando...'; }, controlShouldRenderValue: selectProps.hideSelectedOptions, components: {
|
|
27
|
+
Option: function (_a) {
|
|
28
|
+
var children = _a.children, optionProps = tslib_1.__rest(_a, ["children"]);
|
|
29
|
+
return (react_1.default.createElement("div", { className: (0, clsx_1.default)('flex items-center gap-2 p-2 border-b border-neutral-light last:border-none transition text-md', 'hover:bg-neutral-lighter cursor-pointer'), onClick: function () { return optionProps.selectOption(optionProps.data); } },
|
|
30
|
+
react_1.default.createElement(Checkbox_1.default, { checked: optionProps.isSelected }),
|
|
31
|
+
children));
|
|
32
|
+
},
|
|
33
|
+
}, theme: function (theme) { return (tslib_1.__assign(tslib_1.__assign({}, theme), { colors: tslib_1.__assign(tslib_1.__assign({}, theme.colors), { primary: colors_1.COLORS.GROWTH_MID, primary25: colors_1.COLORS.NEUTRAL_LIGHT, primary50: colors_1.COLORS.GROWTH_LIGHT, neutral5: colors_1.COLORS.NEUTRAL_LIGHTER, neutral10: colors_1.COLORS.NEUTRAL_LIGHT, neutral20: colors_1.COLORS.NEUTRAL_MID }) })); }, styles: {
|
|
34
|
+
indicatorSeparator: function () { return ({
|
|
35
|
+
display: 'none',
|
|
36
|
+
}); },
|
|
37
|
+
option: function (provided) { return (tslib_1.__assign(tslib_1.__assign({}, provided), { fontSize: '0.875rem' })); },
|
|
38
|
+
control: function (provided) {
|
|
39
|
+
var controlStyles = tslib_1.__assign(tslib_1.__assign({}, provided), { fontSize: '0.875rem', minHeight: '2rem', backgroundColor: fill ? colors_1.COLORS.NEUTRAL_HIGH : 'transparent', border: hasFullBorder ? "1px solid ".concat(colors_1.COLORS.NEUTRAL_MID) : 'none', borderBottom: hasLineBorder || hasFullBorder
|
|
40
|
+
? "1px solid ".concat(colors_1.COLORS.NEUTRAL_MID)
|
|
41
|
+
: 'none', borderRadius: hasFullBorder ? borderRadius : '0px', '&:hover': {
|
|
42
|
+
border: hasFullBorder
|
|
43
|
+
? "1px solid ".concat(colors_1.COLORS.GROWTH_LIGHT)
|
|
44
|
+
: 'none',
|
|
45
|
+
borderBottom: hasLineBorder || hasFullBorder
|
|
46
|
+
? "1px solid ".concat(colors_1.COLORS.GROWTH_LIGHT)
|
|
47
|
+
: 'none',
|
|
48
|
+
} });
|
|
49
|
+
if (!hasFullBorder)
|
|
50
|
+
controlStyles['boxShadow'] = 'none';
|
|
51
|
+
return controlStyles;
|
|
52
|
+
},
|
|
53
|
+
} }, selectProps)));
|
|
54
|
+
};
|
|
55
|
+
exports.default = MultiSelect;
|
|
56
|
+
//# sourceMappingURL=MultiSelect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSelect.js","sourceRoot":"","sources":["../../../../src/components/react/M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a;wBAC5B,CAAC,CAAC,oBAAa,eAAM,CAAC,WAAW,CAAE;wBACnC,CAAC,CAAC,MAAM,EACZ,YAAY,EAAE,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,EAClD,SAAS,EAAE;wBACT,MAAM,EAAE,aAAa;4BACnB,CAAC,CAAC,oBAAa,eAAM,CAAC,YAAY,CAAE;4BACpC,CAAC,CAAC,MAAM;wBACV,YAAY,EACV,aAAa,IAAI,aAAa;4BAC5B,CAAC,CAAC,oBAAa,eAAM,CAAC,YAAY,CAAE;4BACpC,CAAC,CAAC,MAAM;qBACb,GACF,CAAA;gBAED,IAAI,CAAC,aAAa;oBAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,CAAA;gBAEvD,OAAO,aAAa,CAAA;YACtB,CAAC;SACF,IACG,WAAW,EACf,CACH,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,WAAW,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Meta } from '@storybook/react/types-6-0';
|
|
3
|
+
import SelectComponent from './MultiSelect';
|
|
4
|
+
type Props = React.ComponentProps<typeof SelectComponent>;
|
|
5
|
+
export declare const MultiSelect: (props: Props) => JSX.Element;
|
|
6
|
+
declare const _default: Meta;
|
|
7
|
+
export default _default;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MultiSelect = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
var MultiSelect_1 = tslib_1.__importDefault(require("./MultiSelect"));
|
|
7
|
+
var options = [
|
|
8
|
+
{ value: 'one', label: 'One' },
|
|
9
|
+
{ value: 'two', label: 'Two' },
|
|
10
|
+
{ value: 'three', label: 'Three' },
|
|
11
|
+
];
|
|
12
|
+
var MultiSelect = function (props) {
|
|
13
|
+
var _a = react_1.default.useState([]), value = _a[0], setValue = _a[1];
|
|
14
|
+
return (react_1.default.createElement(MultiSelect_1.default, tslib_1.__assign({}, props, { options: options, isMulti: true, className: "w-96", value: value, onChange: function (v) { return setValue(v); } })));
|
|
15
|
+
};
|
|
16
|
+
exports.MultiSelect = MultiSelect;
|
|
17
|
+
exports.default = {
|
|
18
|
+
title: 'Inputs/MultiSelect',
|
|
19
|
+
args: {
|
|
20
|
+
placeholder: 'Selecione...',
|
|
21
|
+
shape: 'none',
|
|
22
|
+
fill: false,
|
|
23
|
+
isDisabled: false,
|
|
24
|
+
isLoading: false,
|
|
25
|
+
hideSelectedOptions: false,
|
|
26
|
+
},
|
|
27
|
+
argTypes: {
|
|
28
|
+
shape: {
|
|
29
|
+
control: {
|
|
30
|
+
type: 'select',
|
|
31
|
+
options: ['square', 'rounded', 'line', 'none'],
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
onChange: { action: 'changed' },
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=MultiSelect.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MultiSelect.stories.js","sourceRoot":"","sources":["../../../../src/components/react/MultiSelect/MultiSelect.stories.tsx"],"names":[],"mappings":";;;;AAAA,wDAAyB;AAGzB,sEAA2C;AAI3C,IAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC9B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;CACnC,CAAA;AAEM,IAAM,WAAW,GAAG,UAAC,KAAY;IAChC,IAAA,KAAoB,eAAK,CAAC,QAAQ,CAAM,EAAE,CAAC,EAA1C,KAAK,QAAA,EAAE,QAAQ,QAA2B,CAAA;IAEjD,OAAO,CACL,8BAAC,qBAAe,uBACV,KAAK,IACT,OAAO,EAAE,OAAO,EAChB,OAAO,QACP,SAAS,EAAC,MAAM,EAChB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,UAAC,CAAC,IAAK,OAAA,QAAQ,CAAC,CAAC,CAAC,EAAX,CAAW,IAC5B,CACH,CAAA;AACH,CAAC,CAAA;AAbY,QAAA,WAAW,eAavB;AAED,kBAAe;IACb,KAAK,EAAE,oBAAoB;IAC3B,IAAI,EAAE;QACJ,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,KAAK;QAChB,mBAAmB,EAAE,KAAK;KAC3B;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC;aAC/C;SACF;QACD,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KAChC;CACM,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from './MultiSelect';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var MultiSelect_1 = require("./MultiSelect");
|
|
8
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return __importDefault(MultiSelect_1).default; } });
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/react/MultiSelect/index.tsx"],"names":[],"mappings":";;;;;;AAAA,6CAAuC;AAA9B,uHAAA,OAAO,OAAA"}
|
|
@@ -3,6 +3,6 @@ import ReactSelect from 'react-select';
|
|
|
3
3
|
type SelectProps = {
|
|
4
4
|
shape?: 'square' | 'rounded' | 'line' | 'none';
|
|
5
5
|
fill?: boolean;
|
|
6
|
-
} & React.ComponentProps<typeof ReactSelect>;
|
|
6
|
+
} & Omit<React.ComponentProps<typeof ReactSelect>, 'isMulti'>;
|
|
7
7
|
declare const Select: (props: SelectProps) => JSX.Element;
|
|
8
8
|
export default Select;
|
|
@@ -3,20 +3,28 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var tslib_1 = require("tslib");
|
|
4
4
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
5
5
|
var react_select_1 = tslib_1.__importDefault(require("react-select"));
|
|
6
|
+
var clsx_1 = tslib_1.__importDefault(require("clsx"));
|
|
6
7
|
var colors_1 = require("../../../colors");
|
|
7
8
|
var Select = function (props) {
|
|
8
|
-
var _a = props.shape, shape = _a === void 0 ? 'none' : _a, _b = props.fill, fill = _b === void 0 ? false : _b;
|
|
9
|
+
var _a = props.shape, shape = _a === void 0 ? 'none' : _a, _b = props.fill, fill = _b === void 0 ? false : _b, selectProps = tslib_1.__rest(props, ["shape", "fill"]);
|
|
9
10
|
var hasFullBorder = shape === 'square' || shape === 'rounded';
|
|
10
11
|
var hasLineBorder = shape === 'line';
|
|
11
12
|
var borderRadius = shape === 'rounded' ? '20px' : '2px';
|
|
12
|
-
return (react_1.default.createElement(react_select_1.default, tslib_1.__assign({ placeholder:
|
|
13
|
+
return (react_1.default.createElement(react_select_1.default, tslib_1.__assign({ placeholder: selectProps.placeholder || 'Selecione...', noOptionsMessage: function () { return 'Sem opções'; }, loadingMessage: function () { return 'Carregando...'; }, components: {
|
|
14
|
+
Option: function (_a) {
|
|
15
|
+
var children = _a.children, optionProps = tslib_1.__rest(_a, ["children"]);
|
|
16
|
+
return (react_1.default.createElement("div", { className: (0, clsx_1.default)('flex items-center gap-2 p-2 border-b border-neutral-light last:border-none transition text-md', 'hover:bg-neutral-lighter cursor-pointer', {
|
|
17
|
+
'bg-growth-light text-neutral-high': optionProps.isSelected,
|
|
18
|
+
}), onClick: function () { return optionProps.selectOption(optionProps.data); } }, children));
|
|
19
|
+
},
|
|
20
|
+
}, theme: function (theme) { return (tslib_1.__assign(tslib_1.__assign({}, theme), { colors: tslib_1.__assign(tslib_1.__assign({}, theme.colors), { primary: colors_1.COLORS.GROWTH_MID, primary25: colors_1.COLORS.NEUTRAL_LIGHT, primary50: colors_1.COLORS.GROWTH_LIGHT, neutral5: colors_1.COLORS.NEUTRAL_LIGHTER, neutral10: colors_1.COLORS.NEUTRAL_LIGHT, neutral20: colors_1.COLORS.NEUTRAL_MID }) })); }, styles: {
|
|
13
21
|
indicatorSeparator: function () { return ({
|
|
14
22
|
display: 'none',
|
|
15
23
|
}); },
|
|
16
24
|
option: function (provided) { return (tslib_1.__assign(tslib_1.__assign({}, provided), { fontSize: '0.875rem' })); },
|
|
17
25
|
control: function (provided) {
|
|
18
|
-
var controlStyles = tslib_1.__assign(tslib_1.__assign({}, provided), { fontSize: '0.875rem', minHeight: '2rem', backgroundColor: fill ? colors_1.COLORS.NEUTRAL_HIGH : 'transparent', border: hasFullBorder ? "1px solid ".concat(colors_1.COLORS.
|
|
19
|
-
? "1px solid ".concat(colors_1.COLORS.
|
|
26
|
+
var controlStyles = tslib_1.__assign(tslib_1.__assign({}, provided), { fontSize: '0.875rem', minHeight: '2rem', backgroundColor: fill ? colors_1.COLORS.NEUTRAL_HIGH : 'transparent', border: hasFullBorder ? "1px solid ".concat(colors_1.COLORS.NEUTRAL_MID) : 'none', borderBottom: hasLineBorder || hasFullBorder
|
|
27
|
+
? "1px solid ".concat(colors_1.COLORS.NEUTRAL_MID)
|
|
20
28
|
: 'none', borderRadius: hasFullBorder ? borderRadius : '0px', '&:hover': {
|
|
21
29
|
border: hasFullBorder
|
|
22
30
|
? "1px solid ".concat(colors_1.COLORS.GROWTH_LIGHT)
|
|
@@ -29,7 +37,7 @@ var Select = function (props) {
|
|
|
29
37
|
controlStyles['boxShadow'] = 'none';
|
|
30
38
|
return controlStyles;
|
|
31
39
|
},
|
|
32
|
-
} },
|
|
40
|
+
} }, selectProps)));
|
|
33
41
|
};
|
|
34
42
|
exports.default = Select;
|
|
35
43
|
//# sourceMappingURL=Select.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/components/react/Select/Select.tsx"],"names":[],"mappings":";;;AAAA,wDAAyB;AACzB,sEAAsC;
|
|
1
|
+
{"version":3,"file":"Select.js","sourceRoot":"","sources":["../../../../src/components/react/Select/Select.tsx"],"names":[],"mappings":";;;AAAA,wDAAyB;AACzB,sEAAsC;AACtC,sDAAuB;AAEvB,mCAAiC;AAOjC,IAAM,MAAM,GAAG,UAAC,KAAkB;IACxB,IAAA,KAAiD,KAAK,MAAxC,EAAd,KAAK,mBAAG,MAAM,KAAA,EAAE,KAAiC,KAAK,KAA1B,EAAZ,IAAI,mBAAG,KAAK,KAAA,EAAK,WAAW,kBAAK,KAAK,EAAxD,iBAAgD,CAAF,CAAU;IAE9D,IAAM,aAAa,GAAG,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,SAAS,CAAA;IAC/D,IAAM,aAAa,GAAG,KAAK,KAAK,MAAM,CAAA;IAEtC,IAAM,YAAY,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAA;IAEzD,OAAO,CACL,8BAAC,sBAAW,qBACV,WAAW,EAAE,WAAW,CAAC,WAAW,IAAI,cAAc,EACtD,gBAAgB,EAAE,cAAM,OAAA,YAAY,EAAZ,CAAY,EACpC,cAAc,EAAE,cAAM,OAAA,eAAe,EAAf,CAAe,EACrC,UAAU,EAAE;YACV,MAAM,EAAE,UAAC,EAA4B;gBAA1B,IAAA,QAAQ,cAAA,EAAK,WAAW,sBAA1B,YAA4B,CAAF;gBACjC,OAAO,CACL,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AAC,YAAY,CAAC,CAAC,CAAC,KAAK,EAClD,SAAS,EAAE;wBACT,MAAM,EAAE,aAAa;4BACnB,CAAC,CAAC,oBAAa,eAAM,CAAC,YAAY,CAAE;4BACpC,CAAC,CAAC,MAAM;wBACV,YAAY,EACV,aAAa,IAAI,aAAa;4BAC5B,CAAC,CAAC,oBAAa,eAAM,CAAC,YAAY,CAAE;4BACpC,CAAC,CAAC,MAAM;qBACb,GACF,CAAA;gBAED,IAAI,CAAC,aAAa;oBAAE,aAAa,CAAC,WAAW,CAAC,GAAG,MAAM,CAAA;gBAEvD,OAAO,aAAa,CAAA;YACtB,CAAC;SACF,IACG,WAAW,EACf,CACH,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,MAAM,CAAA"}
|
|
@@ -2,7 +2,6 @@ import React from 'react';
|
|
|
2
2
|
import { Meta } from '@storybook/react/types-6-0';
|
|
3
3
|
import SelectComponent from './Select';
|
|
4
4
|
type Props = React.ComponentProps<typeof SelectComponent>;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const MultiSelect: (props: Props) => JSX.Element;
|
|
5
|
+
export declare const Select: (props: Props) => JSX.Element;
|
|
7
6
|
declare const _default: Meta;
|
|
8
7
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Select = void 0;
|
|
4
4
|
var tslib_1 = require("tslib");
|
|
5
5
|
var react_1 = tslib_1.__importDefault(require("react"));
|
|
6
6
|
var Select_1 = tslib_1.__importDefault(require("./Select"));
|
|
@@ -9,21 +9,19 @@ var options = [
|
|
|
9
9
|
{ value: 'two', label: 'Two' },
|
|
10
10
|
{ value: 'three', label: 'Three' },
|
|
11
11
|
];
|
|
12
|
-
var
|
|
12
|
+
var Select = function (props) {
|
|
13
13
|
return react_1.default.createElement(Select_1.default, tslib_1.__assign({}, props, { options: options, className: "w-96" }));
|
|
14
14
|
};
|
|
15
|
-
exports.
|
|
16
|
-
var MultiSelect = function (props) {
|
|
17
|
-
return (react_1.default.createElement(Select_1.default, tslib_1.__assign({}, props, { options: options, isMulti: true, className: "w-96" })));
|
|
18
|
-
};
|
|
19
|
-
exports.MultiSelect = MultiSelect;
|
|
15
|
+
exports.Select = Select;
|
|
20
16
|
exports.default = {
|
|
21
17
|
title: 'Inputs/Select',
|
|
22
18
|
args: {
|
|
19
|
+
placeholder: 'Selecione...',
|
|
23
20
|
shape: 'none',
|
|
24
21
|
fill: false,
|
|
25
22
|
isDisabled: false,
|
|
26
23
|
isLoading: false,
|
|
24
|
+
hideSelectedOptions: false,
|
|
27
25
|
},
|
|
28
26
|
argTypes: {
|
|
29
27
|
shape: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.stories.js","sourceRoot":"","sources":["../../../../src/components/react/Select/Select.stories.tsx"],"names":[],"mappings":";;;;AAAA,wDAAyB;AAGzB,4DAAsC;AAItC,IAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC9B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;CACnC,CAAA;AAEM,IAAM,
|
|
1
|
+
{"version":3,"file":"Select.stories.js","sourceRoot":"","sources":["../../../../src/components/react/Select/Select.stories.tsx"],"names":[],"mappings":";;;;AAAA,wDAAyB;AAGzB,4DAAsC;AAItC,IAAM,OAAO,GAAG;IACd,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC9B,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE;IAC9B,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE;CACnC,CAAA;AAEM,IAAM,MAAM,GAAG,UAAC,KAAY;IACjC,OAAO,8BAAC,gBAAe,uBAAK,KAAK,IAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,IAAG,CAAA;AAC1E,CAAC,CAAA;AAFY,QAAA,MAAM,UAElB;AAED,kBAAe;IACb,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE;QACJ,WAAW,EAAE,cAAc;QAC3B,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,KAAK;QACX,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,KAAK;QAChB,mBAAmB,EAAE,KAAK;KAC3B;IACD,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,OAAO,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC;aAC/C;SACF;QACD,QAAQ,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KAChC;CACM,CAAA"}
|
package/dist/styles/global.css
CHANGED
|
@@ -678,6 +678,11 @@ video {
|
|
|
678
678
|
border-color: rgb(43 176 72 / var(--tw-border-opacity));
|
|
679
679
|
}
|
|
680
680
|
|
|
681
|
+
.bg-growth-light {
|
|
682
|
+
--tw-bg-opacity: 1;
|
|
683
|
+
background-color: rgb(255 154 71 / var(--tw-bg-opacity));
|
|
684
|
+
}
|
|
685
|
+
|
|
681
686
|
.bg-neutral-high {
|
|
682
687
|
--tw-bg-opacity: 1;
|
|
683
688
|
background-color: rgb(255 255 255 / var(--tw-bg-opacity));
|
|
@@ -799,6 +804,10 @@ video {
|
|
|
799
804
|
transition-duration: 150ms;
|
|
800
805
|
}
|
|
801
806
|
|
|
807
|
+
.last\:border-none:last-child {
|
|
808
|
+
border-style: none;
|
|
809
|
+
}
|
|
810
|
+
|
|
802
811
|
.focus-within\:shadow-gm-growth-lighter:focus-within {
|
|
803
812
|
--tw-shadow: 0px 3px #FCE3CF;
|
|
804
813
|
--tw-shadow-colored: 0px 3px var(--tw-shadow-color);
|
package/package.json
CHANGED
|
@@ -1,82 +1,84 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "beyond-system",
|
|
3
|
-
"author": "Growth Machine",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"private": false,
|
|
6
|
-
"main": "./dist/index.js",
|
|
7
|
-
"module": "./dist/index.js",
|
|
8
|
-
"types": "./dist/index.d.ts",
|
|
9
|
-
"license": "MIT",
|
|
10
|
-
"scripts": {
|
|
11
|
-
"dev": "start-storybook -p 6006",
|
|
12
|
-
"build:tailwind": "tailwindcss -i ./src/styles/global.css -o ./dist/styles/global.css",
|
|
13
|
-
"build:module": "tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./src -o ./dist",
|
|
14
|
-
"build": "
|
|
15
|
-
"lint": "eslint .",
|
|
16
|
-
"storybook": "start-storybook -p 6006 -s public",
|
|
17
|
-
"build-storybook": "build-storybook -s public",
|
|
18
|
-
"serve-storybook": "serve storybook-static"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"@radix-ui/react-
|
|
36
|
-
"@radix-ui/react-
|
|
37
|
-
"@radix-ui/react-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"react
|
|
47
|
-
"react-
|
|
48
|
-
"react-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"@
|
|
57
|
-
"@storybook/addon-
|
|
58
|
-
"@storybook/addon-
|
|
59
|
-
"@storybook/addon-
|
|
60
|
-
"@storybook/
|
|
61
|
-
"@storybook/
|
|
62
|
-
"@storybook/
|
|
63
|
-
"@storybook/
|
|
64
|
-
"@
|
|
65
|
-
"@
|
|
66
|
-
"@types/
|
|
67
|
-
"@types/react
|
|
68
|
-
"@types/
|
|
69
|
-
"@
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"eslint
|
|
75
|
-
"eslint-
|
|
76
|
-
"eslint-
|
|
77
|
-
"prettier": "^2.
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "beyond-system",
|
|
3
|
+
"author": "Growth Machine",
|
|
4
|
+
"version": "0.5.1",
|
|
5
|
+
"private": false,
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"dev": "start-storybook -p 6006",
|
|
12
|
+
"build:tailwind": "tailwindcss -i ./src/styles/global.css -o ./dist/styles/global.css",
|
|
13
|
+
"build:module": "tsc --project tsconfig.json && tscpaths -p tsconfig.json -s ./src -o ./dist",
|
|
14
|
+
"build": "yarn run build:tailwind && yarn run build:module",
|
|
15
|
+
"lint": "eslint .",
|
|
16
|
+
"storybook": "start-storybook -p 6006 -s public",
|
|
17
|
+
"build-storybook": "build-storybook -s public",
|
|
18
|
+
"serve-storybook": "serve storybook-static",
|
|
19
|
+
"prepublish": "yarn run build",
|
|
20
|
+
"publish": "npm publish"
|
|
21
|
+
},
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"react": ">=16"
|
|
24
|
+
},
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"LICENSE",
|
|
28
|
+
"README.md"
|
|
29
|
+
],
|
|
30
|
+
"resolutions": {
|
|
31
|
+
"@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.cd77847.0",
|
|
32
|
+
"styled-components": "^5"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@radix-ui/react-checkbox": "^1.0.3",
|
|
36
|
+
"@radix-ui/react-dropdown-menu": "^2.0.4",
|
|
37
|
+
"@radix-ui/react-radio-group": "^1.1.2",
|
|
38
|
+
"@radix-ui/react-slot": "^1.0.1",
|
|
39
|
+
"@radix-ui/react-switch": "^1.0.2",
|
|
40
|
+
"clsx": "^1.2.1",
|
|
41
|
+
"date-fns": "^2.29.3",
|
|
42
|
+
"moment": "^2.29.4",
|
|
43
|
+
"next": "13.2.4",
|
|
44
|
+
"postcss": "^8.4.23",
|
|
45
|
+
"postcss-loader": "^7.1.0",
|
|
46
|
+
"react": "18.2.0",
|
|
47
|
+
"react-date-range": "^1.4.0",
|
|
48
|
+
"react-dom": "18.2.0",
|
|
49
|
+
"react-icons": "^4.8.0",
|
|
50
|
+
"react-select": "^5.7.2",
|
|
51
|
+
"styled-components": "^5.3.9",
|
|
52
|
+
"tailwindcss": "^3.2.7",
|
|
53
|
+
"typescript": "5.0.2"
|
|
54
|
+
},
|
|
55
|
+
"devDependencies": {
|
|
56
|
+
"@babel/core": "^7.21.3",
|
|
57
|
+
"@storybook/addon-actions": "^6.5.16",
|
|
58
|
+
"@storybook/addon-essentials": "^6.5.16",
|
|
59
|
+
"@storybook/addon-interactions": "^6.5.16",
|
|
60
|
+
"@storybook/addon-links": "^6.5.16",
|
|
61
|
+
"@storybook/addon-styling": "^0.3.2",
|
|
62
|
+
"@storybook/builder-webpack5": "^6.5.16",
|
|
63
|
+
"@storybook/manager-webpack5": "^6.5.16",
|
|
64
|
+
"@storybook/react": "^6.5.16",
|
|
65
|
+
"@storybook/testing-library": "^0.0.13",
|
|
66
|
+
"@types/node": "18.15.5",
|
|
67
|
+
"@types/react": "18.0.28",
|
|
68
|
+
"@types/react-date-range": "^1.4.4",
|
|
69
|
+
"@types/react-dom": "18.0.11",
|
|
70
|
+
"@types/styled-components": "^5.1.26",
|
|
71
|
+
"@typescript-eslint/eslint-plugin": "^5.56.0",
|
|
72
|
+
"autoprefixer": "^10.4.14",
|
|
73
|
+
"babel-loader": "^8.3.0",
|
|
74
|
+
"eslint": "8.36.0",
|
|
75
|
+
"eslint-config-next": "13.2.4",
|
|
76
|
+
"eslint-config-prettier": "^8.8.0",
|
|
77
|
+
"eslint-plugin-prettier": "^4.2.1",
|
|
78
|
+
"eslint-plugin-storybook": "^0.6.11",
|
|
79
|
+
"prettier": "^2.8.6",
|
|
80
|
+
"tsconfig-paths": "^4.2.0",
|
|
81
|
+
"tsconfig-paths-webpack-plugin": "^4.0.1",
|
|
82
|
+
"tscpaths": "^0.0.9"
|
|
83
|
+
}
|
|
84
|
+
}
|