@instructure/ui-calendar 10.2.1 → 10.2.2-pr-snapshot-1726164252153

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/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.2.2-pr-snapshot-1726164252153](https://github.com/instructure/instructure-ui/compare/v10.2.1...v10.2.2-pr-snapshot-1726164252153) (2024-09-12)
7
+
8
+ **Note:** Version bump only for package @instructure/ui-calendar
9
+
10
+
11
+
12
+
13
+
6
14
  ## [10.2.1](https://github.com/instructure/instructure-ui/compare/v10.2.0...v10.2.1) (2024-08-30)
7
15
 
8
16
  **Note:** Version bump only for package @instructure/ui-calendar
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-calendar",
3
- "version": "10.2.1",
3
+ "version": "10.2.2-pr-snapshot-1726164252153",
4
4
  "description": "A calendar component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,31 +23,31 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "10.2.1",
27
- "@instructure/ui-color-utils": "10.2.1",
28
- "@instructure/ui-test-locator": "10.2.1",
29
- "@instructure/ui-test-utils": "10.2.1",
30
- "@instructure/ui-themes": "10.2.1",
26
+ "@instructure/ui-babel-preset": "10.2.2-pr-snapshot-1726164252153",
27
+ "@instructure/ui-color-utils": "10.2.2-pr-snapshot-1726164252153",
28
+ "@instructure/ui-test-locator": "10.2.2-pr-snapshot-1726164252153",
29
+ "@instructure/ui-test-utils": "10.2.2-pr-snapshot-1726164252153",
30
+ "@instructure/ui-themes": "10.2.2-pr-snapshot-1726164252153",
31
31
  "@testing-library/jest-dom": "^6.4.6",
32
32
  "@testing-library/react": "^15.0.7",
33
33
  "vitest": "^2.0.2"
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.24.5",
37
- "@instructure/console": "10.2.1",
38
- "@instructure/emotion": "10.2.1",
39
- "@instructure/shared-types": "10.2.1",
40
- "@instructure/ui-a11y-content": "10.2.1",
41
- "@instructure/ui-buttons": "10.2.1",
42
- "@instructure/ui-i18n": "10.2.1",
43
- "@instructure/ui-icons": "10.2.1",
44
- "@instructure/ui-prop-types": "10.2.1",
45
- "@instructure/ui-react-utils": "10.2.1",
46
- "@instructure/ui-simple-select": "10.2.1",
47
- "@instructure/ui-testable": "10.2.1",
48
- "@instructure/ui-utils": "10.2.1",
49
- "@instructure/ui-view": "10.2.1",
50
- "@instructure/uid": "10.2.1",
37
+ "@instructure/console": "10.2.2-pr-snapshot-1726164252153",
38
+ "@instructure/emotion": "10.2.2-pr-snapshot-1726164252153",
39
+ "@instructure/shared-types": "10.2.2-pr-snapshot-1726164252153",
40
+ "@instructure/ui-a11y-content": "10.2.2-pr-snapshot-1726164252153",
41
+ "@instructure/ui-buttons": "10.2.2-pr-snapshot-1726164252153",
42
+ "@instructure/ui-i18n": "10.2.2-pr-snapshot-1726164252153",
43
+ "@instructure/ui-icons": "10.2.2-pr-snapshot-1726164252153",
44
+ "@instructure/ui-prop-types": "10.2.2-pr-snapshot-1726164252153",
45
+ "@instructure/ui-react-utils": "10.2.2-pr-snapshot-1726164252153",
46
+ "@instructure/ui-simple-select": "10.2.2-pr-snapshot-1726164252153",
47
+ "@instructure/ui-testable": "10.2.2-pr-snapshot-1726164252153",
48
+ "@instructure/ui-utils": "10.2.2-pr-snapshot-1726164252153",
49
+ "@instructure/ui-view": "10.2.2-pr-snapshot-1726164252153",
50
+ "@instructure/uid": "10.2.2-pr-snapshot-1726164252153",
51
51
  "prop-types": "^15.8.1"
52
52
  },
