w-design-system 0.0.37 → 0.0.38

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.
Files changed (29) hide show
  1. package/dist/components/Select/index.d.ts.map +1 -1
  2. package/dist/components/Select/index.js +46 -8
  3. package/dist/components/Select/index.js.map +1 -1
  4. package/package.json +1 -1
  5. package/src/components/Select/index.tsx +49 -8
  6. package/dist/components/DateInput/index.d.ts +0 -17
  7. package/dist/components/DateInput/index.d.ts.map +0 -1
  8. package/dist/components/DateInput/index.js +0 -22
  9. package/dist/components/DateInput/index.js.map +0 -1
  10. package/dist/components/DateInput/stories.d.ts +0 -8
  11. package/dist/components/DateInput/stories.d.ts.map +0 -1
  12. package/dist/components/DateInput/stories.js +0 -51
  13. package/dist/components/DateInput/stories.js.map +0 -1
  14. package/dist/components/DateInput/styles.d.ts +0 -21
  15. package/dist/components/DateInput/styles.d.ts.map +0 -1
  16. package/dist/components/DateInput/styles.js +0 -120
  17. package/dist/components/DateInput/styles.js.map +0 -1
  18. package/dist/components/RangeDateInput/index.d.ts +0 -25
  19. package/dist/components/RangeDateInput/index.d.ts.map +0 -1
  20. package/dist/components/RangeDateInput/index.js +0 -175
  21. package/dist/components/RangeDateInput/index.js.map +0 -1
  22. package/dist/components/RangeDateInput/stories.d.ts +0 -8
  23. package/dist/components/RangeDateInput/stories.d.ts.map +0 -1
  24. package/dist/components/RangeDateInput/stories.js +0 -60
  25. package/dist/components/RangeDateInput/stories.js.map +0 -1
  26. package/dist/components/RangeDateInput/styles.d.ts +0 -21
  27. package/dist/components/RangeDateInput/styles.d.ts.map +0 -1
  28. package/dist/components/RangeDateInput/styles.js +0 -126
  29. package/dist/components/RangeDateInput/styles.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,cAAc,EACd,iBAAiB,EACjB,SAAS,EA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S,CAAC,CAAA;CAAE,KAC/E,KAAK,CAAC,YAAY,CAAA"}
