@instructure/ui-calendar 10.24.3-snapshot-9 → 10.24.3-snapshot-10

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.24.3-snapshot-9](https://github.com/instructure/instructure-ui/compare/v10.24.2...v10.24.3-snapshot-9) (2025-08-28)
6
+ ## [10.24.3-snapshot-10](https://github.com/instructure/instructure-ui/compare/v10.24.2...v10.24.3-snapshot-10) (2025-08-29)
7
7
 
8
8
  **Note:** Version bump only for package @instructure/ui-calendar
9
9
 
@@ -1,4 +1,4 @@
1
- var _dec, _dec2, _class, _Calendar, _IconButton, _IconButton2;
1
+ var _dec, _dec2, _dec3, _class, _Calendar, _IconButton, _IconButton2;
2
2
  /*
3
3
  * The MIT License (MIT)
4
4
  *
@@ -25,10 +25,9 @@ var _dec, _dec2, _class, _Calendar, _IconButton, _IconButton2;
25
25
 
26
26
  import { Children, Component } from 'react';
27
27
  import { View } from '@instructure/ui-view';
28
- import { safeCloneElement, callRenderProp, omitProps } from '@instructure/ui-react-utils';
28
+ import { safeCloneElement, callRenderProp, omitProps, withDeterministicId } from '@instructure/ui-react-utils';
29
29
  import { createChainedFunction } from '@instructure/ui-utils';
30
30
  import { logError as error } from '@instructure/console';
31
- import { uid } from '@instructure/uid';
32
31
  import { AccessibleContent } from '@instructure/ui-a11y-content';
33
32
  import { testable } from '@instructure/ui-testable';
34
33
  import { withStyle } from '@instructure/emotion';
@@ -47,16 +46,11 @@ category: components
47
46
  ---
48
47
  **/
49
48
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
50
- let Calendar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_Calendar = class Calendar extends Component {
49
+ let Calendar = (_dec = withDeterministicId(), _dec2 = withStyle(generateStyle, generateComponentTheme), _dec3 = testable(), _dec(_class = _dec2(_class = _dec3(_class = (_Calendar = class Calendar extends Component {
51
50
  constructor(props) {
52
51
  super(props);
53
52
  this.ref = null;
54
- this._weekdayHeaderIds = (this.props.renderWeekdayLabels || this.defaultWeekdays).reduce((ids, _label, i) => {
55
- return {
56
- ...ids,
57
- [i]: uid(`weekday-header-${i}`)
58
- };
59
- }, {});
53
+ this._weekdayHeaderIds = void 0;
60
54
  this.handleRef = el => {
61
55
  this.ref = el;
62
56
  };
@@ -152,6 +146,12 @@ let Calendar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
152
146
  this.props.onDateSelected(parsedDate.toISOString(), parsedDate, event);
153
147
  }
154
148
  };
149
+ this._weekdayHeaderIds = (this.props.renderWeekdayLabels || this.defaultWeekdays).reduce((ids, _label, i) => {
150
+ return {
151
+ ...ids,
152
+ [i]: this.props.deterministicId('weekday-header')
153
+ };
154
+ }, {});
155
155
  this.state = this.calculateState(this.locale(), this.timezone(), props.currentDate);
156
156
  }
157
157
  componentDidMount() {
@@ -403,6 +403,6 @@ let Calendar = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 =
403
403
  }, _Calendar.displayName = "Calendar", _Calendar.componentId = 'Calendar', _Calendar.contextType = ApplyLocaleContext, _Calendar.Day = Day, _Calendar.DAY_COUNT = 42, _Calendar.propTypes = propTypes, _Calendar.allowedProps = allowedProps, _Calendar.defaultProps = {
404
404
  as: 'span',
405
405
  role: 'table'
406
- }, _Calendar)) || _class) || _class);
406
+ }, _Calendar)) || _class) || _class) || _class);
407
407
  export default Calendar;
408
408
  export { Calendar };
@@ -10,9 +10,9 @@ var _View = require("@instructure/ui-view/lib/View");
10
10
  var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
11
11
  var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
12
12
  var _omitProps = require("@instructure/ui-react-utils/lib/omitProps.js");
13
+ var _withDeterministicId = require("@instructure/ui-react-utils/lib/DeterministicIdContext/withDeterministicId.js");
13
14
  var _createChainedFunction = require("@instructure/ui-utils/lib/createChainedFunction.js");
14
15
  var _console = require("@instructure/console");
15
- var _uid = require("@instructure/uid");
16
16
  var _AccessibleContent = require("@instructure/ui-a11y-content/lib/AccessibleContent");
17
17
  var _testable = require("@instructure/ui-testable/lib/testable.js");
18
18
  var _emotion = require("@instructure/emotion");
