@mirai/ui 1.0.54 → 1.0.55
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/README.md +6 -7
- package/build/components/Button/Button.js +4 -4
- package/build/components/Button/Button.js.map +1 -1
- package/build/components/Button/Button.module.css +17 -11
- package/build/components/Button/Button.stories.js +1 -1
- package/build/components/Button/Button.stories.js.map +1 -1
- package/build/components/Button/__tests__/__snapshots__/Button.test.js.snap +4 -4
- package/build/components/Calendar/Calendar.Month.js +6 -1
- package/build/components/Calendar/Calendar.Month.js.map +1 -1
- package/build/components/Calendar/Calendar.stories.js +54 -0
- package/build/components/Calendar/Calendar.stories.js.map +1 -0
- package/build/components/Calendar/__tests__/__snapshots__/Calendar.test.jsx.snap +216 -216
- package/build/components/InputNumber/InputNumber.js +4 -3
- package/build/components/InputNumber/InputNumber.js.map +1 -1
- package/build/components/InputNumber/__tests__/__snapshots__/InputNumber.test.js.snap +73 -73
- package/build/components/InputOption/InputOption.js +1 -1
- package/build/components/InputOption/InputOption.js.map +1 -1
- package/build/components/InputOption/InputOption.module.css +1 -1
- package/build/components/InputOption/__tests__/__snapshots__/InputOption.test.js.snap +2 -2
- package/build/components/InputSelect/__tests__/__snapshots__/InputSelect.test.js.snap +7 -7
- package/build/components/InputText/InputText.js +1 -1
- package/build/components/InputText/InputText.js.map +1 -1
- package/build/components/InputText/InputText.module.css +6 -6
- package/build/components/InputText/__tests__/__snapshots__/InputText.test.js.snap +2 -2
- package/build/components/Menu/__tests__/__snapshots__/Menu.test.jsx.snap +3 -3
- package/build/components/Modal/Modal.module.css +2 -2
- package/build/components/Modal/__tests__/__snapshots__/Modal.test.js.snap +6 -6
- package/build/components/Notification/Notification.js +19 -23
- package/build/components/Notification/Notification.js.map +1 -1
- package/build/components/Notification/Notification.module.css +23 -28
- package/build/components/Notification/__tests__/__snapshots__/Notification.test.js.snap +82 -127
- package/build/components/Table/__tests__/__snapshots__/Table.test.js.snap +25 -25
- package/build/primitives/Icon/Icon.js +13 -4
- package/build/primitives/Icon/Icon.js.map +1 -1
- package/build/primitives/Icon/Icon.module.css +49 -8
- package/build/primitives/Icon/__tests__/__snapshots__/Icon.test.js.snap +5 -5
- package/build/primitives/Text/Text.js +6 -5
- package/build/primitives/Text/Text.js.map +1 -1
- package/build/primitives/Text/Text.module.css +21 -8
- package/build/primitives/Text/__tests__/__snapshots__/Text.test.js.snap +40 -10
- package/build/theme/default.theme.css +19 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -227,8 +227,8 @@ A primitive for displaying text. It receives the following props:
|
|
|
227
227
|
- `bold:boolean` modifying font-weight
|
|
228
228
|
- `children:string`
|
|
229
229
|
- `headline:boolean` modifying font-size
|
|
230
|
+
- `level:number` assign the level of heading (1, 2, 3 or 4)
|
|
230
231
|
- `small:boolean` modifying font-size
|
|
231
|
-
- `subheadline:boolean` modifying font-size
|
|
232
232
|
- `tag:string` html tag of resulting element
|
|
233
233
|
- `upperCase:boolean` switching text to upper case
|
|
234
234
|
|
|
@@ -278,7 +278,7 @@ A button component that receives the following props:
|
|
|
278
278
|
- `children:node|string`
|
|
279
279
|
- `disabled:boolean` applying 'disabled' attribute
|
|
280
280
|
- `large:boolean` modifying the button size
|
|
281
|
-
- `
|
|
281
|
+
- `secondary:boolean` modifying the button appearance using a secondary _variant_.
|
|
282
282
|
- `rounded:boolean` if true will use the theme border-radius variable for round the corners
|
|
283
283
|
- `small:boolean` modifying the button size
|
|
284
284
|
- `squared:boolean` if true gives rectangular shape to the button (false by default)
|
|
@@ -315,7 +315,7 @@ const MyComponent = (props) => {
|
|
|
315
315
|
--mirai-ui-button-disabled-color: var(--mirai-ui-content-light);
|
|
316
316
|
--mirai-ui-button-font: var(--mirai-ui-font);
|
|
317
317
|
--mirai-ui-button-font-weight: var(--mirai-ui-font-weight);
|
|
318
|
-
--mirai-ui-button-
|
|
318
|
+
--mirai-ui-button-secondary-background: var(--mirai-ui-base);
|
|
319
319
|
--mirai-ui-button-padding-y: var(--mirai-ui-space-S);
|
|
320
320
|
--mirai-ui-button-padding-x: var(--mirai-ui-space-L);
|
|
321
321
|
--mirai-ui-button-radius: var(--mirai-ui-border-radius);
|
|
@@ -520,7 +520,7 @@ const MyComponent = (props) => {
|
|
|
520
520
|
--mirai-ui-input-text-disabled: var(--mirai-ui-content-border);
|
|
521
521
|
--mirai-ui-input-text-error: var(--mirai-ui-error);
|
|
522
522
|
--mirai-ui-input-text-focus: var(--mirai-ui-accent);
|
|
523
|
-
--mirai-ui-input-text-icon: var(--mirai-ui-
|
|
523
|
+
--mirai-ui-input-text-icon: var(--mirai-ui-font-size-headline-4);
|
|
524
524
|
--mirai-ui-input-text-padding-x: var(--mirai-ui-space-S);
|
|
525
525
|
--mirai-ui-input-text-padding-y: var(--mirai-ui-space-S);
|
|
526
526
|
--mirai-ui-input-text-radius: var(--mirai-ui-border-radius);
|
|
@@ -561,7 +561,7 @@ const MyComponent = () => {
|
|
|
561
561
|
visible={visible}
|
|
562
562
|
onPress={(value, event) => console.log('<Menu>::onPress', value, event)}
|
|
563
563
|
>
|
|
564
|
-
<Button squared
|
|
564
|
+
<Button squared secondary onPress={() => setVisible(!visible)}>
|
|
565
565
|
<Icon name="Plus" />
|
|
566
566
|
</Button>
|
|
567
567
|
</Menu>;
|
|
@@ -612,7 +612,7 @@ const MyComponent = (props) => {
|
|
|
612
612
|
```css
|
|
613
613
|
--mirai-ui-modal-background: var(--mirai-ui-base);
|
|
614
614
|
--mirai-ui-modal-header-padding: var(--mirai-ui-space-M);
|
|
615
|
-
--mirai-ui-modal-icon: var(--mirai-ui-
|
|
615
|
+
--mirai-ui-modal-icon: var(--mirai-ui-font-size-headline-2);
|
|
616
616
|
--mirai-ui-modal-layer: var(--mirai-ui-layer-L);
|
|
617
617
|
--mirai-ui-modal-overflow: rgba(0, 0, 0, 0.15);
|
|
618
618
|
--mirai-ui-modal-shadow: var(--mirai-ui-shadow);
|
|
@@ -708,7 +708,6 @@ Theme.shadeColors()
|
|
|
708
708
|
--mirai-ui-font-bold: Arial, Regular;
|
|
709
709
|
--mirai-ui-font-bold-weight: 700;
|
|
710
710
|
--mirai-ui-font-size-headline: 18px;
|
|
711
|
-
--mirai-ui-font-size-subheadline: 16px;
|
|
712
711
|
--mirai-ui-font-size-paragraph: 14px;
|
|
713
712
|
--mirai-ui-font-size-action: 14px;
|
|
714
713
|
--mirai-ui-font-size-small: 12px;
|
|
@@ -15,7 +15,7 @@ var _primitives = require("../../primitives");
|
|
|
15
15
|
|
|
16
16
|
var _ButtonModule = _interopRequireDefault(require("./Button.module.css"));
|
|
17
17
|
|
|
18
|
-
var _excluded = ["busy", "children", "disabled", "large", "
|
|
18
|
+
var _excluded = ["busy", "children", "disabled", "large", "rounded", "secondary", "small", "squared", "tag", "wide", "onPress"];
|
|
19
19
|
|
|
20
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
21
21
|
|
|
@@ -34,8 +34,8 @@ var Button = function Button(_ref) {
|
|
|
34
34
|
children = _ref.children,
|
|
35
35
|
disabled = _ref.disabled,
|
|
36
36
|
large = _ref.large,
|
|
37
|
-
outlined = _ref.outlined,
|
|
38
37
|
rounded = _ref.rounded,
|
|
38
|
+
secondary = _ref.secondary,
|
|
39
39
|
small = _ref.small,
|
|
40
40
|
_ref$squared = _ref.squared,
|
|
41
41
|
squared = _ref$squared === void 0 ? false : _ref$squared,
|
|
@@ -48,7 +48,7 @@ var Button = function Button(_ref) {
|
|
|
48
48
|
return /*#__PURE__*/_react.default.createElement(_primitives.Pressable, _objectSpread(_objectSpread({}, others), {}, {
|
|
49
49
|
disabled: disabled || busy,
|
|
50
50
|
tag: tag,
|
|
51
|
-
className: (0, _helpers.styles)(_ButtonModule.default.button, busy && _ButtonModule.default.busy, large && _ButtonModule.default.large, small && _ButtonModule.default.small, rounded && _ButtonModule.default.rounded, squared && _ButtonModule.default.squared,
|
|
51
|
+
className: (0, _helpers.styles)(_ButtonModule.default.button, busy && _ButtonModule.default.busy, large && _ButtonModule.default.large, small && _ButtonModule.default.small, rounded && _ButtonModule.default.rounded, squared && _ButtonModule.default.squared, secondary && _ButtonModule.default.secondary, secondary && (disabled || busy) && _ButtonModule.default.disabled, wide && _ButtonModule.default.wide, others.className),
|
|
52
52
|
onPress: !disabled && !busy ? onPress : undefined
|
|
53
53
|
}), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, busy !== undefined && /*#__PURE__*/_react.default.createElement(_primitives.View, {
|
|
54
54
|
className: (0, _helpers.styles)(_ButtonModule.default.busyProgress, busy && _ButtonModule.default.active)
|
|
@@ -62,8 +62,8 @@ Button.propTypes = {
|
|
|
62
62
|
children: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.node]),
|
|
63
63
|
disabled: _propTypes.default.bool,
|
|
64
64
|
large: _propTypes.default.bool,
|
|
65
|
-
outlined: _propTypes.default.bool,
|
|
66
65
|
rounded: _propTypes.default.bool,
|
|
66
|
+
secondary: _propTypes.default.bool,
|
|
67
67
|
small: _propTypes.default.bool,
|
|
68
68
|
squared: _propTypes.default.bool,
|
|
69
69
|
tag: _propTypes.default.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.js","names":["Button","busy","children","disabled","large","
|
|
1
|
+
{"version":3,"file":"Button.js","names":["Button","busy","children","disabled","large","rounded","secondary","small","squared","tag","wide","onPress","others","React","createElement","Pressable","className","style","button","undefined","busyProgress","active","displayName","propTypes","PropTypes","bool","oneOfType","string","node","onEnter","func","onLeave"],"sources":["../../../src/components/Button/Button.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { Pressable, View } from '../../primitives';\nimport style from './Button.module.css';\n\nconst Button = ({\n busy,\n children,\n disabled,\n large,\n rounded,\n secondary,\n small,\n squared = false,\n tag = 'button',\n wide,\n onPress,\n ...others\n}) =>\n React.createElement(\n Pressable,\n {\n ...others,\n disabled: disabled || busy,\n tag,\n className: styles(\n style.button,\n busy && style.busy,\n large && style.large,\n small && style.small,\n rounded && style.rounded,\n squared && style.squared,\n secondary && style.secondary,\n secondary && (disabled || busy) && style.disabled,\n wide && style.wide,\n others.className,\n ),\n onPress: !disabled && !busy ? onPress : undefined,\n },\n <>\n {busy !== undefined && <View className={styles(style.busyProgress, busy && style.active)} />}\n {children}\n </>,\n );\n\nButton.displayName = 'Component:Button';\n\nButton.propTypes = {\n busy: PropTypes.bool,\n children: PropTypes.oneOfType([PropTypes.string, PropTypes.node]),\n disabled: PropTypes.bool,\n large: PropTypes.bool,\n rounded: PropTypes.bool,\n secondary: PropTypes.bool,\n small: PropTypes.bool,\n squared: PropTypes.bool,\n tag: PropTypes.string,\n wide: PropTypes.bool,\n onEnter: PropTypes.func,\n onLeave: PropTypes.func,\n onPress: PropTypes.func,\n};\n\nexport { Button };\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;;;;;;;;;AAEA,IAAMA,MAAM,GAAG,SAATA,MAAS;EAAA,IACbC,IADa,QACbA,IADa;EAAA,IAEbC,QAFa,QAEbA,QAFa;EAAA,IAGbC,QAHa,QAGbA,QAHa;EAAA,IAIbC,KAJa,QAIbA,KAJa;EAAA,IAKbC,OALa,QAKbA,OALa;EAAA,IAMbC,SANa,QAMbA,SANa;EAAA,IAObC,KAPa,QAObA,KAPa;EAAA,wBAQbC,OARa;EAAA,IAQbA,OARa,6BAQH,KARG;EAAA,oBASbC,GATa;EAAA,IASbA,GATa,yBASP,QATO;EAAA,IAUbC,IAVa,QAUbA,IAVa;EAAA,IAWbC,OAXa,QAWbA,OAXa;EAAA,IAYVC,MAZU;;EAAA,oBAcbC,eAAMC,aAAN,CACEC,qBADF,kCAGOH,MAHP;IAIIT,QAAQ,EAAEA,QAAQ,IAAIF,IAJ1B;IAKIQ,GAAG,EAAHA,GALJ;IAMIO,SAAS,EAAE,qBACTC,sBAAMC,MADG,EAETjB,IAAI,IAAIgB,sBAAMhB,IAFL,E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 +9,10 @@
|
|
|
9
9
|
--mirai-ui-button-disabled-color: var(--mirai-ui-content-light);
|
|
10
10
|
--mirai-ui-button-font: var(--mirai-ui-font);
|
|
11
11
|
--mirai-ui-button-font-weight: var(--mirai-ui-font-weight);
|
|
12
|
-
--mirai-ui-button-outlined-background: var(--mirai-ui-base);
|
|
13
12
|
--mirai-ui-button-padding-y: var(--mirai-ui-space-S);
|
|
14
13
|
--mirai-ui-button-padding-x: var(--mirai-ui-space-L);
|
|
15
14
|
--mirai-ui-button-radius: var(--mirai-ui-border-radius);
|
|
15
|
+
--mirai-ui-button-secondary-background: var(--mirai-ui-base);
|
|
16
16
|
--mirai-ui-button-squared: calc(var(--mirai-ui-space-M) * 2);
|
|
17
17
|
}
|
|
18
18
|
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
.
|
|
51
|
+
.secondary .busyProgress {
|
|
52
52
|
background-color: var(--mirai-ui-button-background);
|
|
53
53
|
}
|
|
54
54
|
|
|
@@ -68,24 +68,30 @@
|
|
|
68
68
|
animation-timing-function: var(--mirai-ui-motion-easing);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
.button:not(:disabled):active {
|
|
71
|
+
.button:not(.secondary):not(:disabled):active {
|
|
72
72
|
box-shadow: inset 0 0 var(--mirai-ui-space-XL) var(--mirai-ui-space-XL) var(--mirai-ui-button-color-active);
|
|
73
73
|
}
|
|
74
74
|
|
|
75
|
+
.button.secondary:not(:disabled):active {
|
|
76
|
+
background-color: var(--mirai-ui-button-color-focus);
|
|
77
|
+
box-shadow: none;
|
|
78
|
+
color: var(--mirai-ui-button-color);
|
|
79
|
+
}
|
|
80
|
+
|
|
75
81
|
.large:not(.squared) {
|
|
76
82
|
font-size: var(--mirai-ui-font-size-headline);
|
|
77
83
|
padding: var(--mirai-ui-button-padding-y)
|
|
78
84
|
calc(var(--mirai-ui-button-padding-x) + calc(var(--mirai-ui-button-padding-y) / 2));
|
|
79
85
|
}
|
|
80
86
|
|
|
81
|
-
.
|
|
82
|
-
background-color: var(--mirai-ui-button-
|
|
83
|
-
|
|
87
|
+
.secondary {
|
|
88
|
+
background-color: var(--mirai-ui-button-secondary-background);
|
|
89
|
+
box-shadow: inset 0 0 0 var(--mirai-ui-border-width) var(--mirai-ui-button-background);
|
|
84
90
|
color: var(--mirai-ui-button-background);
|
|
85
91
|
}
|
|
86
92
|
|
|
87
|
-
.
|
|
88
|
-
|
|
93
|
+
.secondary.disabled:not(.busy) {
|
|
94
|
+
box-shadow: none;
|
|
89
95
|
}
|
|
90
96
|
|
|
91
97
|
.rounded {
|
|
@@ -109,12 +115,12 @@
|
|
|
109
115
|
}
|
|
110
116
|
|
|
111
117
|
@media only screen and (min-width: 600px) {
|
|
112
|
-
.button:not(:disabled).
|
|
113
|
-
|
|
118
|
+
.button:not(:disabled).secondary:hover:not(:active) {
|
|
119
|
+
box-shadow: inset 0 0 0 var(--mirai-ui-border-width) var(--mirai-ui-button-color-focus);
|
|
114
120
|
color: var(--mirai-ui-button-color-focus);
|
|
115
121
|
}
|
|
116
122
|
|
|
117
|
-
.button:not(:disabled):not(.
|
|
123
|
+
.button:not(:disabled):not(.secondary):hover {
|
|
118
124
|
background-color: var(--mirai-ui-button-color-focus);
|
|
119
125
|
}
|
|
120
126
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.stories.js","names":["title","Story","props","storyName","args","busy","children","disabled","large","
|
|
1
|
+
{"version":3,"file":"Button.stories.js","names":["title","Story","props","storyName","args","busy","children","disabled","large","rounded","secondary","small","squared","tag","wide","argTypes","onEnter","action","onLeave","onPress"],"sources":["../../../src/components/Button/Button.stories.jsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Button } from './Button';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => <Button {...props} />;\n\nStory.storyName = 'Button';\n\nStory.args = {\n busy: false,\n children: 'children',\n disabled: false,\n large: false,\n rounded: false,\n secondary: false,\n small: false,\n squared: false,\n tag: 'button',\n wide: false,\n};\n\nStory.argTypes = {\n onEnter: { action: 'onEnter' },\n onLeave: { action: 'onLeave' },\n onPress: { action: 'onPress' },\n};\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;;;;;eAEe;EAAEA,KAAK,EAAE;AAAT,C;;;AAER,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD;EAAA,oBAAW,oBAAC,cAAD,EAAYA,KAAZ,CAAX;AAAA,CAAd;;;AAEPD,KAAK,CAACE,SAAN,GAAkB,QAAlB;AAEAF,KAAK,CAACG,IAAN,GAAa;EACXC,IAAI,EAAE,KADK;EAEXC,QAAQ,EAAE,UAFC;EAGXC,QAAQ,EAAE,KAHC;EAIXC,KAAK,EAAE,KAJI;EAKXC,OAAO,EAAE,KALE;EAMXC,SAAS,EAAE,KANA;EAOXC,KAAK,EAAE,KAPI;EAQXC,OAAO,EAAE,KARE;EASXC,GAAG,EAAE,QATM;EAUXC,IAAI,EAAE;AAVK,CAAb;AAaAb,KAAK,CAACc,QAAN,GAAiB;EACfC,OAAO,EAAE;IAAEC,MAAM,EAAE;EAAV,CADM;EAEfC,OAAO,EAAE;IAAED,MAAM,EAAE;EAAV,CAFM;EAGfE,OAAO,EAAE;IAAEF,MAAM,EAAE;EAAV;AAHM,CAAjB"}
|
|
@@ -45,10 +45,10 @@ exports[`component:<Button> prop:large 1`] = `
|
|
|
45
45
|
</DocumentFragment>
|
|
46
46
|
`;
|
|
47
47
|
|
|
48
|
-
exports[`component:<Button> prop:
|
|
48
|
+
exports[`component:<Button> prop:secondary && prop:busy 1`] = `
|
|
49
49
|
<DocumentFragment>
|
|
50
50
|
<button
|
|
51
|
-
class="pressable button busy
|
|
51
|
+
class="pressable button busy secondary disabled"
|
|
52
52
|
disabled=""
|
|
53
53
|
>
|
|
54
54
|
<div
|
|
@@ -59,10 +59,10 @@ exports[`component:<Button> prop:outlined && prop:busy 1`] = `
|
|
|
59
59
|
</DocumentFragment>
|
|
60
60
|
`;
|
|
61
61
|
|
|
62
|
-
exports[`component:<Button> prop:
|
|
62
|
+
exports[`component:<Button> prop:secondary 1`] = `
|
|
63
63
|
<DocumentFragment>
|
|
64
64
|
<button
|
|
65
|
-
class="pressable button
|
|
65
|
+
class="pressable button secondary"
|
|
66
66
|
>
|
|
67
67
|
children
|
|
68
68
|
</button>
|
|
@@ -74,15 +74,20 @@ var Month = function Month(_ref) {
|
|
|
74
74
|
onPress: onPrevious,
|
|
75
75
|
"data-testid": testID ? "".concat(testID, "-previous") : undefined
|
|
76
76
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
77
|
+
headline: true,
|
|
78
|
+
level: 4,
|
|
77
79
|
name: "Left"
|
|
78
80
|
})), /*#__PURE__*/_react.default.createElement(_primitives.Text, {
|
|
79
|
-
|
|
81
|
+
headline: true,
|
|
82
|
+
level: 4,
|
|
80
83
|
className: _CalendarModule.default.title
|
|
81
84
|
}, (0, _helpers2.getHeader)(instance, locale)), onNext && /*#__PURE__*/_react.default.createElement(_primitives.Pressable, {
|
|
82
85
|
onPress: onNext,
|
|
83
86
|
className: _CalendarModule.default.pressable,
|
|
84
87
|
"data-testid": testID ? "".concat(testID, "-next") : undefined
|
|
85
88
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Icon, {
|
|
89
|
+
headline: true,
|
|
90
|
+
level: 4,
|
|
86
91
|
name: "Right"
|
|
87
92
|
}))), isDesktop && /*#__PURE__*/_react.default.createElement(_Calendar3.Weekdays, {
|
|
88
93
|
locale: locale
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Calendar.Month.js","names":["Month","focus","instance","selected","disabledPast","format","from","locale","range","to","onChange","onFocus","onNext","onPrevious","others","isDesktop","weekNumber","testID","style","month","className","header","undefined","title","pressable","VISIBLE_WEEKS","map","week","getMonth","getFullYear","displayName","propTypes","captions","PropTypes","shape","any","disabledDates","arrayOf","string","bool","instanceOf","Date","value","oneOfType","func"],"sources":["../../../src/components/Calendar/Calendar.Month.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, Pressable, Text, View } from '../../primitives';\nimport { VISIBLE_WEEKS } from './Calendar.constants';\nimport style from './Calendar.module.css';\nimport { Week } from './Calendar.Week';\nimport { Weekdays } from './Calendar.Weekdays';\nimport { getHeader, getWeekNumber } from './helpers';\n\nexport const Month = ({\n focus,\n instance,\n selected,\n disabledPast,\n format,\n from,\n locale,\n range = false,\n to,\n onChange = () => {},\n onFocus = () => {},\n onNext,\n onPrevious,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n const weekNumber = getWeekNumber(instance);\n\n const { ['data-testid']: testID } = others;\n\n return (\n <View className={styles(style.month, others.className)}>\n <View row className={style.header}>\n {onPrevious && (\n <Pressable onPress={onPrevious} data-testid={testID ? `${testID}-previous` : undefined}>\n <Icon name=\"Left\" />\n </Pressable>\n )}\n <Text
|
|
1
|
+
{"version":3,"file":"Calendar.Month.js","names":["Month","focus","instance","selected","disabledPast","format","from","locale","range","to","onChange","onFocus","onNext","onPrevious","others","isDesktop","weekNumber","testID","style","month","className","header","undefined","title","pressable","VISIBLE_WEEKS","map","week","getMonth","getFullYear","displayName","propTypes","captions","PropTypes","shape","any","disabledDates","arrayOf","string","bool","instanceOf","Date","value","oneOfType","func"],"sources":["../../../src/components/Calendar/Calendar.Month.jsx"],"sourcesContent":["import PropTypes from 'prop-types';\nimport React from 'react';\n\nimport { styles } from '../../helpers';\nimport { useDevice } from '../../hooks';\nimport { Icon, Pressable, Text, View } from '../../primitives';\nimport { VISIBLE_WEEKS } from './Calendar.constants';\nimport style from './Calendar.module.css';\nimport { Week } from './Calendar.Week';\nimport { Weekdays } from './Calendar.Weekdays';\nimport { getHeader, getWeekNumber } from './helpers';\n\nexport const Month = ({\n focus,\n instance,\n selected,\n disabledPast,\n format,\n from,\n locale,\n range = false,\n to,\n onChange = () => {},\n onFocus = () => {},\n onNext,\n onPrevious,\n ...others\n}) => {\n const { isDesktop } = useDevice();\n const weekNumber = getWeekNumber(instance);\n\n const { ['data-testid']: testID } = others;\n\n return (\n <View className={styles(style.month, others.className)}>\n <View row className={style.header}>\n {onPrevious && (\n <Pressable onPress={onPrevious} data-testid={testID ? `${testID}-previous` : undefined}>\n <Icon headline level={4} name=\"Left\" />\n </Pressable>\n )}\n <Text headline level={4} className={style.title}>\n {getHeader(instance, locale)}\n </Text>\n {onNext && (\n <Pressable onPress={onNext} className={style.pressable} data-testid={testID ? `${testID}-next` : undefined}>\n <Icon headline level={4} name=\"Right\" />\n </Pressable>\n )}\n </View>\n\n {isDesktop && <Weekdays locale={locale} />}\n\n {VISIBLE_WEEKS.map((week) => (\n <Week\n {...{\n ...others,\n disabledPast,\n focus,\n format,\n from,\n locale,\n to,\n range,\n selected,\n }}\n key={week}\n month={instance.getMonth()}\n number={weekNumber + week}\n year={instance.getFullYear()}\n onFocus={onFocus}\n onPress={onChange}\n />\n ))}\n </View>\n );\n};\n\nMonth.displayName = 'Component:Calendar:Month';\n\nMonth.propTypes = {\n captions: PropTypes.shape({}),\n focus: PropTypes.any,\n instance: PropTypes.any,\n selected: PropTypes.any,\n disabledDates: PropTypes.arrayOf(PropTypes.string),\n disabledPast: PropTypes.bool,\n format: PropTypes.string,\n from: PropTypes.instanceOf(Date),\n locale: PropTypes.string,\n range: PropTypes.bool,\n to: PropTypes.instanceOf(Date),\n value: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),\n onChange: PropTypes.func,\n onFocus: PropTypes.func,\n onNext: PropTypes.func,\n onPrevious: PropTypes.func,\n};\n"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;AAEO,IAAMA,KAAK,GAAG,SAARA,KAAQ,OAef;EAAA,IAdJC,KAcI,QAdJA,KAcI;EAAA,IAbJC,QAaI,QAbJA,QAa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;EAShBlC,MAAM,EAAE0B,mBAAUK,MATF;EAUhB9B,KAAK,EAAEyB,mBAAUM,IAVD;EAWhB9B,EAAE,EAAEwB,mBAAUO,UAAV,CAAqBC,IAArB,CAXY;EAYhBC,KAAK,EAAET,mBAAUU,SAAV,CAAoB,CAACV,mBAAUK,MAAX,EAAmBL,mBAAUI,OAAV,CAAkBJ,mBAAUK,MAA5B,CAAnB,CAApB,CAZS;EAahB5B,QAAQ,EAAEuB,mBAAUW,IAbJ;EAchBjC,OAAO,EAAEsB,mBAAUW,IAdH;EAehBhC,MAAM,EAAEqB,mBAAUW,IAfF;EAgBhB/B,UAAU,EAAEoB,mBAAUW;AAhBN,CAAlB"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = exports.Story = void 0;
|
|
9
|
+
|
|
10
|
+
var React = _interopRequireWildcard(require("react"));
|
|
11
|
+
|
|
12
|
+
var _Calendar = require("./Calendar");
|
|
13
|
+
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
|
|
16
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
17
|
+
|
|
18
|
+
var _default = {
|
|
19
|
+
title: 'Components'
|
|
20
|
+
};
|
|
21
|
+
exports.default = _default;
|
|
22
|
+
|
|
23
|
+
var Story = function Story(props) {
|
|
24
|
+
return /*#__PURE__*/React.createElement(_Calendar.Calendar, props);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
exports.Story = Story;
|
|
28
|
+
Story.storyName = 'Calendar';
|
|
29
|
+
Story.args = {
|
|
30
|
+
captions: {},
|
|
31
|
+
disabledDates: [],
|
|
32
|
+
disabledPast: true,
|
|
33
|
+
format: 'DD/MM/YYYY',
|
|
34
|
+
// children: 'Hello',
|
|
35
|
+
// disabled: false,
|
|
36
|
+
// large: false,
|
|
37
|
+
locale: 'en-GB',
|
|
38
|
+
months: 3,
|
|
39
|
+
range: true,
|
|
40
|
+
rangeMaxDays: 7,
|
|
41
|
+
rangeMinDays: 3 // outlined: false,
|
|
42
|
+
// rounded: false,
|
|
43
|
+
// small: false,
|
|
44
|
+
// squared: false,
|
|
45
|
+
// tag: 'Calendar',
|
|
46
|
+
// wide: false,
|
|
47
|
+
|
|
48
|
+
};
|
|
49
|
+
Story.argTypes = {// onChange: { action: 'onChange' },
|
|
50
|
+
// onFocus: { action: 'onFocus' },
|
|
51
|
+
// onNavigation: { action: 'onNavigation' }, // ! TODO:
|
|
52
|
+
// onScroll: { action: 'onScroll' },
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=Calendar.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Calendar.stories.js","names":["title","Story","props","storyName","args","captions","disabledDates","disabledPast","format","locale","months","range","rangeMaxDays","rangeMinDays","argTypes"],"sources":["../../../src/components/Calendar/Calendar.stories.jsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Calendar } from './Calendar';\n\nexport default { title: 'Components' };\n\nexport const Story = (props) => <Calendar {...props} />;\n\nStory.storyName = 'Calendar';\n\nStory.args = {\n captions: {},\n disabledDates: [],\n disabledPast: true,\n format: 'DD/MM/YYYY',\n // children: 'Hello',\n // disabled: false,\n // large: false,\n locale: 'en-GB',\n months: 3,\n range: true,\n rangeMaxDays: 7,\n rangeMinDays: 3,\n // outlined: false,\n // rounded: false,\n // small: false,\n // squared: false,\n // tag: 'Calendar',\n // wide: false,\n};\n\nStory.argTypes = {\n // onChange: { action: 'onChange' },\n // onFocus: { action: 'onFocus' },\n // onNavigation: { action: 'onNavigation' }, // ! TODO:\n // onScroll: { action: 'onScroll' },\n};\n"],"mappings":";;;;;;;;;AAAA;;AAEA;;;;;;eAEe;EAAEA,KAAK,EAAE;AAAT,C;;;AAER,IAAMC,KAAK,GAAG,SAARA,KAAQ,CAACC,KAAD;EAAA,oBAAW,oBAAC,kBAAD,EAAcA,KAAd,CAAX;AAAA,CAAd;;;AAEPD,KAAK,CAACE,SAAN,GAAkB,UAAlB;AAEAF,KAAK,CAACG,IAAN,GAAa;EACXC,QAAQ,EAAE,EADC;EAEXC,aAAa,EAAE,EAFJ;EAGXC,YAAY,EAAE,IAHH;EAIXC,MAAM,EAAE,YAJG;EAKX;EACA;EACA;EACAC,MAAM,EAAE,OARG;EASXC,MAAM,EAAE,CATG;EAUXC,KAAK,EAAE,IAVI;EAWXC,YAAY,EAAE,CAXH;EAYXC,YAAY,EAAE,CAZH,CAaX;EACA;EACA;EACA;EACA;EACA;;AAlBW,CAAb;AAqBAZ,KAAK,CAACa,QAAN,GAAiB,CACf;EACA;EACA;EACA;AAJe,CAAjB"}
|