@@ -19,6 +19,8 @@ const SelectFowardRef = (_a, ref) => {
19
19
  var _b;
20
20
  var { children, label, leftIcon, onOptionChange, options, placeholder, rightIcon, selectedOption, value, dropDownWidth, disabled } = _a, props = __rest(_a, ["children", "label", "leftIcon", "onOptionChange", "options", "placeholder", "rightIcon", "selectedOption", "value", "dropDownWidth", "disabled"]);
21
21
  const [open, setOpen] = useState(false);
22
+ const [usingInput, setUsingInput] = useState(false);
23
+ const [computedValue, setComputedValue] = useState(value);
22
24
  const wrapperRef = useRef(null);
23
25
  useImperativeHandle(ref, () => ({
24
26
  setOpen,
@@ -46,21 +48,57 @@ const SelectFowardRef = (_a, ref) => {
46
48
  onOptionChange && onOptionChange(option);
47
49
  setOpen(false);
48
50
  };
49
- const valueComputed = useMemo(() => {
50
- if (value)
51
- return value;
52
- if (selectedOption) {
53
- return selectedOption.text;
51
+ useEffect(() => {
52
+ if (value) {
53
+ setComputedValue(value);
54
+ }
55
+ else if (selectedOption) {
56
+ setComputedValue(selectedOption.text);
57
+ }
58
+ else {
59
+ setComputedValue('');
54
60
  }
55
- return '';
61
+ setUsingInput(false);
56
62
  }, [value, selectedOption]);
63
+ useEffect(() => {
64
+ if (!open)
65
+ setUsingInput(false);
66
+ }, [open]);
67
+ const onInputChange = (event) => {
68
+ setComputedValue(event.target.value);
69
+ setUsingInput(true);
70
+ };
71
+ const filteredOptions = useMemo(() => {
72
+ if (!options)
73
+ return [];
74
+ if (!usingInput)
75
+ return options;
76
+ const normalizedValue = (computedValue || '')
77
+ .trim()
78
+ .toLowerCase()
79
+ .normalize('NFD')
80
+ .replace(/[\u0300-\u036f]/g, '');
81
+ if (!normalizedValue)
82
+ return options;
83
+ const items = [];
84
+ for (const option of options) {
85
+ if (option.text
86
+ .toLowerCase()
87
+ .normalize('NFD')
88
+ .replace(/[\u0300-\u036f]/g, '')
89
+ .includes(normalizedValue)) {
90
+ items.push(option);
91
+ }
92
+ }
93
+ return items;
94
+ }, [options, usingInput, computedValue]);
57
95
  return (React.createElement(SelectWrapper, Object.assign({}, props, { ref: wrapperRef }),
58
96
  React.createElement(Input, { disabled: disabled, leftIcon: leftIcon, rightIcon: React.createElement(React.Fragment, null,
59
97
  rightIcon,
60
- React.createElement(IconWrapper, { className: `icon ${open ? 'icon-rotate' : ''}`, src: chevronDownSVG, width: "16px", color: theme.colors.shade30 })), placeholder: placeholder, label: label, value: valueComputed, readonly: true, onClick: () => !disabled && setOpen(!open) }),
98
+ React.createElement(IconWrapper, { className: `icon ${open ? 'icon-rotate' : ''}`, src: chevronDownSVG, width: "16px", color: theme.colors.shade30 })), placeholder: placeholder, label: label, value: computedValue, readonly: !open, onChange: onInputChange, onClick: () => !disabled && setOpen(!open) }),
61
99
  open && (React.createElement(DropdownWrapper, null,
62
100
  React.createElement(Dropdown, { dropDownTop: props.dropDownTop, dropDownWidth: dropDownWidth },
63
- ((_b = options === null || options === void 0 ? void 0 : options.length) !== null && _b !== void 0 ? _b : 0) > 0 && (React.createElement("div", null, options === null || options === void 0 ? void 0 : options.map(option => (React.createElement(OptionButton, { selected: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) === option.id, key: option.id, onClick: () => onOptionClick(option) },
101
+ ((_b = options === null || options === void 0 ? void 0 : options.length) !== null && _b !== void 0 ? _b : 0) > 0 && (React.createElement("div", null, filteredOptions.map(option => (React.createElement(OptionButton, { selected: (selectedOption === null || selectedOption === void 0 ? void 0 : selectedOption.id) === option.id, key: option.id, onClick: () => onOptionClick(option) },
64
102
  option.icon,
65
103
  React.createElement(OptionText, null, option.text)))))),
66
104
  children)))));
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/Select/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAIZ,SAAS,EACT,mBAAmB,EACnB,OAAO,EACP,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAA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AAC,GAAG,CAAC,IAAI,CAC7B,iCACG,eAAe,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAC7B,oBAAC,YAAY,IACX,QAAQ,EAAE,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,EAAE,MAAK,MAAM,CAAC,EAAE,EAC1C,GAAG,EAAE,MAAM,CAAC,EAAE,EACd,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,CAAC,MAAM,CAAC;oBAEnC,MAAM,CAAC,IAAI;oBACZ,oBAAC,UAAU,QAAE,MAAM,CAAC,IAAI,CAAc,CACzB,CAChB,CAAC,CACE,CACP;gBACA,QAAQ,CACA,CACK,CACnB,CACa,CACjB,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,KAAK,CAAC,UAAU,CAAC,eAAe,CAE/B,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "w-design-system",
3
- "version": "0.0.37",
3
+ "version": "0.0.38",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "dependencies": {
@@ -52,6 +52,8 @@ const SelectFowardRef = <T extends { text: string; id: number; icon?: ReactNode
52
52
  ref: React.ForwardedRef<SelectRef>,
53
53
  ) => {
54
54
  const [open, setOpen] = useState(false)
55
+ const [usingInput, setUsingInput] = useState(false)
56
+ const [computedValue, setComputedValue] = useState(value)
55
57
  const wrapperRef = useRef<HTMLDivElement>(null)
56
58
 
57
59
  useImperativeHandle(ref, () => ({
@@ -82,14 +84,52 @@ const SelectFowardRef = <T extends { text: string; id: number; icon?: ReactNode
82
84
  setOpen(false)
83
85
  }
84
86
 
85
- const valueComputed = useMemo(() => {
86
- if (value) return value
87
- if (selectedOption) {
88
- return selectedOption.text
87
+ useEffect(() => {
88
+ if (value) {
89
+ setComputedValue(value)
90
+ } else if (selectedOption) {
91
+ setComputedValue(selectedOption.text)
92
+ } else {
93
+ setComputedValue('')
89
94
  }
90
- return ''
95
+ setUsingInput(false)
91
96
  }, [value, selectedOption])
92
97
 
98
+ useEffect(() => {
99
+ if (!open) setUsingInput(false)
100
+ }, [open])
101
+
102
+ const onInputChange = (event: React.ChangeEvent<HTMLInputElement>) => {
103
+ setComputedValue(event.target.value)
104
+ setUsingInput(true)
105
+ }
106
+
107
+ const filteredOptions: T[] = useMemo((): T[] => {
108
+ if (!options) return []
109
+ if (!usingInput) return options
110
+
111
+ const normalizedValue = (computedValue || '')
112
+ .trim()
113
+ .toLowerCase()
114
+ .normalize('NFD')
115
+ .replace(/[\u0300-\u036f]/g, '')
116
+ if (!normalizedValue) return options
117
+
118
+ const items: T[] = []
119
+ for (const option of options) {
120
+ if (
121
+ option.text
122
+ .toLowerCase()
123
+ .normalize('NFD')
124
+ .replace(/[\u0300-\u036f]/g, '')
125
+ .includes(normalizedValue)
126
+ ) {
127
+ items.push(option)
128
+ }
129
+ }
130
+ return items
131
+ }, [options, usingInput, computedValue])
132
+
93
133
  return (
94
134
  <SelectWrapper {...props} ref={wrapperRef}>
95
135
  <Input
@@ -108,8 +148,9 @@ const SelectFowardRef = <T extends { text: string; id: number; icon?: ReactNode
108
148
  }
109
149
  placeholder={placeholder}
110
150
  label={label}
111
- value={valueComputed}
112
- readonly
151
+ value={computedValue}
152
+ readonly={!open}
153
+ onChange={onInputChange}
113
154
  onClick={() => !disabled && setOpen(!open)}
114
155
  />
115
156
  {open && (
@@ -117,7 +158,7 @@ const SelectFowardRef = <T extends { text: string; id: number; icon?: ReactNode
117
158
  <Dropdown dropDownTop={props.dropDownTop} dropDownWidth={dropDownWidth}>
118
159
  {(options?.length ?? 0) > 0 && (
119
160
  <div>
120
- {options?.map(option => (
161
+ {filteredOptions.map(option => (
121
162
  <OptionButton
122
163
  selected={selectedOption?.id === option.id}
123
164
  key={option.id}
@@ -1,17 +0,0 @@
1
- import React, { HTMLAttributes } from 'react';
2
- export interface DateInputProps extends HTMLAttributes<HTMLDivElement> {
3
- placeholder?: string;
4
- label: string;
5
- defaultOptions?: {
6
- text: string;
7
- id: number;
8
- }[];
9
- selectedOption?: number | null;
10
- readonly?: boolean;
11
- disabled?: boolean;
12
- onSelectedOptionChange?: (option: number | null) => void;
13
- customDate: Date | null;
14
- onSelectedCustomDate?: (date: Date | null) => void;
15
- }
16
- export declare const DateInput: React.FC<DateInputProps>;
17
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAAE,MAAM,OAAO,CAAA;AAG7C,MAAM,WAAW,cAAe,SAAQ,cAAc,CAAC,cAAc,CAAC;IACpE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC/C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACxD,UAAU,EAAE,IAAI,GAAG,IAAI,CAAA;IACvB,oBAAoB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAA;CACnD;AAED,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAa9C,CAAA"}
@@ -1,22 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React from 'react';
13
- import { RangeDateInput } from '../RangeDateInput';
14
- export const DateInput = (_a) => {
15
- var { onSelectedCustomDate, customDate } = _a, props = __rest(_a, ["onSelectedCustomDate", "customDate"]);
16
- const onRangeSelected = (start) => {
17
- if (onSelectedCustomDate)
18
- onSelectedCustomDate(start);
19
- };
20
- return (React.createElement(RangeDateInput, Object.assign({}, props, { isRange: false, onSelectedCustomRange: onRangeSelected, startCustomDate: customDate, endCustomDate: customDate })));
21
- };
22
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/DateInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAyB,MAAM,OAAO,CAAA;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAclD,MAAM,CAAC,MAAM,SAAS,GAA6B,CAAC,EAA8C,EAAE,EAAE;QAAlD,EAAE,oBAAoB,EAAE,UAAU,OAAY,EAAP,KAAK,cAA5C,sCAA8C,CAAF;IAC9F,MAAM,eAAe,GAAG,CAAC,KAAkB,EAAE,EAAE;QAC7C,IAAI,oBAAoB;YAAE,oBAAoB,CAAC,KAAK,CAAC,CAAA;IACvD,CAAC,CAAA;IACD,OAAO,CACL,oBAAC,cAAc,oBACT,KAAK,IACT,OAAO,EAAE,KAAK,EACd,qBAAqB,EAAE,eAAe,EACtC,eAAe,EAAE,UAAU,EAC3B,aAAa,EAAE,UAAU,IACzB,CACH,CAAA;AACH,CAAC,CAAA"}
@@ -1,8 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { DateInput } from './index';
3
- declare const meta: Meta<typeof DateInput>;
4
- export default meta;
5
- type Story = StoryObj<typeof DateInput>;
6
- export declare const SelecionarDataDeDatas: Story;
7
- export declare const SelecionarDatasSimples: Story;
8
- //# sourceMappingURL=stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stories.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGnC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAUC,CAAA;AAElC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAA;AAgCvC,eAAO,MAAM,qBAAqB,EAAE,KAEnC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,KAEpC,CAAA"}
@@ -1,51 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { DateInput } from './index';
13
- import React from 'react';
14
- const meta = {
15
- title: 'Components/DateInput',
16
- component: DateInput,
17
- tags: ['autodocs'],
18
- argTypes: {
19
- placeholder: { control: 'text' },
20
- label: { control: 'text' },
21
- readonly: { control: 'boolean' },
22
- disabled: { control: 'boolean' },
23
- },
24
- };
25
- export default meta;
26
- const ComponentWrapper = (_a) => {
27
- var { defaultOptions } = _a, args = __rest(_a, ["defaultOptions"]);
28
- const [selectedOption, setSelectOption] = React.useState(null);
29
- const [customDate, setCustomDate] = React.useState(null);
30
- return (React.createElement(DateInput, Object.assign({ selectedOption: selectedOption, customDate: customDate, onSelectedOptionChange: option => setSelectOption(option), onSelectedCustomDate: date => setCustomDate(date), defaultOptions: defaultOptions !== null && defaultOptions !== void 0 ? defaultOptions : [
31
- {
32
- text: 'Ontem',
33
- id: -1,
34
- },
35
- {
36
- text: 'Hoje',
37
- id: 0,
38
- },
39
- {
40
- text: 'Amanhã',
41
- id: 1,
42
- },
43
- ] }, args)));
44
- };
45
- export const SelecionarDataDeDatas = {
46
- render: args => React.createElement(ComponentWrapper, { label: "Data da Disputa", placeholder: "Placeholder" }),
47
- };
48
- export const SelecionarDatasSimples = {
49
- render: args => React.createElement(ComponentWrapper, { defaultOptions: [] }),
50
- };
51
- //# sourceMappingURL=stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/DateInput/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AACnC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,IAAI,GAA2B;IACnC,KAAK,EAAE,sBAAsB;IAC7B,SAAS,EAAE,SAAS;IACpB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAChC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1B,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;QAChC,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;KACjC;CAC+B,CAAA;AAElC,eAAe,IAAI,CAAA;AAGnB,MAAM,gBAAgB,GAAG,CAAC,EAAgC,EAAE,EAAE;QAApC,EAAE,cAAc,OAAgB,EAAX,IAAI,cAAzB,kBAA2B,CAAF;IACjD,MAAM,CAAC,cAAc,EAAE,eAAe,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAgB,IAAI,CAAC,CAAA;IAC7E,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAc,IAAI,CAAC,CAAA;IACrE,OAAO,CACL,oBAAC,SAAS,kBACR,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,MAAM,CAAC,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,EACzD,oBAAoB,EAAE,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,EACjD,cAAc,EACZ,cAAc,aAAd,cAAc,cAAd,cAAc,GAAI;YAChB;gBACE,IAAI,EAAE,OAAO;gBACb,EAAE,EAAE,CAAC,CAAC;aACP;YACD;gBACE,IAAI,EAAE,MAAM;gBACZ,EAAE,EAAE,CAAC;aACN;YACD;gBACE,IAAI,EAAE,QAAQ;gBACd,EAAE,EAAE,CAAC;aACN;SACF,IAEC,IAAI,EACR,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,qBAAqB,GAAU;IAC1C,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,oBAAC,gBAAgB,IAAC,KAAK,EAAC,iBAAiB,EAAC,WAAW,EAAC,aAAa,GAAG;CACvF,CAAA;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAU;IAC3C,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,oBAAC,gBAAgB,IAAC,cAAc,EAAE,EAAE,GAAI;CACzD,CAAA"}
@@ -1,21 +0,0 @@
1
- export declare const InputDateWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
- export declare const Dropdown: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const DropdownWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
- export declare const CalendarGrid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
- export declare const CalendarWeekDayLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
6
- export interface DefaultOptionButtonProps {
7
- selected: boolean;
8
- }
9
- export declare const DefaultOptionButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, DefaultOptionButtonProps>> & string;
10
- export declare const CalendarHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
11
- export interface CalendarDayProps {
12
- today: boolean;
13
- }
14
- export declare const CalendarDay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, CalendarDayProps>> & string;
15
- export interface CalendarDaySelectedBackgroundProps {
16
- today: boolean;
17
- selected: boolean;
18
- }
19
- export declare const CalendarDaySelectedBackground: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, CalendarDaySelectedBackgroundProps>> & string;
20
- export declare const CalendarDayValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/DateInput/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,6NAQ5B,CAAA;AAED,eAAO,MAAM,QAAQ,6NASpB,CAAA;AAED,eAAO,MAAM,eAAe,6NAE3B,CAAA;AAED,eAAO,MAAM,YAAY,6NAYxB,CAAA;AAED,eAAO,MAAM,oBAAoB,6NAKhC,CAAA;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,mBAAmB,yQAqB/B,CAAA;AAED,eAAO,MAAM,cAAc,6NAyB1B,CAAA;AACD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAA;CACf;AAED,eAAO,MAAM,WAAW,qPAMvB,CAAA;AAED,MAAM,WAAW,kCAAkC;IACjD,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,OAAO,CAAA;CAClB;AACD,eAAO,MAAM,6BAA6B,uQAazC,CAAA;AACD,eAAO,MAAM,gBAAgB,6NAM5B,CAAA"}
@@ -1,120 +0,0 @@
1
- import styled from 'styled-components';
2
- import { theme } from '../Themes';
3
- export const InputDateWrapper = styled.div `
4
- position: relative;
5
- .icon {
6
- transition: transform 0.3s;
7
- }
8
- .icon-rotate {
9
- transform: rotate(180deg) translateY(5px);
10
- }
11
- `;
12
- export const Dropdown = styled.div `
13
- position: absolute;
14
- width: 252px;
15
- padding: 16px;
16
- z-index: 1;
17
- border-radius: 4px;
18
- border: 1px solid ${theme.colors.shade20};
19
- margin-top: 7px;
20
- box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
21
- `;
22
- export const DropdownWrapper = styled.div `
23
- position: relative;
24
- `;
25
- export const CalendarGrid = styled.div `
26
- display: grid;
27
- font-family: 'Nunito Sans', sans-serif;
28
- grid-template-columns: repeat(7, 36px);
29
- align-items: center;
30
- justify-items: center;
31
- grid-column-gap: 0px;
32
- grid-row-gap: 0px;
33
- height: 100%;
34
- width: 100%;
35
- font-size: ${theme.paragraph.small};
36
- color: ${theme.colors.shade50};
37
- `;
38
- export const CalendarWeekDayLabel = styled.div `
39
- font-size: ${theme.paragraph['xx-small']};
40
- color: ${theme.colors.shade30};
41
- font-weight: 600;
42
- margin-bottom: 4px;
43
- `;
44
- export const DefaultOptionButton = styled.button `
45
- background-color: transparent;
46
- border: none;
47
- font-size: ${theme.paragraph.medium};
48
- font-family: 'Nunito Sans', sans-serif;
49
- color: ${({ selected }) => (selected ? theme.colors.cyan30 : theme.colors.shade40)};
50
- cursor: pointer;
51
- padding: 0;
52
- width: 100%;
53
- text-align: left;
54
- height: 46px;
55
- display: flex;
56
- align-items: center;
57
-
58
- &:not(:last-child) {
59
- border-bottom: 1px solid ${theme.colors.shade10};
60
- }
61
-
62
- &:hover {
63
- color: ${theme.colors.cyan30};
64
- }
65
- `;
66
- export const CalendarHeader = styled.div `
67
- display: flex;
68
- justify-content: space-between;
69
- align-items: center;
70
- font-size: ${theme.paragraph.small};
71
- font-family: 'Nunito Sans', sans-serif;
72
- font-weight: 600;
73
-
74
- .icon,
75
- .icon svg,
76
- .icon svg path {
77
- fill: ${theme.colors.shade50} !important;
78
- }
79
-
80
- .icon:hover,
81
- .icon:hover svg,
82
- .icon:hover svg path {
83
- fill: ${theme.colors.cyan30} !important;
84
- }
85
-
86
- .icon-disabled,
87
- .icon-disabled svg,
88
- .icon-disabled svg path {
89
- fill: ${theme.colors.shade20} !important;
90
- }
91
- `;
92
- export const CalendarDay = styled.div `
93
- position: relative;
94
- cursor: pointer;
95
- color: ${({ today }) => (today ? theme.colors.white : theme.colors.shade50)};
96
- width: 36px;
97
- height: 36px;
98
- `;
99
- export const CalendarDaySelectedBackground = styled.div `
100
- position: absolute;
101
- background-color: ${({ selected }) => selected && 'rgba(33, 126, 253, 0.16)'};
102
- width: 100%;
103
- height: 100%;
104
- inset: 0;
105
- &::before {
106
- content: '';
107
- border-radius: 50%;
108
- position: absolute;
109
- background-color: ${({ today }) => (today ? theme.colors.cyan40 : 'transparent')};
110
- inset: 0;
111
- }
112
- `;
113
- export const CalendarDayValue = styled.div `
114
- position: absolute;
115
- inset: 0;
116
- display: flex;
117
- align-items: center;
118
- justify-content: center;
119
- `;
120
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/DateInput/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAEjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQzC,CAAA;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;sBAMZ,KAAK,CAAC,MAAM,CAAC,OAAO;;;CAGzC,CAAA;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAA;;CAExC,CAAA;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;;;eAUvB,KAAK,CAAC,SAAS,CAAC,KAAK;WACzB,KAAK,CAAC,MAAM,CAAC,OAAO;CAC9B,CAAA;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,GAAG,CAAA;eAC/B,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC;WAC/B,KAAK,CAAC,MAAM,CAAC,OAAO;;;CAG9B,CAAA;AAMD,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,CAA0B;;;eAG3D,KAAK,CAAC,SAAS,CAAC,MAAM;;WAE1B,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;;;;;;;;;;+BAUrD,KAAK,CAAC,MAAM,CAAC,OAAO;;;;aAItC,KAAK,CAAC,MAAM,CAAC,MAAM;;CAE/B,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,GAAG,CAAA;;;;eAIzB,KAAK,CAAC,SAAS,CAAC,KAAK;;;;;;;YAOxB,KAAK,CAAC,MAAM,CAAC,OAAO;;;;;;YAMpB,KAAK,CAAC,MAAM,CAAC,MAAM;;;;;;YAMnB,KAAK,CAAC,MAAM,CAAC,OAAO;;CAE/B,CAAA;AAKD,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,GAAG,CAAkB;;;WAG5C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC;;;CAG5E,CAAA;AAMD,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CAAC,GAAG,CAAoC;;sBAErE,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,QAAQ,IAAI,0BAA0B;;;;;;;;wBAQtD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC;;;CAGnF,CAAA;AACD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;CAMzC,CAAA"}
@@ -1,25 +0,0 @@
1
- import React, { HTMLAttributes } from 'react';
2
- export interface RangeDateInputProps extends HTMLAttributes<HTMLDivElement> {
3
- isRange?: boolean;
4
- placeholder?: string;
5
- label: string;
6
- defaultOptions?: {
7
- text: string;
8
- id: number;
9
- }[];
10
- selectedOption?: number | null;
11
- readonly?: boolean;
12
- disabled?: boolean;
13
- onSelectedOptionChange?: (option: number | null) => void;
14
- startCustomDate: Date | null;
15
- endCustomDate: Date | null;
16
- onSelectedCustomRange: (start: Date | null, end: Date | null) => void;
17
- }
18
- export interface Position {
19
- x: number;
20
- y: number;
21
- width: number;
22
- height: number;
23
- }
24
- export declare const RangeDateInput: React.FC<RangeDateInputProps>;
25
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RangeDateInput/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,cAAc,EAA0D,MAAM,OAAO,CAAA;AAkBrG,MAAM,WAAW,mBAAoB,SAAQ,cAAc,CAAC,cAAc,CAAC;IACzE,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,cAAc,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;IAC/C,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,sBAAsB,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAA;IACxD,eAAe,EAAE,IAAI,GAAG,IAAI,CAAA;IAC5B,aAAa,EAAE,IAAI,GAAG,IAAI,CAAA;IAC1B,qBAAqB,EAAE,CAAC,KAAK,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAA;CACtE;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAA;IACT,CAAC,EAAE,MAAM,CAAA;IACT,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;CACf;AAiCD,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAyMxD,CAAA"}
@@ -1,175 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import React, { useEffect, useMemo, useRef, useState } from 'react';
13
- import { CalendarDay, CalendarGrid, CalendarHeader, CalendarWeekDayLabel, Dropdown, DropdownWrapper, DefaultOptionButton, InputDateWrapper, CalendarDaySelectedBackground, CalendarDayValue, } from './styles';
14
- import { calendarSVG, chevronDownSVG, chevronLeftSVG, chevronRightSVG } from '../../assets/icon';
15
- import { IconWrapper } from '../IconWrapper';
16
- import { Input } from '../Input';
17
- import { theme } from '../Themes';
18
- const monthNames = [
19
- 'Janeiro',
20
- 'Fevereiro',
21
- 'Março',
22
- 'Abril',
23
- 'Maio',
24
- 'Junho',
25
- 'Julho',
26
- 'Agosto',
27
- 'Setembro',
28
- 'Outubro',
29
- 'Novembro',
30
- 'Dezembro',
31
- ];
32
- const weekDays = ['DOM', 'SEG', 'TER', 'QUA', 'QUI', 'SEX', 'SAB'];
33
- export const RangeDateInput = (_a) => {
34
- var _b, _c;
35
- var { label, defaultOptions, selectedOption, onSelectedOptionChange, placeholder, onSelectedCustomRange, startCustomDate, endCustomDate, isRange } = _a, props = __rest(_a, ["label", "defaultOptions", "selectedOption", "onSelectedOptionChange", "placeholder", "onSelectedCustomRange", "startCustomDate", "endCustomDate", "isRange"]);
36
- const [currentYear, setCurrentYear] = useState(0);
37
- const [currentMonth, setCurrentMonth] = useState(0);
38
- const [currentMouseHoverDate, setCurrentMouseHoverDate] = useState(null);
39
- const [open, setOpen] = useState(false);
40
- const wrapperRef = useRef(null);
41
- useEffect(() => {
42
- const date = new Date();
43
- setCurrentYear(date.getFullYear());
44
- setCurrentMonth(date.getMonth());
45
- }, []);
46
- const days = [];
47
- const changeMonth = (delta) => {
48
- const newDate = new Date(currentYear, currentMonth + delta);
49
- setCurrentYear(newDate.getFullYear());
50
- setCurrentMonth(newDate.getMonth());
51
- };
52
- const onSelectedOptionChangeHandler = (option) => {
53
- if (onSelectedOptionChange) {
54
- onSelectedOptionChange(option);
55
- if (onSelectedCustomRange)
56
- onSelectedCustomRange(null, null);
57
- setOpen(false);
58
- }
59
- };
60
- const onDayClick = (date) => {
61
- if (onSelectedOptionChange)
62
- onSelectedOptionChange(null);
63
- if (!startCustomDate) {
64
- onSelectedCustomRange && onSelectedCustomRange(date, null);
65
- currentMouseHoverDate && setCurrentMouseHoverDate(date);
66
- if (isRange === false)
67
- setOpen(false);
68
- }
69
- else if (!endCustomDate) {
70
- let firstDate = startCustomDate;
71
- let secondDate = date;
72
- if (firstDate && secondDate && firstDate > secondDate) {
73
- const temp = firstDate;
74
- firstDate = secondDate;
75
- secondDate = temp;
76
- }
77
- onSelectedCustomRange && onSelectedCustomRange(firstDate, secondDate);
78
- setOpen(false);
79
- }
80
- else {
81
- if (isRange === false)
82
- setOpen(false);
83
- onSelectedCustomRange && onSelectedCustomRange(date, null);
84
- setCurrentMouseHoverDate(date);
85
- }
86
- };
87
- const onMouseEnter = (date) => {
88
- if (startCustomDate && !endCustomDate) {
89
- setCurrentMouseHoverDate(date);
90
- }
91
- };
92
- const onMouseLeave = (date) => { };
93
- const day = new Date(currentYear, currentMonth, 1);
94
- for (let i = 0; i < day.getDay(); i++) {
95
- days.push({ type: 'empty', key: `before-${i}` });
96
- }
97
- const todayString = new Date().toDateString();
98
- let firstDate = startCustomDate;
99
- let secondDate = endCustomDate !== null && endCustomDate !== void 0 ? endCustomDate : currentMouseHoverDate;
100
- if (firstDate && secondDate && firstDate > secondDate) {
101
- const temp = firstDate;
102
- firstDate = secondDate;
103
- secondDate = temp;
104
- }
105
- while (day.getMonth() === currentMonth) {
106
- const isSelected = (_b = (firstDate && secondDate && day >= firstDate && day <= secondDate)) !== null && _b !== void 0 ? _b : false;
107
- days.push({
108
- type: 'day',
109
- value: day.getDate(),
110
- today: day.toDateString() === todayString,
111
- selected: isSelected,
112
- date: new Date(day),
113
- });
114
- day.setDate(day.getDate() + 1);
115
- }
116
- const value = useMemo(() => {
117
- var _a, _b;
118
- if (selectedOption !== null)
119
- return (_b = (_a = defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.find(option => option.id === selectedOption)) === null || _a === void 0 ? void 0 : _a.text) !== null && _b !== void 0 ? _b : '';
120
- if (!firstDate && !secondDate)
121
- return '';
122
- if (firstDate && !secondDate)
123
- return firstDate.toLocaleDateString();
124
- if (secondDate && (firstDate === null || firstDate === void 0 ? void 0 : firstDate.toLocaleDateString()) === secondDate.toLocaleDateString())
125
- return firstDate.toLocaleDateString();
126
- if (firstDate && secondDate)
127
- return `${firstDate.toLocaleDateString()} - ${secondDate.toLocaleDateString()}`;
128
- return '';
129
- }, [selectedOption, firstDate, secondDate]);
130
- useEffect(() => {
131
- if (!open)
132
- return;
133
- const handler = (event) => {
134
- let element = event.target;
135
- console.log(element);
136
- while (element && element !== document.body.parentElement) {
137
- if (element === wrapperRef.current)
138
- break;
139
- element = element.parentElement;
140
- }
141
- if (element === document.body.parentElement) {
142
- setOpen(false);
143
- }
144
- };
145
- document.addEventListener('click', handler);
146
- return () => {
147
- document.removeEventListener('click', handler);
148
- };
149
- }, [open]);
150
- placeholder = placeholder !== null && placeholder !== void 0 ? placeholder : 'Selecione um período';
151
- return (React.createElement(InputDateWrapper, Object.assign({}, props, { ref: wrapperRef }),
152
- React.createElement(Input, { iconLeft: React.createElement(IconWrapper, { className: "icon", src: calendarSVG, width: "20px", height: "20px", color: theme.colors.shade30 }), iconRight: React.createElement(IconWrapper, { className: `icon ${open ? 'icon-rotate' : ''}`, src: chevronDownSVG, width: "16px", color: theme.colors.shade30 }), placeholder: placeholder, label: label, value: value, readonly: true, onClick: () => setOpen(!open) }),
153
- open && (React.createElement(DropdownWrapper, null,
154
- React.createElement(Dropdown, null,
155
- ((_c = defaultOptions === null || defaultOptions === void 0 ? void 0 : defaultOptions.length) !== null && _c !== void 0 ? _c : 0) > 0 && (React.createElement("div", null, defaultOptions === null || defaultOptions === void 0 ? void 0 :
156
- defaultOptions.map(option => (React.createElement(DefaultOptionButton, { selected: option.id === selectedOption, key: option.id, onClick: () => onSelectedOptionChangeHandler(option.id) }, option.text))),
157
- React.createElement(DefaultOptionButton, { selected: !!firstDate }, "Per\u00EDodo Personalizado"))),
158
- React.createElement(CalendarHeader, null,
159
- React.createElement(IconWrapper, { className: "icon", src: chevronLeftSVG, width: "14px", onClick: () => changeMonth(-1) }),
160
- monthNames[currentMonth],
161
- " ",
162
- currentYear,
163
- React.createElement(IconWrapper, { className: "icon", src: chevronRightSVG, width: "14px", onClick: () => changeMonth(1) })),
164
- React.createElement(CalendarGrid, null,
165
- weekDays.map(weekDay => (React.createElement(CalendarWeekDayLabel, { key: weekDay }, weekDay))),
166
- days.map(day => {
167
- if (day.type === 'empty') {
168
- return React.createElement("div", { key: day.key });
169
- }
170
- return (React.createElement(CalendarDay, { key: day.value, today: day.today, onClick: () => onDayClick(day.date), onMouseEnter: () => onMouseEnter(day.date), onMouseLeave: () => onMouseLeave(day.date) },
171
- React.createElement(CalendarDaySelectedBackground, { selected: day.selected, today: day.today }),
172
- React.createElement(CalendarDayValue, null, day.value)));
173
- })))))));
174
- };
175
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/RangeDateInput/index.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,EAAE,EAA6B,SAAS,EAAS,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACrG,OAAO,EACL,WAAW,EACX,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,QA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,WAAW,IAAC,SAAS,EAAC,MAAM,EAAC,GAAG,EAAE,eAAe,EAAE,KAAK,EAAC,MAAM,EAAC,OAAO,EAAE,GAAG,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,GAAI,CACnF;gBAEjB,oBAAC,YAAY;oBACV,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC,CACvB,oBAAC,oBAAoB,IAAC,GAAG,EAAE,OAAO,IAAG,OAAO,CAAwB,CACrE,CAAC;oBACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;wBACd,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,EAAE,CAAC;4BACzB,OAAO,6BAAK,GAAG,EAAE,GAAG,CAAC,GAAG,GAAQ,CAAA;wBAClC,CAAC;wBACD,OAAO,CACL,oBAAC,WAAW,IACV,GAAG,EAAE,GAAG,CAAC,KAAK,EACd,KAAK,EAAE,GAAG,CAAC,KAAK,EAChB,OAAO,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,EACnC,YAAY,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,EAC1C,YAAY,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;4BAE1C,oBAAC,6BAA6B,IAAC,QAAQ,EAAE,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,GAAI;4BAC3E,oBAAC,gBAAgB,QAAE,GAAG,CAAC,KAAK,CAAoB,CACpC,CACf,CAAA;oBACH,CAAC,CAAC,CACW,CACN,CACK,CACnB,CACgB,CACpB,CAAA;AACH,CAAC,CAAA"}
@@ -1,8 +0,0 @@
1
- import { Meta, StoryObj } from '@storybook/react';
2
- import { RangeDateInput } from './index';
3
- declare const meta: Meta<typeof RangeDateInput>;
4
- export default meta;
5
- type Story = StoryObj<typeof RangeDateInput>;
6
- export declare const SelecionarIntervaloDeDatas: Story;
7
- export declare const SelecionarIntervaloDeDatasSimples: Story;
8
- //# sourceMappingURL=stories.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stories.d.ts","sourceRoot":"","sources":["../../../src/components/RangeDateInput/stories.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIxC,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,cAAc,CAeC,CAAA;AAEvC,eAAe,IAAI,CAAA;AACnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,cAAc,CAAC,CAAA;AAsC5C,eAAO,MAAM,0BAA0B,EAAE,KAExC,CAAA;AAED,eAAO,MAAM,iCAAiC,EAAE,KAE/C,CAAA"}
@@ -1,60 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { RangeDateInput } from './index';
13
- import React from 'react';
14
- const meta = {
15
- title: 'Components/RangeDateInput',
16
- component: RangeDateInput,
17
- tags: ['autodocs'],
18
- argTypes: {
19
- placeholder: { control: 'text' },
20
- label: { control: 'text' },
21
- readonly: { control: 'boolean' },
22
- disabled: { control: 'boolean' },
23
- selectedOption: { control: 'number' },
24
- startCustomDate: { control: 'date' },
25
- endCustomDate: { control: 'date' },
26
- onSelectedOptionChange: { action: 'selectedOptionChange' },
27
- onSelectedCustomRange: { action: 'selectedCustomRange' },
28
- },
29
- };
30
- export default meta;
31
- const ComponentWrapper = (_a) => {
32
- var { defaultOptions } = _a, args = __rest(_a, ["defaultOptions"]);
33
- const [selectedOption, setSelectOption] = React.useState(null);
34
- const [startDate, setStartDate] = React.useState(null);
35
- const [endDate, setEndDate] = React.useState(null);
36
- return (React.createElement(RangeDateInput, Object.assign({ selectedOption: selectedOption, startCustomDate: startDate, endCustomDate: endDate, onSelectedCustomRange: (start, end) => {
37
- setStartDate(start);
38
- setEndDate(end);
39
- }, onSelectedOptionChange: option => setSelectOption(option), defaultOptions: defaultOptions !== null && defaultOptions !== void 0 ? defaultOptions : [
40
- {
41
- text: 'Últimos 30 dias',
42
- id: 30,
43
- },
44
- {
45
- text: 'Últimos 60 dias',
46
- id: 60,
47
- },
48
- {
49
- text: 'Últimos 90 dias',
50
- id: 90,
51
- },
52
- ] }, args)));
53
- };
54
- export const SelecionarIntervaloDeDatas = {
55
- render: args => React.createElement(ComponentWrapper, { label: "Per\u00EDodo da Disputa", placeholder: "Placeholder" }),
56
- };
57
- export const SelecionarIntervaloDeDatasSimples = {
58
- render: args => React.createElement(ComponentWrapper, { defaultOptions: [] }),
59
- };
60
- //# sourceMappingURL=stories.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stories.js","sourceRoot":"","sources":["../../../src/components/RangeDateInput/stories.tsx"],"names":[],"mappings":";;;;;;;;;;;AACA,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAExC,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,MAAM,IAAI,GAAgC;IACxC,KAAK,EAAE,2BAA2B;IAClC,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,WAAW,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAChC,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE;QAC1B,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;QAChC,QAAQ,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE;QAChC,cAAc,EAAE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IAAI,EACR,CACH,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,0BAA0B,GAAU;IAC/C,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,oBAAC,gBAAgB,IAAC,KAAK,EAAC,yBAAoB,EAAC,WAAW,EAAC,aAAa,GAAG;CAC1F,CAAA;AAED,MAAM,CAAC,MAAM,iCAAiC,GAAU;IACtD,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC,oBAAC,gBAAgB,IAAC,cAAc,EAAE,EAAE,GAAI;CACzD,CAAA"}
@@ -1,21 +0,0 @@
1
- export declare const InputDateWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
2
- export declare const Dropdown: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
3
- export declare const DropdownWrapper: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
4
- export declare const CalendarGrid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
5
- export declare const CalendarWeekDayLabel: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
6
- export interface DefaultOptionButtonProps {
7
- selected: boolean;
8
- }
9
- export declare const DefaultOptionButton: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, DefaultOptionButtonProps>> & string;
10
- export declare const CalendarHeader: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
11
- export interface CalendarDayProps {
12
- today: boolean;
13
- }
14
- export declare const CalendarDay: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, CalendarDayProps>> & string;
15
- export interface CalendarDaySelectedBackgroundProps {
16
- today: boolean;
17
- selected: boolean;
18
- }
19
- export declare const CalendarDaySelectedBackground: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, CalendarDaySelectedBackgroundProps>> & string;
20
- export declare const CalendarDayValue: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
21
- //# sourceMappingURL=styles.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/components/RangeDateInput/styles.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,6NAQ5B,CAAA;AAED,eAAO,MAAM,QAAQ,6NASpB,CAAA;AAED,eAAO,MAAM,eAAe,6NAE3B,CAAA;AAED,eAAO,MAAM,YAAY,6NAYxB,CAAA;AAED,eAAO,MAAM,oBAAoB,6NAKhC,CAAA;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,mBAAmB,yQAqB/B,CAAA;AAED,eAAO,MAAM,cAAc,6NAyB1B,CAAA;AACD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAA;CACf;AAED,eAAO,MAAM,WAAW,qPAMvB,CAAA;AAED,MAAM,WAAW,kCAAkC;IACjD,KAAK,EAAE,OAAO,CAAA;IACd,QAAQ,EAAE,OAAO,CAAA;CAClB;AACD,eAAO,MAAM,6BAA6B,uQAkBzC,CAAA;AACD,eAAO,MAAM,gBAAgB,6NAO5B,CAAA"}
@@ -1,126 +0,0 @@
1
- import styled from 'styled-components';
2
- import { theme } from '../Themes';
3
- export const InputDateWrapper = styled.div `
4
- position: relative;
5
- .icon {
6
- transition: transform 0.3s;
7
- }
8
- .icon-rotate {
9
- transform: rotate(180deg) translateY(5px);
10
- }
11
- `;
12
- export const Dropdown = styled.div `
13
- position: absolute;
14
- width: 252px;
15
- padding: 16px;
16
- z-index: 1;
17
- border-radius: 4px;
18
- border: 1px solid ${theme.colors.shade20};
19
- margin-top: 7px;
20
- box-shadow: 0px 0px 15px rgba(0, 0, 0, 0.1);
21
- `;
22
- export const DropdownWrapper = styled.div `
23
- position: relative;
24
- `;
25
- export const CalendarGrid = styled.div `
26
- display: grid;
27
- font-family: 'Nunito Sans', sans-serif;
28
- grid-template-columns: repeat(7, 36px);
29
- align-items: center;
30
- justify-items: center;
31
- grid-column-gap: 0px;
32
- grid-row-gap: 0px;
33
- height: 100%;
34
- width: 100%;
35
- font-size: ${theme.paragraph.small};
36
- color: ${theme.colors.shade50};
37
- `;
38
- export const CalendarWeekDayLabel = styled.div `
39
- font-size: ${theme.paragraph['xx-small']};
40
- color: ${theme.colors.shade30};
41
- font-weight: 600;
42
- margin-bottom: 4px;
43
- `;
44
- export const DefaultOptionButton = styled.button `
45
- background-color: transparent;
46
- border: none;
47
- font-size: ${theme.paragraph.medium};
48
- font-family: 'Nunito Sans', sans-serif;
49
- color: ${({ selected }) => (selected ? theme.colors.cyan30 : theme.colors.shade40)};
50
- cursor: pointer;
51
- padding: 0;
52
- width: 100%;
53
- text-align: left;
54
- height: 46px;
55
- display: flex;
56
- align-items: center;
57
-
58
- &:not(:last-child) {
59
- border-bottom: 1px solid ${theme.colors.shade10};
60
- }
61
-
62
- &:hover {
63
- color: ${theme.colors.cyan30};
64
- }
65
- `;
66
- export const CalendarHeader = styled.div `
67
- display: flex;
68
- justify-content: space-between;
69
- align-items: center;
70
- font-size: ${theme.paragraph.small};
71
- font-family: 'Nunito Sans', sans-serif;
72
- font-weight: 600;
73
-
74
- .icon,
75
- .icon svg,
76
- .icon svg path {
77
- fill: ${theme.colors.shade50} !important;
78
- }
79
-
80
- .icon:hover,
81
- .icon:hover svg,
82
- .icon:hover svg path {
83
- fill: ${theme.colors.cyan30} !important;
84
- }
85
-
86
- .icon-disabled,
87
- .icon-disabled svg,
88
- .icon-disabled svg path {
89
- fill: ${theme.colors.shade20} !important;
90
- }
91
- `;
92
- export const CalendarDay = styled.div `
93
- position: relative;
94
- cursor: pointer;
95
- color: ${({ today }) => (today ? theme.colors.white : theme.colors.shade50)};
96
- width: 36px;
97
- height: 36px;
98
- `;
99
- export const CalendarDaySelectedBackground = styled.div `
100
- position: absolute;
101
- background-color: ${({ selected }) => selected && 'rgba(33, 126, 253, 0.16)'};
102
- width: 100%;
103
- height: 100%;
104
- inset: 0;
105
-
106
- &:hover {
107
- background-color: rgba(33, 126, 253, 0.16);
108
- }
109
-
110
- &::before {
111
- content: '';
112
- border-radius: 50%;
113
- position: absolute;
114
- background-color: ${({ today }) => (today ? theme.colors.cyan40 : 'transparent')};
115
- inset: 0;
116
- }
117
- `;
118
- export const CalendarDayValue = styled.div `
119
- position: absolute;
120
- inset: 0;
121
- display: flex;
122
- align-items: center;
123
- justify-content: center;
124
- pointer-events: none;
125
- `;
126
- //# sourceMappingURL=styles.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"styles.js","sourceRoot":"","sources":["../../../src/components/RangeDateInput/styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAA;AACtC,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAA;AAEjC,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;;;;CAQzC,CAAA;AAED,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