@instructure/ui-time-select 10.0.1-snapshot-10 → 10.0.1-snapshot-11

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,7 +3,7 @@
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.0.1-snapshot-10](https://github.com/instructure/instructure-ui/compare/v10.0.0...v10.0.1-snapshot-10) (2024-08-14)
6
+ ## [10.0.1-snapshot-11](https://github.com/instructure/instructure-ui/compare/v10.0.0...v10.0.1-snapshot-11) (2024-08-14)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-time-select
9
9
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-time-select",
3
- "version": "10.0.1-snapshot-10",
3
+ "version": "10.0.1-snapshot-11",
4
4
  "description": "A component for selecting time values.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -24,21 +24,21 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "@babel/runtime": "^7.24.5",
27
- "@instructure/shared-types": "10.0.1-snapshot-10",
28
- "@instructure/ui-form-field": "10.0.1-snapshot-10",
29
- "@instructure/ui-i18n": "10.0.1-snapshot-10",
30
- "@instructure/ui-position": "10.0.1-snapshot-10",
31
- "@instructure/ui-prop-types": "10.0.1-snapshot-10",
32
- "@instructure/ui-react-utils": "10.0.1-snapshot-10",
33
- "@instructure/ui-select": "10.0.1-snapshot-10",
34
- "@instructure/ui-test-locator": "10.0.1-snapshot-10",
35
- "@instructure/ui-testable": "10.0.1-snapshot-10",
36
- "@instructure/ui-utils": "10.0.1-snapshot-10",
27
+ "@instructure/shared-types": "10.0.1-snapshot-11",
28
+ "@instructure/ui-form-field": "10.0.1-snapshot-11",
29
+ "@instructure/ui-i18n": "10.0.1-snapshot-11",
30
+ "@instructure/ui-position": "10.0.1-snapshot-11",
31
+ "@instructure/ui-prop-types": "10.0.1-snapshot-11",
32
+ "@instructure/ui-react-utils": "10.0.1-snapshot-11",
33
+ "@instructure/ui-select": "10.0.1-snapshot-11",
34
+ "@instructure/ui-test-locator": "10.0.1-snapshot-11",
35
+ "@instructure/ui-testable": "10.0.1-snapshot-11",
36
+ "@instructure/ui-utils": "10.0.1-snapshot-11",
37
37
  "prop-types": "^15.8.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@instructure/ui-babel-preset": "10.0.1-snapshot-10",
41
- "@instructure/ui-test-utils": "10.0.1-snapshot-10",
40
+ "@instructure/ui-babel-preset": "10.0.1-snapshot-11",
41
+ "@instructure/ui-test-utils": "10.0.1-snapshot-11",
42
42
  "moment-timezone": "^0.5.43"
43
43
  },
44
44
  "peerDependencies": {
@@ -24,36 +24,54 @@ type: example
24
24
 
25
25
  To use `TimeSelect` controlled, simply provide the `value` prop an ISO string. The `onChange` callback provides the ISO value of the corresponding option that was selected. Use this value to update the state.
26
26
 
27
- ```javascript
28
- ---
29
- type: example
30
- ---
31
- class Example extends React.Component {
32
- state = {
33
- value: '2020-05-18T23:59:00'
34
- }
27
+ - ```javascript
28
+ class Example extends React.Component {
29
+ state = {
30
+ value: '2020-05-18T23:59:00'
31
+ }
35
32
 
36
- handleChange = (e, { value }) => {
37
- this.setState({ value })
33
+ handleChange = (e, { value }) => {
34
+ this.setState({ value })
35
+ }
36
+
37
+ render() {
38
+ return (
39
+ <TimeSelect
40
+ renderLabel="Choose a time"
41
+ placeholder="e.g., 4:00:00 PM"
42
+ value={this.state.value}
43
+ step={15}
44
+ format="LTS"
45
+ onChange={this.handleChange}
46
+ />
47
+ )
48
+ }
38
49
  }
50
+ render(<Example />)
51
+ ```
52
+
53
+ - ```js
54
+ const Example = () => {
55
+ const [value, setValue] = useState('2020-05-18T23:59:00')
56
+
57
+ const handleChange = (e, { value }) => {
58
+ setValue(value)
59
+ }
39
60
 
40
- render () {
41
61
  return (
42
62
  <TimeSelect
43
63
  renderLabel="Choose a time"
44
64
  placeholder="e.g., 4:00:00 PM"
45
- value={this.state.value}
65
+ value={value}
46
66
  step={15}
47
67
  format="LTS"
48
- onChange={this.handleChange}
68
+ onChange={handleChange}
49
69
  />
50
70
  )
51
71
  }
52
- }
53
- render(
54
- <Example />
55
- )
56
- ```
72
+
73
+ render(<Example />)
74
+ ```
57
75
 
58
76
  ### Freeform input
59
77