@@ -28,7 +28,7 @@ var _IconArrowOpenStartSolid = require("@instructure/ui-icons/lib/IconArrowOpenS
28
28
  var _IconArrowOpenEndSolid = require("@instructure/ui-icons/lib/IconArrowOpenEndSolid.js");
29
29
  var _SimpleSelect = require("@instructure/ui-simple-select/lib/SimpleSelect");
30
30
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
31
- var _dec, _dec2, _class, _Calendar, _IconButton, _IconButton2;
31
+ var _dec, _dec2, _dec3, _class, _Calendar, _IconButton, _IconButton2;
32
32
  /*
33
33
  * The MIT License (MIT)
34
34
  *
@@ -57,16 +57,11 @@ var _dec, _dec2, _class, _Calendar, _IconButton, _IconButton2;
57
57
  category: components
58
58
  ---
59
59
  **/
60
- let Calendar = exports.Calendar = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_Calendar = class Calendar extends _react.Component {
60
+ let Calendar = exports.Calendar = (_dec = (0, _withDeterministicId.withDeterministicId)(), _dec2 = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec3 = (0, _testable.testable)(), _dec(_class = _dec2(_class = _dec3(_class = (_Calendar = class Calendar extends _react.Component {
61
61
  constructor(props) {
62
62
  super(props);
63
63
  this.ref = null;
64
- this._weekdayHeaderIds = (this.props.renderWeekdayLabels || this.defaultWeekdays).reduce((ids, _label, i) => {
65
- return {
66
- ...ids,
67
- [i]: (0, _uid.uid)(`weekday-header-${i}`)
68
- };
69
- }, {});
64
+ this._weekdayHeaderIds = void 0;
70
65
  this.handleRef = el => {
71
66
  this.ref = el;
72
67
  };
@@ -162,6 +157,12 @@ let Calendar = exports.Calendar = (_dec = (0, _emotion.withStyle)(_styles.defaul
162
157
  this.props.onDateSelected(parsedDate.toISOString(), parsedDate, event);
163
158
  }
164
159
  };
160
+ this._weekdayHeaderIds = (this.props.renderWeekdayLabels || this.defaultWeekdays).reduce((ids, _label, i) => {
161
+ return {
162
+ ...ids,
163
+ [i]: this.props.deterministicId('weekday-header')
164
+ };
165
+ }, {});
165
166
  this.state = this.calculateState(this.locale(), this.timezone(), props.currentDate);
166
167
  }
167
168
  componentDidMount() {
@@ -413,5 +414,5 @@ let Calendar = exports.Calendar = (_dec = (0, _emotion.withStyle)(_styles.defaul
413
414
  }, _Calendar.displayName = "Calendar", _Calendar.componentId = 'Calendar', _Calendar.contextType = _ApplyLocaleContext.ApplyLocaleContext, _Calendar.Day = _Day.Day, _Calendar.DAY_COUNT = 42, _Calendar.propTypes = _props.propTypes, _Calendar.allowedProps = _props.allowedProps, _Calendar.defaultProps = {
414
415
  as: 'span',
415
416
  role: 'table'
416
- }, _Calendar)) || _class) || _class);
417
+ }, _Calendar)) || _class) || _class) || _class);
417
418
  var _default = exports.default = Calendar;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-calendar",
3
- "version": "10.24.3-snapshot-9",
3
+ "version": "10.24.3-snapshot-10",
4
4
  "description": "A calendar component.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "10.24.3-snapshot-9",
27
- "@instructure/ui-color-utils": "10.24.3-snapshot-9",
28
- "@instructure/ui-themes": "10.24.3-snapshot-9",
26
+ "@instructure/ui-babel-preset": "10.24.3-snapshot-10",
27
+ "@instructure/ui-color-utils": "10.24.3-snapshot-10",
28
+ "@instructure/ui-themes": "10.24.3-snapshot-10",
29
29
  "@testing-library/jest-dom": "^6.6.3",
30
30
  "@testing-library/react": "^16.0.1",
31
31
  "@testing-library/user-event": "^14.6.1",