53
53
  "peerDependencies": {
@@ -19,71 +19,127 @@ type: example
19
19
 
20
20
  ### Default config with additional props
21
21
 
22
- ```js
23
- ---
24
- type: example
25
- ---
26
- class Example extends React.Component {
27
- state = {
28
- selectedDate: "",
29
- visibleMonth:"2025-05"
22
+ - ```js
23
+ class Example extends React.Component {
24
+ state = {
25
+ selectedDate: '',
26
+ visibleMonth: '2025-05'
30
27
  }
31
28
 
32
- setVisibleMonth = () => {
33
- this.setState({visibleMonth: "2028-09"})
29
+ render = () => (
30
+ <Calendar
31
+ visibleMonth={this.state.visibleMonth}
32
+ currentDate="2023-12-15"
33
+ disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
34
+ selectedDate={this.state.selectedDate}
35
+ onRequestRenderNextMonth={(_e, requestedMonth) =>
36
+ this.setState({ visibleMonth: requestedMonth })
37
+ }
38
+ onRequestRenderPrevMonth={(_e, requestedMonth) =>
39
+ this.setState({ visibleMonth: requestedMonth })
40
+ }
41
+ onDateSelected={(date) => {
42
+ this.setState({ selectedDate: date })
43
+ }}
44
+ />
45
+ )
34
46
  }
35
- render = () =>
36
- <Calendar
37
- visibleMonth={this.state.visibleMonth}
38
- currentDate="2023-12-15"
39
- disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
40
- selectedDate={this.state.selectedDate}
41
- onRequestRenderNextMonth={(_e, requestedMonth) => this.setState({visibleMonth: requestedMonth})}
42
- onRequestRenderPrevMonth={(_e, requestedMonth) => this.setState({visibleMonth: requestedMonth})}
43
- onDateSelected={(date)=>{
44
- this.setState({selectedDate: date})
45
- }}
46
- />
47
- }
48
- render(<Example />)
49
- ```
47
+ render(<Example />)
48
+ ```
49
+
50
+ - ```js
51
+ const Example = () => {
52
+ const [selectedDate, setSelectedDate] = useState('')
53
+ const [visibleMonth, setVisibleMonth] = useState('2025-05')
54
+
55
+ return (
56
+ <Calendar
57
+ visibleMonth={visibleMonth}
58
+ currentDate="2023-12-15"
59
+ disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
60
+ selectedDate={selectedDate}
61
+ onRequestRenderNextMonth={(_e, requestedMonth) =>
62
+ setVisibleMonth(requestedMonth)
63
+ }
64
+ onRequestRenderPrevMonth={(_e, requestedMonth) =>
65
+ setVisibleMonth(requestedMonth)
66
+ }
67
+ onDateSelected={(date) => {
68
+ setSelectedDate(date)
69
+ }}
70
+ />
71
+ )
72
+ }
73
+ render(<Example />)
74
+ ```
50
75
 
51
76
  ### With year picker
52
77
 
53
- ```js
54
- ---
55
- type: example
56
- ---
57
- class Example extends React.Component {
58
- state = {
59
- selectedDate: "",
60
- visibleMonth:"2024-02"
78
+ - ```js
79
+ class Example extends React.Component {
80
+ state = {
81
+ selectedDate: '',
82
+ visibleMonth: '2024-02'
61
83
  }
62
84
 
63
- setVisibleMonth = () => {
64
- this.setState({visibleMonth: "2028-09"})
85
+ render = () => (
86
+ <Calendar
87
+ visibleMonth={this.state.visibleMonth}
88
+ currentDate="2024-02-29"
89
+ disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
90
+ selectedDate={this.state.selectedDate}
91
+ onRequestRenderNextMonth={(_e, requestedMonth) =>
92
+ this.setState({ visibleMonth: requestedMonth })
93
+ }
94
+ onRequestRenderPrevMonth={(_e, requestedMonth) =>
95
+ this.setState({ visibleMonth: requestedMonth })
96
+ }
97
+ onDateSelected={(date) => {
98
+ this.setState({ selectedDate: date })
99
+ }}
100
+ withYearPicker={{
101
+ screenReaderLabel: 'Year picker',
102
+ startYear: 1999,
103
+ endYear: 2024,
104
+ maxHeight: '200px'
105
+ }}
106
+ />
107
+ )
65
108
  }
66
- render = () =>
67
- <Calendar
68
- visibleMonth={this.state.visibleMonth}
69
- currentDate="2024-02-29"
70
- disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
71
- selectedDate={this.state.selectedDate}
72
- onRequestRenderNextMonth={(_e, requestedMonth) => this.setState({visibleMonth: requestedMonth})}
73
- onRequestRenderPrevMonth={(_e, requestedMonth) => this.setState({visibleMonth: requestedMonth})}
74
- onDateSelected={(date)=>{
75
- this.setState({selectedDate: date})
76
- }}
77
- withYearPicker={{
78
- screenReaderLabel: "Year picker",
79
- startYear:1999,
80
- endYear:2024,
81
- maxHeight: "200px"
82
- }}
83
- />
84
- }
85
- render(<Example />)
86
- ```
109
+ render(<Example />)
110
+ ```
111
+
112
+ - ```js
113
+ const Example = () => {
114
+ const [selectedDate, setSelectedDate] = useState('')
115
+ const [visibleMonth, setVisibleMonth] = useState('2024-02')
116
+
117
+ return (
118
+ <Calendar
119
+ visibleMonth={visibleMonth}
120
+ currentDate="2024-02-29"
121
+ disabledDates={['2023-12-22', '2023-12-12', '2023-12-11']}
122
+ selectedDate={selectedDate}
123
+ onRequestRenderNextMonth={(_e, requestedMonth) =>
124
+ setVisibleMonth(requestedMonth)
125
+ }
126
+ onRequestRenderPrevMonth={(_e, requestedMonth) =>
127
+ setVisibleMonth(requestedMonth)
128
+ }
129
+ onDateSelected={(date) => {
130
+ setSelectedDate(date)
131
+ }}
132
+ withYearPicker={{
133
+ screenReaderLabel: 'Year picker',
134
+ startYear: 1999,
135
+ endYear: 2024,
136
+ maxHeight: '200px'
137
+ }}
138
+ />
139
+ )
140
+ }
141
+ render(<Example />)
142
+ ```
87
143
 
88
144
  ### Composing a Calendar in your Application
89
145