@@ -33,20 +33,20 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.27.6",
36
- "@instructure/console": "10.24.3-snapshot-9",
37
- "@instructure/emotion": "10.24.3-snapshot-9",
38
- "@instructure/shared-types": "10.24.3-snapshot-9",
39
- "@instructure/ui-a11y-content": "10.24.3-snapshot-9",
40
- "@instructure/ui-buttons": "10.24.3-snapshot-9",
41
- "@instructure/ui-i18n": "10.24.3-snapshot-9",
42
- "@instructure/ui-icons": "10.24.3-snapshot-9",
43
- "@instructure/ui-prop-types": "10.24.3-snapshot-9",
44
- "@instructure/ui-react-utils": "10.24.3-snapshot-9",
45
- "@instructure/ui-simple-select": "10.24.3-snapshot-9",
46
- "@instructure/ui-testable": "10.24.3-snapshot-9",
47
- "@instructure/ui-utils": "10.24.3-snapshot-9",
48
- "@instructure/ui-view": "10.24.3-snapshot-9",
49
- "@instructure/uid": "10.24.3-snapshot-9",
36
+ "@instructure/console": "10.24.3-snapshot-10",
37
+ "@instructure/emotion": "10.24.3-snapshot-10",
38
+ "@instructure/shared-types": "10.24.3-snapshot-10",
39
+ "@instructure/ui-a11y-content": "10.24.3-snapshot-10",
40
+ "@instructure/ui-buttons": "10.24.3-snapshot-10",
41
+ "@instructure/ui-i18n": "10.24.3-snapshot-10",
42
+ "@instructure/ui-icons": "10.24.3-snapshot-10",
43
+ "@instructure/ui-prop-types": "10.24.3-snapshot-10",
44
+ "@instructure/ui-react-utils": "10.24.3-snapshot-10",
45
+ "@instructure/ui-simple-select": "10.24.3-snapshot-10",
46
+ "@instructure/ui-testable": "10.24.3-snapshot-10",
47
+ "@instructure/ui-utils": "10.24.3-snapshot-10",
48
+ "@instructure/ui-view": "10.24.3-snapshot-10",
49
+ "@instructure/uid": "10.24.3-snapshot-10",
50
50
  "prop-types": "^15.8.1"
51
51
  },
52
52
  "peerDependencies": {
@@ -28,11 +28,11 @@ import { View } from '@instructure/ui-view'
28
28
  import {
29
29
  safeCloneElement,
30
30
  callRenderProp,
31
- omitProps
31
+ omitProps,
32
+ withDeterministicId
32
33
  } from '@instructure/ui-react-utils'
33
34
  import { createChainedFunction } from '@instructure/ui-utils'
34
35
  import { logError as error } from '@instructure/console'
35
- import { uid } from '@instructure/uid'
36
36
  import { AccessibleContent } from '@instructure/ui-a11y-content'
37
37
 
38
38
  import { testable } from '@instructure/ui-testable'
@@ -64,6 +64,7 @@ import { SimpleSelect } from '@instructure/ui-simple-select'
64
64
  category: components
65
65
  ---
66
66
  **/
67
+ @withDeterministicId()
67
68
  @withStyle(generateStyle, generateComponentTheme)
68
69
  @testable()
69
70
  class Calendar extends Component<CalendarProps, CalendarState> {
@@ -82,14 +83,15 @@ class Calendar extends Component<CalendarProps, CalendarState> {
82
83
  }
83
84
 
84
85
  ref: Element | null = null
85
- private _weekdayHeaderIds = (
86
- this.props.renderWeekdayLabels || this.defaultWeekdays
87
- ).reduce((ids: Record<number, string>, _label, i) => {
88
- return { ...ids, [i]: uid(`weekday-header-${i}`) }
89
- }, {})
86
+ private _weekdayHeaderIds
87
+
90
88
  constructor(props: CalendarProps) {
91
89
  super(props)
92
-
90
+ this._weekdayHeaderIds = (
91
+ this.props.renderWeekdayLabels || this.defaultWeekdays
92
+ ).reduce((ids: Record<number, string>, _label, i) => {
93
+ return { ...ids, [i]: this.props.deterministicId!('weekday-header') }
94
+ }, {})
93
95
  this.state = this.calculateState(
94
96
  this.locale(),
95
97
  this.timezone(),
@@ -38,6 +38,7 @@ import { ReactElement } from 'react'
38
38
  import type { CalendarDayProps } from './Day/props'
39
39
  import { Renderable } from '@instructure/shared-types'
40
40
  import type { Moment } from '@instructure/ui-i18n'
41
+ import type { WithDeterministicIdProps } from '@instructure/ui-react-utils'
41
42
 
42
43
  type CalendarOwnProps = {
43
44
  /**
@@ -178,7 +179,8 @@ type AllowedPropKeys = Readonly<Array<PropKeys>>
178
179
 
179
180
  type CalendarProps = CalendarOwnProps &
180
181
  WithStyleProps<CalendarTheme, CalendarStyle> &
181
- OtherHTMLAttributes<CalendarOwnProps>
182
+ OtherHTMLAttributes<CalendarOwnProps> &
183
+ WithDeterministicIdProps
182
184
 
183
185
  type CalendarStyle = ComponentStyle<
184
186
  'navigation' | 'navigationWithButtons' | 'weekdayHeader' | 'yearPicker'